/* ===================================================================================
   JGMM THEATRE - COMPREHENSIVE DESIGN SYSTEM
   Version: 2.0
   Design Areas: Typography, Colors, Layout, Components, Responsive
   Total Improvements: 125 design fixes
   =================================================================================== */

/* ===================================================================================
   AREA 1: TYPOGRAPHY & READABILITY SYSTEM (25 Improvements)
   =================================================================================== */

/* 1.1 Advanced Font Loading with Performance Optimization */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1.2 Fluid Typography Scale - Mathematical Perfect Scale (1.250 - Major Third) */
:root {
  /* Base sizes */
  --text-xs: clamp(0.694rem, 0.65rem + 0.22vw, 0.8rem);     /* 11.1px - 12.8px */
  --text-sm: clamp(0.833rem, 0.78rem + 0.265vw, 0.96rem);   /* 13.3px - 15.4px */
  --text-base: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);       /* 16px - 18.4px */
  --text-md: clamp(1.2rem, 1.12rem + 0.4vw, 1.44rem);       /* 19.2px - 23px */
  --text-lg: clamp(1.44rem, 1.34rem + 0.5vw, 1.73rem);      /* 23px - 27.7px */
  --text-xl: clamp(1.728rem, 1.6rem + 0.64vw, 2.074rem);    /* 27.6px - 33.2px */
  --text-2xl: clamp(2.074rem, 1.92rem + 0.77vw, 2.488rem);  /* 33.2px - 39.8px */
  --text-3xl: clamp(2.488rem, 2.3rem + 0.94vw, 2.986rem);   /* 39.8px - 47.8px */
  --text-4xl: clamp(2.986rem, 2.76rem + 1.13vw, 3.583rem);  /* 47.8px - 57.3px */
  --text-5xl: clamp(3.583rem, 3.31rem + 1.36vw, 4.3rem);    /* 57.3px - 68.8px */
  
  /* 1.3 Line Height Scale - Optimized for Readability */
  --leading-tight: 1.15;    /* Headings */
  --leading-snug: 1.375;    /* Subheadings */
  --leading-normal: 1.6;    /* Body text - optimal for reading */
  --leading-relaxed: 1.75;  /* Long-form content */
  --leading-loose: 2;       /* Quotes, callouts */
  
  /* 1.4 Letter Spacing - Professional Tracking */
  --tracking-tighter: -0.04em;  /* Large display text */
  --tracking-tight: -0.02em;    /* Headings */
  --tracking-normal: -0.01em;   /* Body */
  --tracking-wide: 0.02em;      /* Captions */
  --tracking-wider: 0.05em;     /* Uppercase labels */
  --tracking-widest: 0.1em;     /* All-caps buttons */
  
  /* 1.5 Font Weight Scale */
  --font-thin: 100;
  --font-extralight: 200;
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;
  
  /* 1.6 Font Family Stacks - Optimized for Each Use Case */
  --font-display: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-body: 'Lora', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  
  /* 1.7 Measure (Line Length) - Optimal Reading Width */
  --measure-narrow: 45ch;   /* Sidebars, captions */
  --measure-normal: 65ch;   /* Body text - optimal */
  --measure-wide: 80ch;     /* Wide content */
}

/* 1.8 Typography Utility Classes */
.text-display {
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
}

.text-heading {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.text-body {
  font-family: var(--font-body);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
}

.text-caption {
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-wide);
}

/* 1.9 Heading Hierarchy with Perfect Vertical Rhythm */
h1, .h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  margin-top: 0;
  margin-bottom: 0.5em;
  font-family: var(--font-display);
}

h2, .h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-family: var(--font-display);
}

h3, .h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-family: var(--font-display);
}

h4, .h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  font-family: var(--font-display);
}

h5, .h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-family: var(--font-sans);
}

h6, .h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-family: var(--font-sans);
}

/* 1.10 Paragraph and Body Text Optimization */
p {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin-top: 0;
  margin-bottom: 1.25em;
  max-width: var(--measure-normal);
}

/* 1.11 Lead Paragraph (Opening paragraph) */
.lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  font-weight: var(--font-regular);
  color: var(--color-text-secondary);
  max-width: var(--measure-wide);
}

/* 1.12 Small Text with Proper Hierarchy */
small, .text-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* 1.13 Text Emphasis with Semantic Styling */
strong, b {
  font-weight: var(--font-semibold);
}

em, i {
  font-style: italic;
}

