/* css/main.css - Modernized Typography & Colors */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&family=Nunito:wght@300;400;500;600;700;800;900&display=swap');

/* ================================
   MODERN TYPOGRAPHY SYSTEM
   ================================ */

/* Font Face Definitions */
:root {
    --font-primary: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    
    /* Modern Type Scale (1.414 - Perfect Fourth) */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
    --text-6xl: 3.75rem;    /* 60px */
    --text-7xl: 4.5rem;     /* 72px */
    --text-8xl: 6rem;       /* 96px */
    
    /* Line Heights */
    --leading-none: 1;
    --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: 0em;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
}

/* ================================
   THEME SYSTEM - Light & Dark Mode
   ================================ */

:root {
    /* New Pastel Color Palette */
    --primary: #E5989B;
    --primary-light: #FFB4A2;
    --primary-lighter: #FFCDB2;
    --primary-dark: #B5838D;
    
    /* Deep Gray Accent */
    --accent-blue: #6D6875;
    --accent-blue-light: #B5838D;
    --accent-gray: #B5838D;
    
    /* Enhanced Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #6D6875;
    
    /* Modern Accent Palette - Updated for pastel theme */
    --accent-purple: #B5838D;
    --accent-pink: #E5989B;
    --accent-orange: #FFCDB2;
    --accent-teal: #B5838D;
    --accent-indigo: #6D6875;
    
    /* Light Theme Colors */
    --background: #ffffff;
    --background-light: #fafafb;
    --background-subtle: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border & Divider Colors */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --border-dark: #d1d5db;
    --divider: rgba(229, 231, 235, 0.3);
    
    /* Accent Colors */
    --accent-green: #e6f4eb;
    --accent-purple: #f1edfb;
    --accent-blue: #eff6ff;
    
    /* Shadow System */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Interactive States */
    --hover-overlay: rgba(0, 0, 0, 0.05);
    --focus-ring: #FEA689;
    --focus-ring-offset: #ffffff;
}

/* Dark Theme */
:root[data-theme="dark"] {
    /* Dark Theme Colors */
    --background: #0f172a;
    --background-light: #1e293b;
    --background-subtle: #334155;
    --surface: #1e293b;
    --surface-elevated: #334155;
    
    /* Dark Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f172a;
    
    /* Dark Border Colors */
    --border: #475569;
    --border-light: #64748b;
    --border-dark: #334155;
    --divider: rgba(71, 85, 105, 0.3);
    
    /* Dark Accent Colors */
    --accent-green: #064e3b;
    --accent-purple: #581c87;
    --accent-blue: #1e3a8a;
    
    /* Dark Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    
    /* Dark Interactive States */
    --hover-overlay: rgba(255, 255, 255, 0.1);
    --focus-ring: #FF63C3;
    --focus-ring-offset: #0A2540;
}

/* Dark theme gradient for body */
:root[data-theme="dark"] body {
    background: linear-gradient(135deg, #6D6875 0%, #B5838D 25%, #E5989B 50%, #B5838D 75%, #6D6875 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 10s ease-in-out infinite !important;
}

/* ================================
   WCAG ACCESSIBILITY IMPROVEMENTS
   ================================ */

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border: #000000;
        --focus-ring: #000000;
    }
    
    :root[data-theme="dark"] {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border: #ffffff;
        --focus-ring: #ffffff;
    }
}

/* Reduced Motion Support */
@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;
    }
    
    /* Disable gradient animation for reduced motion */
    body {
        animation: none !important;
        background: var(--background) !important;
        background-size: auto !important;
    }
}

/* ================================
   BASE STYLES WITH WCAG COMPLIANCE
   ================================ */

/* Reset and base styles */
* {
    font-family: var(--font-primary);
    font-weight: 400;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    margin: 0;
    padding: 0;
    line-height: var(--leading-relaxed);
    font-weight: 400;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ffffff 0%, #FFCDB2 25%, rgba(255, 205, 178, 0.5) 50%, #ffffff 75%, #FFCDB2 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 10s ease-in-out infinite !important;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin: 0 0 0.75em 0;
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-weight: 800;
    font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl));
    line-height: var(--leading-none);
    letter-spacing: var(--tracking-tighter);
}

h2 {
    font-weight: 700;
    font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
    line-height: var(--leading-tight);
}

h3 {
    font-weight: 600;
    font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
    line-height: var(--leading-snug);
}

p {
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0 0 1em 0;
}

/* Enhanced link styles for WCAG */
a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration-thickness: 3px;
}

a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remove text decoration from buttons styled as links */
button[class*="btn"] {
    text-decoration: none;
}

/* ================================
   LAYOUT HELPERS
   ================================ */

.section-padding {
    padding: 100px 0;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
}

.max-w-7xl {
    max-width: 1200px;
    width: 90vw;
}

/* Section dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--divider), transparent);
    margin: 0;
    width: 100%;
}

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

/* Skip links for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--text-inverse);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 8px;
    z-index: 10000;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.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;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus ring utilities */
.focus-ring:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.focus-ring-inset {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

/* ================================
   ENHANCED GRADIENTS
   ================================ */

.gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
    width: 100%;
    transition: background 0.3s ease;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, rgba(229, 152, 155, 0.1) 0%, transparent 50%);
    z-index: 0;
    transition: background 0.3s ease;
}

:root[data-theme="dark"] .gradient-bg::before {
    background: radial-gradient(ellipse at top, rgba(109, 104, 117, 0.3) 0%, transparent 50%);
}

.gradient-bg > * {
    position: relative;
    z-index: 1;
}

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

@keyframes gradientShift {
    0% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Subtle overlay gradient for sections */
.gradient-overlay {
    position: relative;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.4) 0%, rgba(226, 232, 240, 0.3) 50%, rgba(241, 245, 249, 0.4) 100%);
}

:root[data-theme="dark"] .gradient-overlay {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(30, 41, 59, 0.3) 50%, rgba(51, 65, 85, 0.4) 100%);
}

/* Navigation gradient styles */
.nav-gradient {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
}

:root[data-theme="dark"] .nav-gradient {
    background: rgba(10, 37, 64, 0.95) !important;
}

/* ================================
   THEME TRANSITION SYSTEM
   ================================ */

* {
    transition: 
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

/* Disable transitions on theme change for performance */
.theme-transitioning * {
    transition: none !important;
}

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

.will-change {
    will-change: transform, opacity;
}

/* Grid and flex fixes */
.grid {
    width: 100%;
    box-sizing: border-box;
}

.flex {
    box-sizing: border-box;
    min-width: 0;
}

/* Prevent horizontal scroll */
.container,
.max-w-7xl,
section,
div {
    max-width: 100%;
    box-sizing: border-box;
}

/* ================================
   MODERN BUTTON STYLES
   ================================ */

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(254, 166, 137, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(254, 166, 137, 0.4);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-outline-coral {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: white;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-outline-coral:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(254, 166, 137, 0.3);
}

/* ================================
   ENHANCED FORM ELEMENTS
   ================================ */

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ================================
   HIGH CONTRAST MODE
   ================================ */

@media (prefers-contrast: high) {
    .gradient-bg {
        background: var(--background);
    }
    
    .gradient-bg::before {
        display: none;
    }
    
    .card {
        border: 2px solid var(--border);
    }
}

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

@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .skip-link,
    .mobile-menu,
    .theme-toggle {
        display: none !important;
    }
}