/* ========================================
   GLOBAL DESIGN SYSTEM - FOUNDATION
   Modern Dark Premium Aesthetic
   ======================================== */

/* =================== LOADING SCREEN STYLES =================== */
/* Loading Screen Overlay */
.loading-screen-active {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen-active.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    padding: 2rem;
}

/* Brand Name Animation */
.brand-name {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.letter {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: transparent;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 50%, #ffffff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    background-size: 200% 200%;
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    animation: letterAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.letter-space {
    width: 1rem;
}

/* Stagger animation for each letter */
.letter:nth-child(1) { animation-delay: 0s, 2s; }
.letter:nth-child(2) { animation-delay: 0.1s, 2.1s; }
.letter:nth-child(3) { animation-delay: 0.2s, 2.2s; }
.letter:nth-child(5) { animation-delay: 0.4s, 2.4s; }
.letter:nth-child(6) { animation-delay: 0.5s, 2.5s; }
.letter:nth-child(7) { animation-delay: 0.6s, 2.6s; }
.letter:nth-child(8) { animation-delay: 0.7s, 2.7s; }
.letter:nth-child(9) { animation-delay: 0.8s, 2.8s; }

@keyframes letterAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Tagline Animation */
.brand-tagline {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 1.2s;
}

.tagline-text {
    font-size: clamp(0.875rem, 2vw, 1.25rem);
    font-weight: 300;
    color: #cfcfcf;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Progress Bar */
.loading-progress {
    width: 100%;
    max-width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 1.5s;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(255, 255, 255, 0.2) 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progressLoad 2s ease-in-out forwards,
               progressShimmer 1.5s ease-in-out infinite;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes progressLoad {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes progressShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* =================== DESIGN TOKENS =================== */
:root {
  /* === Color Palette === */
  /* Core Blacks & Grays */
  --void-black: #000000;
  --carbon-black: #0a0a0a;
  --obsidian: #111111;
  --charcoal-deep: #1a1a1a;
  --graphite: #242424;
  --steel: #737373;
  --mist: #808080;
  --whisper: #9a9a9a;
  --pearl-gray: #a7a7a7;
  
  /* Glass & Transparency System */
  --glass-black: rgba(10, 10, 10, 0.5);
  --glass-charcoal: rgba(26, 26, 26, 0.4);
  --glass-smoke: rgba(77, 77, 77, 0.2);
  --glass-border-dark: rgba(255, 255, 255, 0.08);
  --glass-border-subtle: rgba(255, 255, 255, 0.05);
  
  /* Semantic Colors */
  --surface-primary: var(--obsidian);
  --surface-secondary: var(--charcoal-deep);
  --surface-tertiary: var(--graphite);
  --surface-glass: var(--glass-charcoal);
  --surface-elevated: var(--glass-black);
  
  --border-primary: var(--glass-border-dark);
  --border-secondary: var(--glass-border-subtle);
  --border-accent: var(--steel);
  
  --text-primary: var(--pearl-gray);
  --text-secondary: var(--mist);
  --text-accent: var(--whisper);
  --text-muted: var(--steel);
  
  /* Quiz-specific Color Variables */
  --bg-900: #111111;
  --bg-800: #111111;
  --bg-700: #1a1a1a;
  --bg-600: #222224;
  --bg-500: #2d2d2d;
  --muted-400: #3a3a3a;
  --muted-300: #4a4a4a;
  --muted-200: #5b5b5b;
  --text-100: #e6e6e6;
  --text-80: #cfcfcf;
  --accent-1: #6b7175;
  --accent-2: #505356;
  --glass: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.06);
  --radius: 12px;
  --mono-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  --serif-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  
  --interactive-primary: var(--text-accent);
  --interactive-primary-hover: var(--pearl-gray);
  --interactive-secondary: var(--glass-smoke);
  --interactive-secondary-hover: rgba(55, 55, 55, 0.5);
  
  /* === Spacing System === */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 5rem;     /* 80px */
  --space-4xl: 8rem;     /* 128px */
  
  /* === Typography Scale === */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */
  --font-size-6xl: 4rem;      /* 64px */
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* === Border Radius System === */
  --radius-none: 0;
  --radius-sm: 0.125rem;    /* 2px */
  --radius-md: 0.375rem;    /* 6px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.25rem;    /* 20px */
  --radius-3xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;
  
  /* === Shadow System === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glass: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
  --shadow-glass-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  
  /* === Animation System === */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
  
  --ease-linear: linear;
  --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);
  --ease-premium: cubic-bezier(0.19, 1, 0.22, 1);
  
  /* === Layout System === */
  --container-xs: 640px;
  --container-sm: 768px;
  --container-md: 1024px;
  --container-lg: 1280px;
  --container-xl: 1536px;
  --container-max: 1200px;
  
  /* === Backdrop Filters === */
  --backdrop-blur-sm: blur(4px);
  --backdrop-blur-md: blur(12px);
  --backdrop-blur-lg: blur(20px);
  --backdrop-blur-xl: blur(24px);
  
  /* === Gradient System === */
  --gradient-depth: linear-gradient(145deg, var(--obsidian) 0%, var(--void-black) 50%, var(--carbon-black) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  --gradient-fade-left: linear-gradient(to right, var(--charcoal-deep) 20%, transparent 100%);
  --gradient-fade-right: linear-gradient(to left, var(--charcoal-deep) 20%, transparent 100%);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #111111;
  color: var(--text-100);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  body {
    padding: 24px;
  }
}

/* =================== TYPOGRAPHY SYSTEM =================== */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }

.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-black { font-weight: var(--font-weight-black); }

.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }
.text-muted { color: var(--text-muted); }

/* =================== LAYOUT SYSTEM =================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

.container-xs { max-width: var(--container-xs); }
.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-full { grid-column: 1 / -1; }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* =================== SPACING SYSTEM =================== */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }
.gap-3xl { gap: var(--space-3xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }
.p-3xl { padding: var(--space-3xl); }

.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.py-3xl { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }

.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }
.px-2xl { padding-left: var(--space-2xl); padding-right: var(--space-2xl); }

.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }
.m-2xl { margin: var(--space-2xl); }
.m-3xl { margin: var(--space-3xl); }
.m-auto { margin: auto; }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