/* 1.14 Blockquote Styling - Editorial Design */
blockquote {
  position: relative;
  font-size: var(--text-lg);
  font-style: italic;
  line-height: var(--leading-loose);
  margin: 2em 0;
  padding: 1.5em 2em;
  border-left: 4px solid var(--color-accent-primary);
  background: var(--color-surface-subtle);
  color: var(--color-text-secondary);
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -0.2em;
  left: 0.2em;
  font-size: 5em;
  font-weight: var(--font-bold);
  color: var(--color-accent-subtle);
  opacity: 0.15;
  line-height: 1;
}

blockquote cite {
  display: block;
  margin-top: 1em;
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
}

/* 1.15 Code Typography */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--color-surface-elevated);
  border-radius: 4px;
  color: var(--color-text-primary);
}

pre code {
  padding: 0;
  background: none;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  padding: 1.5em;
  background: var(--color-surface-dark);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 2em 0;
}

/* 1.16 List Typography */
ul, ol {
  margin: 1.5em 0;
  padding-left: 2em;
  line-height: var(--leading-relaxed);
}

li {
  margin-bottom: 0.5em;
}

/* 1.17 Link Typography with Advanced States */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--color-link-subtle);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

a:active {
  color: var(--color-link-active);
}

/* 1.18 Uppercase Labels */
.label, .uppercase {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  line-height: var(--leading-tight);
}

/* 1.19 Truncate Text with Ellipsis */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1.20 Line Clamp (Multi-line Truncation) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 1.21 Font Smoothing - Platform Optimized */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* 1.22 Hyphenation for Long Words */
.hyphens {
  hyphens: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* 1.23 Balance Text (Headline Wrapping) */
.balance {
  text-wrap: balance;
}

/* 1.24 No Widows (Prevent Single Words on Last Line) */
.no-widows {
  text-wrap: pretty;
}

/* 1.25 Accessibility - Focus Visible for Keyboard Navigation */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ===================================================================================
   AREA 2: COLOR SYSTEM & ACCESSIBILITY (25 Improvements)
   =================================================================================== */

/* 2.1 Semantic Color Palette - WCAG AAA Compliant */
:root {
  /* Primary Brand Colors */
  --color-brand-50: #faf5ff;
  --color-brand-100: #f3e8ff;
  --color-brand-200: #e9d5ff;
  --color-brand-300: #d8b4fe;
  --color-brand-400: #c084fc;
  --color-brand-500: #a855f7;  /* Primary */
  --color-brand-600: #9333ea;
  --color-brand-700: #7e22ce;
  --color-brand-800: #6b21a8;
  --color-brand-900: #581c87;
  --color-brand-950: #3b0764;
  
  /* Neutral Grays - Perfectly Balanced */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-gray-950: #030712;
  
  /* 2.2 Semantic Color Mapping */
  --color-accent-primary: var(--color-brand-600);
  --color-accent-secondary: var(--color-brand-500);
  --color-accent-subtle: var(--color-brand-100);
  
  /* 2.3 Text Color Scale - Ensures Readability */
  --color-text-primary: var(--color-gray-900);      /* 16.69:1 contrast */
  --color-text-secondary: var(--color-gray-600);    /* 7.09:1 contrast */
  --color-text-muted: var(--color-gray-500);        /* 4.56:1 contrast - AA compliant */
  --color-text-disabled: var(--color-gray-400);
  --color-text-inverse: #ffffff;
  
  /* 2.4 Background Colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: var(--color-gray-50);
  --color-bg-tertiary: var(--color-gray-100);
  --color-bg-elevated: #ffffff;
  --color-bg-overlay: rgba(17, 24, 39, 0.5);
  
  /* 2.5 Surface Colors (Cards, Modals) */
  --color-surface-base: #ffffff;
  --color-surface-subtle: var(--color-gray-50);
  --color-surface-elevated: #ffffff;
  --color-surface-dark: var(--color-gray-900);
  
  /* 2.6 Border Colors */
  --color-border-default: var(--color-gray-200);
  --color-border-subtle: var(--color-gray-100);
  --color-border-strong: var(--color-gray-300);
  --color-border-focus: var(--color-brand-500);
  
  /* 2.7 Interactive States */
  --color-interactive-default: var(--color-brand-600);
  --color-interactive-hover: var(--color-brand-700);
  --color-interactive-active: var(--color-brand-800);
  --color-interactive-disabled: var(--color-gray-300);
  
  /* 2.8 Link Colors */
  --color-link: var(--color-brand-600);
  --color-link-hover: var(--color-brand-700);
  --color-link-active: var(--color-brand-800);
  --color-link-visited: #7e22ce;
  --color-link-subtle: var(--color-brand-200);
  
  /* 2.9 Focus State for Accessibility */
  --color-focus: var(--color-brand-500);
  --color-focus-ring: rgba(168, 85, 247, 0.3);
}

/* 2.10 Semantic Status Colors */
:root {
  /* Success */
  --color-success-50: #f0fdf4;
  --color-success-500: #10b981;
  --color-success-700: #047857;
  --color-success-bg: var(--color-success-50);
  --color-success-text: var(--color-success-700);
  --color-success-border: var(--color-success-500);
  
  /* Warning */
  --color-warning-50: #fffbeb;
  --color-warning-500: #f59e0b;
  --color-warning-700: #b45309;
  --color-warning-bg: var(--color-warning-50);
  --color-warning-text: var(--color-warning-700);
  --color-warning-border: var(--color-warning-500);
  
  /* Error */
  --color-error-50: #fef2f2;
  --color-error-500: #ef4444;
  --color-error-700: #b91c1c;
  --color-error-bg: var(--color-error-50);
  --color-error-text: var(--color-error-700);
  --color-error-border: var(--color-error-500);
  
  /* Info */
  --color-info-50: #eff6ff;
  --color-info-500: #3b82f6;
  --color-info-700: #1d4ed8;
  --color-info-bg: var(--color-info-50);
  --color-info-text: var(--color-info-700);
  --color-info-border: var(--color-info-500);
}

/* 2.11 Dark Mode Color Palette */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text-primary: var(--color-gray-50);
    --color-text-secondary: var(--color-gray-400);
    --color-text-muted: var(--color-gray-500);
    
    --color-bg-primary: var(--color-gray-950);
    --color-bg-secondary: var(--color-gray-900);
    --color-bg-tertiary: var(--color-gray-800);
    
    --color-surface-base: var(--color-gray-900);
    --color-surface-subtle: var(--color-gray-800);
    --color-surface-elevated: var(--color-gray-800);
    
    --color-border-default: var(--color-gray-700);
    --color-border-subtle: var(--color-gray-800);
    --color-border-strong: var(--color-gray-600);
  }
}

