/* When in Korea (WinK) - Universal Styles */

/* CSS Variables - Global Design System */
:root {
    --primary-color: #2e528f;
    --light-color: #f5f5f7;
    --dark-color: #1d1d1f;
    --highlight-color: #cf3540;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --error-color: #dc3545;
    
    /* Shadows */
    --shadow-light: 0 2px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 50px rgba(0, 0, 0, 0.2);
    --shadow-extreme: 0 25px 70px rgba(0, 0, 0, 0.3);
    
    /* Border Radius */
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.6s ease;
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, #1e3a6f 100%);
    --gradient-highlight: linear-gradient(135deg, var(--highlight-color) 0%, #a52d37 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 3rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--highlight-color);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

/* Button Base Styles */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    font-size: var(--font-size-base);
    line-height: 1;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: none;
    font-family: inherit;
}

.btn:focus {
    outline: 3px solid var(--highlight-color);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--gradient-highlight);
    color: var(--white);
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-heavy);
    color: var(--white);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* Form Elements */
input, textarea, select {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 82, 143, 0.1);
}

/* Animation Utilities */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Accessibility */
.keyboard-navigation *:focus {
    outline: 3px solid var(--highlight-color) !important;
    outline-offset: 2px !important;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.4);
        --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.5);
        --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.6);
    }
    
    .btn, input, textarea, select {
        border-width: 3px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body.auto-dark-mode {
        --white: #1a1a1a;
        --light-color: #2a2a2a;
        --dark-color: #ffffff;
        --gray-100: #333333;
        --gray-200: #404040;
        --gray-300: #4a4a4a;
        --gray-400: #555555;
        --gray-500: #666666;
        --gray-600: #777777;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

/* Selection Styles */
::selection {
    background: var(--highlight-color);
    color: var(--white);
}

::-moz-selection {
    background: var(--highlight-color);
    color: var(--white);
}

/* Base Responsive Breakpoints */
@media (max-width: 1200px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
}

/* Print Styles */
@media print {
    * {
        animation: none !important;
        transition: none !important;
        box-shadow: none !important;
    }
    
    .btn {
        border: 2px solid currentColor !important;
        background: transparent !important;
        color: inherit !important;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    .d-print-none {
        display: none !important;
    }
    
    .d-print-block {
        display: block !important;
    }
}