/* =================== COMPONENT BASE CLASSES =================== */

/* Section Base */
.section {
  padding: var(--space-3xl) 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.section-footer {
  text-align: center;
  margin-top: var(--space-2xl);
}

/* Card System */
.card {
  background: var(--surface-glass);
  backdrop-filter: var(--backdrop-blur-lg) saturate(150%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-premium);
  box-shadow: var(--shadow-glass);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-glass-hover);
  border-color: var(--border-accent);
}

.card-content {
  padding: var(--space-lg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.card-description {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-lg);
}

/* Glass Elements */
.glass {
  background: var(--surface-glass);
  backdrop-filter: var(--backdrop-blur-lg);
  -webkit-backdrop-filter: var(--backdrop-blur-lg);
  border: 1px solid var(--border-primary);
}

.glass-subtle {
  background: var(--glass-smoke);
  backdrop-filter: var(--backdrop-blur-md);
  border: 1px solid var(--border-secondary);
}

/* Surface Variations */
.surface-primary { background: var(--surface-primary); }
.surface-secondary { background: var(--surface-secondary); }
.surface-tertiary { background: var(--surface-tertiary); }
.surface-glass { background: var(--surface-glass); }
.surface-elevated { background: var(--surface-elevated); }

/* Border Radius Utilities */
.rounded-none { border-radius: var(--radius-none); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-glass { box-shadow: var(--shadow-glass); }
.shadow-none { box-shadow: none; }

/* Animation Utilities */
.transition-all { transition: all var(--duration-normal) var(--ease-out); }
.transition-fast { transition: all var(--duration-fast) var(--ease-out); }
.transition-slow { transition: all var(--duration-slow) var(--ease-out); }
.transition-premium { transition: all var(--duration-normal) var(--ease-premium); }

/* Visibility & Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

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

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* =================== RESPONSIVE BREAKPOINTS =================== */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 20px;
  }
  
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
  
  .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  
  .section {
    padding: var(--space-2xl) 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  .grid-cols-4 { grid-template-columns: 1fr; }
  
  .section {
    padding: var(--space-xl) 0;
  }
  
  .section-header {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }
}

/* =================== QUIZ APP SPECIFIC STYLES =================== */

/* Sound Toggle Button */
#sound-toggle-btn {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

#sound-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(26, 26, 26, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
}