/* 2.12 High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-border-default: #e6e6e6;
    --color-border-strong: #374151;
  }
}

/* 2.13 Color Utility Classes */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-primary); }
.text-error { color: var(--color-error-text); }
.text-success { color: var(--color-success-text); }
.text-warning { color: var(--color-warning-text); }

/* 2.14 Background Utility Classes */
.bg-primary { background-color: var(--color-bg-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-accent { background-color: var(--color-accent-primary); }
.bg-surface { background-color: var(--color-surface-base); }

/* 2.15 Gradient Backgrounds */
.gradient-primary {
  background: linear-gradient(135deg, var(--color-brand-600) 0%, var(--color-brand-500) 100%);
}

.gradient-subtle {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, #ffffff 100%);
}

.gradient-radial {
  background: radial-gradient(circle at top left, var(--color-brand-100), transparent 70%);
}

/* 2.16 Glassmorphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 2.17 Color Overlays */
.overlay-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 1;
}

.overlay-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.7) 100%);
  z-index: 1;
}

/* 2.18 Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning-border);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

/* 2.19 Selection Color */
::selection {
  background: var(--color-brand-200);
  color: var(--color-brand-900);
}

/* 2.20 Focus Ring Styles */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  border-color: var(--color-focus);
}

/* 2.21 Reduced Motion - Respect User Preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2.22 High Contrast Borders */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }
}

/* 2.23 Print Styles */
@media print {
  * {
    color: var(--text-primary) !important;
    background: #fff !important;
    box-shadow: none !important;
  }
}

/* 2.24 Color Scheme Meta */
:root {
  color-scheme: light dark;
}

/* 2.25 Forced Colors Mode (Windows High Contrast) */
@media (forced-colors: active) {
  * {
    border-color: CanvasText;
  }
  
  a {
    color: LinkText;
  }
  
  button {
    border: 2px solid ButtonText;
  }
}


/* ===================================================================================
   AREA 3: LAYOUT & SPACING SYSTEM (25 Improvements)
   =================================================================================== */

