/* =====================================================
   GPPC UPGRADED DESIGN SYSTEM
   Apple-Level Sophistication | Brand Coherent
   ===================================================== */

/* ==================== CSS RESET ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== DESIGN TOKENS ==================== */

:root {
    /* ===== BRAND COLORS ===== */
    /* Primary - Navy Blue */
    --navy-900: #0F1726;        /* Deepest navy for high contrast */
    --navy-800: #1A2942;        /* Brand navy - primary */
    --navy-700: #243B5E;        /* Lighter navy */
    --navy-600: #2F4D75;        /* Mid navy */
    --navy-500: #3F5F8F;        /* Light navy */

    /* Secondary - Turquoise */
    --turquoise-900: #4A9B9F;   /* Deep turquoise */
    --turquoise-800: #79C9CE;   /* Brand turquoise - primary */
    --turquoise-700: #8FD3D7;   /* Light turquoise */
    --turquoise-600: #A5DBE0;   /* Lighter turquoise */
    --turquoise-500: #BBE3E7;   /* Very light turquoise */
    --turquoise-400: #D1EBEE;   /* Pale turquoise */
    --turquoise-300: #E8F5F7;   /* Very pale turquoise */
    --turquoise-200: #F4FAFB;   /* Almost white turquoise */

    /* Neutrals */
    --white: #FFFFFF;
    --off-white: #FAFBFC;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --black: #000000;

    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: var(--turquoise-800);

    /* ===== TYPOGRAPHY ===== */
    /* Font Families */
    --font-primary: 'Lato', arial, sans-serif;
    --font-chinese: 'Ubuntu', 'PingFang TC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;

    /* Type Scale (Perfect Fourth 1.333) */
    --text-xs: 0.75rem;       /* 12px */
    --text-sm: 0.875rem;      /* 14px */
    --text-base: 1rem;        /* 16px */
    --text-lg: 1.125rem;      /* 18px */
    --text-xl: 1.333rem;      /* 21px */
    --text-2xl: 1.777rem;     /* 28px */
    --text-3xl: 2.369rem;     /* 38px */
    --text-4xl: 3.157rem;     /* 50px */
    --text-5xl: 4.209rem;     /* 67px */
    --text-6xl: 5.61rem;      /* 90px */

    /* Font Weights */
    --weight-light: 300;
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* ===== SPACING SCALE ===== */
    --space-0: 0;
    --space-1: 0.25rem;       /* 4px */
    --space-2: 0.5rem;        /* 8px */
    --space-3: 0.75rem;       /* 12px */
    --space-4: 1rem;          /* 16px */
    --space-5: 1.25rem;       /* 20px */
    --space-6: 1.5rem;        /* 24px */
    --space-8: 2rem;          /* 32px */
    --space-10: 2.5rem;       /* 40px */
    --space-12: 3rem;         /* 48px */
    --space-16: 4rem;         /* 64px */
    --space-20: 5rem;         /* 80px */
    --space-24: 6rem;         /* 96px */
    --space-32: 8rem;         /* 128px */
    --space-40: 10rem;        /* 160px */
    --space-48: 12rem;        /* 192px */
    --space-56: 14rem;        /* 224px */
    --space-64: 16rem;        /* 256px */

    /* Section Spacing (Generous) */
    --section-sm: var(--space-24);    /* 96px */
    --section-md: var(--space-32);    /* 128px */
    --section-lg: var(--space-48);    /* 192px */
    --section-xl: var(--space-64);    /* 256px */

    /* ===== LAYOUT ===== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;
    --container-max: var(--container-2xl);

    --gutter: var(--space-6);
    --gutter-lg: var(--space-8);

    /* ===== BORDERS ===== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    --border-width: 1px;
    --border-width-thick: 2px;

    /* ===== SHADOWS (Apple-inspired subtle depth) ===== */
    --shadow-xs: 0 1px 2px 0 rgba(26, 41, 66, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(26, 41, 66, 0.06),
                 0 1px 2px -1px rgba(26, 41, 66, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(26, 41, 66, 0.08),
                 0 2px 4px -2px rgba(26, 41, 66, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(26, 41, 66, 0.10),
                 0 4px 6px -4px rgba(26, 41, 66, 0.10);
    --shadow-xl: 0 20px 25px -5px rgba(26, 41, 66, 0.10),
                 0 8px 10px -6px rgba(26, 41, 66, 0.10);
    --shadow-2xl: 0 25px 50px -12px rgba(26, 41, 66, 0.15);

    /* Colored Shadows */
    --shadow-turquoise: 0 10px 25px -5px rgba(121, 201, 206, 0.2);
    --shadow-navy: 0 10px 25px -5px rgba(26, 41, 66, 0.3);

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ===== Z-INDEX SCALE ===== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ==================== BASE STYLES ==================== */

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-relaxed);
    color: var(--gray-800);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Chinese Language Override */
body[lang="zh"],
body[lang="zh-CN"],
body[lang="zh-TW"],
.zh {
    font-family: var(--font-chinese);
}

/* ==================== TYPOGRAPHY ==================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--navy-800);
    margin-bottom: var(--space-4);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--weight-bold);
    line-height: 1.1;
    letter-spacing: var(--tracking-tighter);
}

h2 {
    font-size: var(--text-4xl);
    line-height: 1.2;
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    margin-bottom: var(--space-4);
    color: var(--gray-700);
}

a {
    color: var(--turquoise-800);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--turquoise-900);
}

a:focus {
    outline: 2px solid var(--turquoise-800);
    outline-offset: 2px;
}

strong {
    font-weight: var(--weight-semibold);
}

em {
    font-style: italic;
}

/* ==================== LAYOUT COMPONENTS ==================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--gutter-lg);
        padding-right: var(--gutter-lg);
    }
}

.section {
    padding-top: var(--section-md);
    padding-bottom: var(--section-md);
}

.section-lg {
    padding-top: var(--section-lg);
    padding-bottom: var(--section-lg);
}

.section-xl {
    padding-top: var(--section-xl);
    padding-bottom: var(--section-xl);
}

/* Background Variants */
.bg-white {
    background-color: var(--white);
}

.bg-navy {
    background-color: var(--navy-800);
    color: var(--white);
}

.bg-navy h1, .bg-navy h2, .bg-navy h3,
.bg-navy h4, .bg-navy h5, .bg-navy h6 {
    color: var(--white);
}

.bg-navy p {
    color: var(--gray-200);
}

.bg-turquoise-light {
    background-color: var(--turquoise-200);
}

.bg-gray-light {
    background-color: var(--gray-50);
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: var(--border-width) solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:focus {
    outline: 2px solid var(--turquoise-800);
    outline-offset: 2px;
}

/* Primary Button - Turquoise */
.btn-primary {
    background-color: var(--turquoise-800);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--turquoise-900);
    color: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - White */
.btn-secondary {
    background-color: var(--white);
    color: var(--navy-800);
    border-color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    color: var(--navy-900);
    border-color: var(--gray-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: var(--navy-800);
}

.btn-ghost:hover {
    background-color: var(--gray-100);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
}

/* ==================== CARDS ==================== */

.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-8);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

.card-bordered {
    border: var(--border-width) solid var(--gray-200);
    box-shadow: none;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--navy-800);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-900);
    background-color: var(--white);
    border: var(--border-width) solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--turquoise-800);
    box-shadow: 0 0 0 3px rgba(121, 201, 206, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==================== UTILITIES ==================== */

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-navy { color: var(--navy-800); }
.text-turquoise { color: var(--turquoise-800); }
.text-gray { color: var(--gray-600); }
.text-white { color: var(--white); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Responsive */
@media (max-width: 768px) {
    :root {
        --text-5xl: 3rem;    /* Smaller headings on mobile */
        --text-4xl: 2.25rem;
        --section-md: var(--space-20);
        --section-lg: var(--space-32);
    }

    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-slow) var(--ease-out);
}

.slide-up {
    animation: slideUp var(--transition-slow) var(--ease-out);
}

/* ==================== ACCESSIBILITY ==================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible (keyboard navigation) */
:focus-visible {
    outline: 2px solid var(--turquoise-800);
    outline-offset: 2px;
}

/* 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;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    *,
    *::before,
    *::after {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    h2, h3 {
        page-break-after: avoid;
    }
}