#sound-toggle-btn:active {
  transform: scale(0.95);
}

/* Feedback Styles */
.feedback {
  transition: all 0.3s ease-in-out;
  opacity: 0;
  transform: translateY(10px);
  height: 2rem;
}

.feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.feedback.correct {
  color: #4ade80;
}

.feedback.wrong {
  color: #f87171;
}

.feedback.checkpoint {
  color: #60a5fa;
}

/* Answer Button Styles */
.answer-btn.correct {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.1));
  border-color: #4ade80;
  color: #4ade80;
  font-weight: 600;
}

.answer-btn.wrong {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.15), rgba(248, 113, 113, 0.1));
  border-color: #f87171;
  color: #f87171;
  font-weight: 600;
}

.answer-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Footer Styles */
.footer {
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  max-width: 42rem;
  width: 100%;
}

@media (min-width: 640px) {
  .footer {
    padding: 2rem 2.5rem;
  }
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.footer-logo-text {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-100);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-icon-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.footer-icon-link:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

/* Ready Modal Styles */
.ready-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
}

.ready-modal.hidden {
  display: none;
}

.ready-modal-content {
  background: #111111;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ready-modal h2 {
  font-family: var(--serif-font);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-100);
  margin: 0 0 1.5rem 0;
}

.ready-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.ready-modal-btn {
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.ready-modal-btn.yes {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.15));
  color: #4ade80;
  border-color: #4ade80;
}

.ready-modal-btn.yes:hover {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.3), rgba(74, 222, 128, 0.25));
  transform: translateY(-2px);
}

.ready-modal-btn.no {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.2), rgba(248, 113, 113, 0.15));
  color: #f87171;
  border-color: #f87171;
}

.ready-modal-btn.no:hover {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.3), rgba(248, 113, 113, 0.25));
  transform: translateY(-2px);
}

/* =================== ENHANCED DEVICE COMPATIBILITY =================== */

/* Mobile-First Base Styles */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Ensure proper scaling on all devices */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Improve touch targets for mobile */
button, 
a, 
input[type="file"] {
  min-height: 44px;
  min-width: 44px;
}

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575px) {
  body {
    padding: 8px;
  }
  
  main {
    padding: 1rem !important;
  }
  
  .ready-modal-content {
    padding: 1.5rem;
    width: 95%;
  }
  
  .ready-modal h2 {
    font-size: 1.5rem;
  }
  
  .ready-modal-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .footer {
    padding: 0.875rem;
    margin-top: 1.5rem;
  }
}

/* Small Devices (landscape phones, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  body {
    padding: 16px;
  }
  
  main {
    padding: 1.25rem !important;
  }
  
  .ready-modal-content {
    max-width: 420px;
  }
}

/* Medium Devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  body {
    padding: 20px;
  }
  
  main {
    padding: 1.5rem !important;
  }
  
  .ready-modal-content {
    max-width: 450px;
  }
  
  .footer {
    max-width: 45rem;
  }
}

/* Large Devices (desktops, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  body {
    padding: 24px;
  }
  
  main {
    padding: 2rem !important;
  }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  body {
    padding: 32px;
  }
  
  main {
    padding: 2.5rem !important;
  }
}

/* Landscape Orientation Fixes */
@media (orientation: landscape) and (max-height: 600px) {
  body {
    padding: 8px;
    justify-content: flex-start;
  }
  
  .ready-modal-content {
    padding: 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .ready-modal h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .footer {
    margin-top: 1rem;
    padding: 0.75rem;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

/* Dark Mode Support (respects system preference) */
@media (prefers-color-scheme: dark) {
  body {
    background: #111111;
  }
}

/* Reduced Motion Support (accessibility) */
@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;
  }
  
  .feedback {
    transition: none;
  }
  
  .card:hover,
  .footer-icon-link:hover,
  .ready-modal-btn:hover {
    transform: none;
  }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
  
  input[type="file"] {
    -webkit-appearance: none;
    appearance: none;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .ready-modal,
  .footer {
    display: none;
  }
  
  main {
    box-shadow: none;
    border: 1px solid #000;
  }
}