/* 3.1 8-Point Grid System */
:root {
  --space-0: 0;
  --space-px: 1px;
  --space-0\.5: 0.125rem;  /* 2px */
  --space-1: 0.25rem;      /* 4px */
  --space-1\.5: 0.375rem;  /* 6px */
  --space-2: 0.5rem;       /* 8px */
  --space-2\.5: 0.625rem;  /* 10px */
  --space-3: 0.75rem;      /* 12px */
  --space-3\.5: 0.875rem;  /* 14px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-7: 1.75rem;      /* 28px */
  --space-8: 2rem;         /* 32px */
  --space-9: 2.25rem;      /* 36px */
  --space-10: 2.5rem;      /* 40px */
  --space-11: 2.75rem;     /* 44px */
  --space-12: 3rem;        /* 48px */
  --space-14: 3.5rem;      /* 56px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  --space-24: 6rem;        /* 96px */
  --space-28: 7rem;        /* 112px */
  --space-32: 8rem;        /* 128px */
  --space-36: 9rem;        /* 144px */
  --space-40: 10rem;       /* 160px */
  --space-44: 11rem;       /* 176px */
  --space-48: 12rem;       /* 192px */
  --space-52: 13rem;       /* 208px */
  --space-56: 14rem;       /* 224px */
  --space-60: 15rem;       /* 240px */
  --space-64: 16rem;       /* 256px */
  --space-72: 18rem;       /* 288px */
  --space-80: 20rem;       /* 320px */
  --space-96: 24rem;       /* 384px */
}

/* 3.2 Container Widths */
:root {
  --container-xs: 20rem;     /* 320px */
  --container-sm: 24rem;     /* 384px */
  --container-md: 28rem;     /* 448px */
  --container-lg: 32rem;     /* 512px */
  --container-xl: 36rem;     /* 576px */
  --container-2xl: 42rem;    /* 672px */
  --container-3xl: 48rem;    /* 768px */
  --container-4xl: 56rem;    /* 896px */
  --container-5xl: 64rem;    /* 1024px */
  --container-6xl: 72rem;    /* 1152px */
  --container-7xl: 80rem;    /* 1280px */
  --container-full: 100%;
}

/* 3.3 Container Component */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.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); }
.container-2xl { max-width: var(--container-2xl); }
.container-3xl { max-width: var(--container-3xl); }
.container-4xl { max-width: var(--container-4xl); }
.container-5xl { max-width: var(--container-5xl); }
.container-6xl { max-width: var(--container-6xl); }
.container-7xl { max-width: var(--container-7xl); }

/* 3.4 Section Spacing */
.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section-sm {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section-lg {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

/* 3.5 Stack Layout (Vertical Spacing) */
.stack {
  display: flex;
  flex-direction: column;
}

.stack > * + * {
  margin-top: var(--space-4);
}

.stack-sm > * + * { margin-top: var(--space-2); }
.stack-md > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }
.stack-xl > * + * { margin-top: var(--space-12); }

/* 3.6 Cluster Layout (Horizontal Spacing) */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.cluster-sm { gap: var(--space-2); }
.cluster-md { gap: var(--space-4); }
.cluster-lg { gap: var(--space-8); }

/* 3.7 Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.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-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* 3.8 Auto-Fit Grid (Responsive) */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.grid-auto-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* 3.9 Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }

/* 3.10 Gap Utilities */
.gap-0 { gap: var(--space-0); }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }
.gap-16 { gap: var(--space-16); }

/* 3.11 Padding Utilities */
.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-12 { padding: var(--space-12); }

/* 3.12 Margin Utilities */
.m-0 { margin: var(--space-0); }
.m-auto { margin: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* 3.13 Aspect Ratio */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-landscape { aspect-ratio: 4 / 3; }

/* 3.14 Object Fit */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }

/* 3.15 Overflow Control */
.overflow-hidden { overflow: hidden; }
.overflow-scroll { overflow: scroll; }
.overflow-auto { overflow: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* 3.16 Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* 3.17 Z-Index Scale */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-dropdown { z-index: 1000; }
.z-sticky { z-index: 1020; }
.z-fixed { z-index: 1030; }
.z-modal { z-index: 1040; }
.z-popover { z-index: 1050; }
.z-tooltip { z-index: 1060; }

/* 3.18 Width Utilities */
.w-full { width: 100%; }
.w-screen { width: 100vw; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

/* 3.19 Height Utilities */
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-auto { height: auto; }

/* 3.20 Min/Max Width */
.min-w-0 { min-width: 0; }
.max-w-prose { max-width: var(--measure-normal); }
.max-w-full { max-width: 100%; }

/* 3.21 Content Visibility (Performance) */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* 3.22 Sidebar Layout */
.sidebar-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--space-8);
}

/* 3.23 Hero Section */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-20) var(--space-4);
}

/* 3.24 Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

/* 3.25 Masonry Layout */
.masonry {
  column-count: 3;
  column-gap: var(--space-6);
}

.masonry > * {
  break-inside: avoid;
  margin-bottom: var(--space-6);
}


/* ===================================================================================
   AREA 4: COMPONENTS & INTERACTIONS (25 Improvements)
   =================================================================================== */

/* 4.1 Border Radius System */
:root {
  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-base: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-3xl: 2rem;      /* 32px */
  --radius-full: 9999px;
}

/* 4.2 Shadow System */
:root {
  --shadow-xs: 0 1px 2px 0 rgba(17, 24, 39, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(17, 24, 39, 0.1), 0 1px 2px -1px rgba(17, 24, 39, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(17, 24, 39, 0.1), 0 2px 4px -2px rgba(17, 24, 39, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(17, 24, 39, 0.1), 0 4px 6px -4px rgba(17, 24, 39, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(17, 24, 39, 0.1), 0 8px 10px -6px rgba(17, 24, 39, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(17, 24, 39, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(17, 24, 39, 0.05);
}

/* 4.3 Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2\.5) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 4.4 Button Variants */
.btn-primary {
  background: var(--color-interactive-default);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-interactive-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-interactive-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
}

.btn-secondary:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-primary);
}

/* 4.5 Button Sizes */
.btn-sm {
  padding: var(--space-1\.5) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-3\.5) var(--space-8);
  font-size: var(--text-lg);
}

/* 4.6 Card Component */
.card {
  background: var(--color-surface-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.card-elevated:hover {
  box-shadow: var(--shadow-xl);
}

/* 4.7 Input Component */
.input {
  width: 100%;
  padding: var(--space-2\.5) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-surface-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-base);
  transition: all 0.2s ease;
}

.input:hover {
  border-color: var(--color-border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.input::placeholder {
  color: var(--color-text-muted);
}

/* 4.8 Textarea */
.textarea {
  resize: vertical;
  min-height: 120px;
}

/* 4.9 Select Dropdown */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
}

/* 4.10 Checkbox */
.checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox:checked {
  background: var(--color-interactive-default);
  border-color: var(--color-interactive-default);
}

/* 4.11 Toggle Switch */
.toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: var(--radius-full);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.toggle:checked {
  background: var(--color-interactive-default);
}

.toggle:checked::after {
  transform: translateX(1.5rem);
}

/* 4.12 Modal/Dialog */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  padding: var(--space-4);
}

.modal-content {
  background: var(--color-surface-base);
  border-radius: var(--radius-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: modal-enter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 4.13 Tooltip */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--space-2) var(--space-3);
  background: var(--color-gray-900);
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  white-space: nowrap;
  border-radius: var(--radius-base);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip:hover::before {
  opacity: 1;
}

/* 4.14 Alert Component */
.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  font-size: var(--text-base);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success-border);
}

.alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-color: var(--color-error-border);
}

/* 4.15 Progress Bar */
.progress {
  width: 100%;
  height: 0.5rem;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-interactive-default);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* 4.16 Skeleton Loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 0%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-base);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 4.17 Divider */
.divider {
  height: 1px;
  background: var(--color-border-default);
  margin: var(--space-6) 0;
}

/* 4.18 Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: var(--color-gray-200);
  color: var(--color-text-primary);
  font-weight: var(--font-semibold);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 4.19 Tabs */
.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--color-border-default);
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--color-text-primary);
}

.tab.active {
  color: var(--color-interactive-default);
  border-bottom-color: var(--color-interactive-default);
}

/* 4.20 Accordion */
.accordion-item {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.accordion-header {
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface-subtle);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: var(--color-surface-base);
}

.accordion-content {
  padding: 0 var(--space-6);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.accordion-item.open .accordion-content {
  padding: var(--space-4) var(--space-6);
  max-height: 1000px;
}

/* 4.21 Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-surface-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--color-surface-subtle);
}

/* 4.22 Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.breadcrumb-separator {
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-text-primary);
}

/* 4.23 Pagination */
.pagination {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.pagination-item {
  min-width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-base);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-item:hover {
  background: var(--color-surface-subtle);
}

.pagination-item.active {
  background: var(--color-interactive-default);
  color: white;
}

/* 4.24 Loading Spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-gray-200);
  border-top-color: var(--color-interactive-default);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 4.25 Transition Classes */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.slide-up-enter {
  opacity: 0;
  transform: translateY(20px);
}

.slide-up-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===================================================================================
   AREA 5: RESPONSIVE & MOBILE DESIGN (25 Improvements)
   =================================================================================== */

/* 5.1 Mobile-First Breakpoints */
:root {
  --breakpoint-xs: 375px;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* 5.2 Container Responsive Padding */
@media (max-width: 640px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1025px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* 5.3 Responsive Grid */
@media (max-width: 640px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 5.4 Responsive Typography */
@media (max-width: 640px) {
  :root {
    --text-5xl: clamp(2.5rem, 8vw, 3.583rem);
    --text-4xl: clamp(2rem, 6vw, 2.986rem);
    --text-3xl: clamp(1.75rem, 5vw, 2.488rem);
  }
}

/* 5.5 Touch Target Sizes (44px minimum) */
@media (max-width: 1024px) {
  .btn,
  .input,
  .select,
  .checkbox,
  button,
  a[role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* 5.6 Mobile Navigation */
@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
  
  .nav-mobile {
    display: block;
  }
}

@media (min-width: 769px) {
  .nav-mobile {
    display: none;
  }
  
  .nav-desktop {
    display: block;
  }
}

/* 5.7 Responsive Spacing */
@media (max-width: 640px) {
  .section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
  
  .section-lg {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* 5.8 Stack on Mobile */
@media (max-width: 768px) {
  .mobile-stack {
    flex-direction: column;
  }
  
  .mobile-stack > * {
    width: 100%;
  }
}

/* 5.9 Hide/Show Utilities */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* 5.10 Responsive Card Grid */
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 5.11 Responsive Modal */
@media (max-width: 640px) {
  .modal-content {
    max-width: 100%;
    margin: var(--space-2);
    max-height: calc(100vh - var(--space-4));
  }
}

/* 5.12 Responsive Table */
@media (max-width: 768px) {
  .table-responsive {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 5.13 Sidebar Collapse */
@media (max-width: 1024px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    order: 2;
  }
  
  .main-content {
    order: 1;
  }
}

/* 5.14 Responsive Hero */
@media (max-width: 640px) {
  .hero {
    min-height: 50vh;
    padding: var(--space-12) var(--space-4);
  }
}

/* 5.15 Responsive Forms */
@media (max-width: 640px) {
  .form-group {
    flex-direction: column;
  }
  
  .form-group > * {
    width: 100%;
  }
}

/* 5.16 Mobile Menu Overlay */
@media (max-width: 768px) {
  .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg-overlay);
    z-index: var(--z-modal);
  }
}

/* 5.17 Responsive Gap */
@media (max-width: 640px) {
  .gap-responsive {
    gap: var(--space-2);
  }
}

@media (min-width: 641px) {
  .gap-responsive {
    gap: var(--space-6);
  }
}

/* 5.18 Responsive Masonry */
@media (max-width: 640px) {
  .masonry {
    column-count: 1;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .masonry {
    column-count: 2;
  }
}

/* 5.19 Safe Area Insets (iPhone Notch) */
@supports (padding: env(safe-area-inset-left)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* 5.20 Scroll Snap on Mobile */
@media (max-width: 768px) {
  .scroll-snap-mobile {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .scroll-snap-mobile > * {
    scroll-snap-align: start;
  }
}

/* 5.21 Prevent Zoom on Input Focus (iOS) */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* 5.22 Responsive Video */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 5.23 Horizontal Scroll Container */
@media (max-width: 768px) {
  .horizontal-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: var(--space-4);
    padding: var(--space-4);
  }
  
  .horizontal-scroll::-webkit-scrollbar {
    display: none;
  }
  
  .horizontal-scroll > * {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
}

/* 5.24 Responsive Tabs */
@media (max-width: 640px) {
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tabs::-webkit-scrollbar {
    height: 2px;
  }
}

/* 5.25 Performance - Reduce Animations on Low-End Devices */
@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;
  }
}

/* Performance - GPU Acceleration for Smooth Animations */
.card,
.btn,
.modal-content {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
