/**
 * CSS Custom Properties (Variables)
 *
 * Complete design system with depth-based color layering,
 * conversion-optimized CTAs, and fluid responsive scaling
 *
 * @package MattressProtectorReviews
 * @version 2.0.0 - Design System Transformation
 */

:root {
  /* ============================================
     PRIMARY COLOR: BLUE (Trust & Reliability)
     ============================================ */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;  /* Main primary brand color */
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --blue-950: #172554;

  /* ============================================
     SECONDARY COLOR: ORANGE (Conversion Optimized)
     High CTR/CVR performance for CTAs
     ============================================ */
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;  /* Primary CTA color - Highest conversion */
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7c2d12;

  /* ============================================
     NEUTRAL GRAYS (10 Shades for Depth)
     ============================================ */
  --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;
  --gray-950: #030712;

  /* ============================================
     SEMANTIC COLORS (Success, Warning, Error)
     ============================================ */
  /* Success / Positive */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Warning / Caution */
  --yellow-50: #fefce8;
  --yellow-100: #fef9c3;
  --yellow-200: #fef08a;
  --yellow-300: #fde047;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;
  --yellow-700: #a16207;
  --yellow-800: #854d0e;
  --yellow-900: #713f12;

  /* Error / Negative */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;

  /* ============================================
     BASE COLORS
     ============================================ */
  --white: #ffffff;
  --black: #030712;

  /* ============================================
     DEPTH LAYERS (Color Hierarchy)
     Creates visual depth without borders
     ============================================ */
  --layer-1: var(--gray-50);   /* Page background (deepest) */
  --layer-2: var(--white);      /* Cards/containers (elevated) */
  --layer-3: var(--gray-100);   /* Interactive elements (more elevated) */
  --layer-4: var(--gray-200);   /* Selected/hover states (highest) */

  /* ============================================
     TEXT HIERARCHY
     ============================================ */
  --text-heading: var(--gray-900);
  --text-body: var(--gray-700);
  --text-caption: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-inverse: var(--white);

  /* ============================================
     TWO-LAYER SHADOW SYSTEM
     Creates depth with highlight + shadow
     ============================================ */
  --shadow-small:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.1);

  --shadow-medium:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 3px 6px rgba(0, 0, 0, 0.15);

  --shadow-large:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 6px 12px rgba(0, 0, 0, 0.2);

  --shadow-xl:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    0 10px 20px rgba(0, 0, 0, 0.25);

  /* ============================================
     GRADIENT ENHANCEMENTS
     ============================================ */
  --gradient-subtle: linear-gradient(to bottom, var(--gray-50), var(--white));
  --gradient-interactive: linear-gradient(to bottom, var(--gray-100), var(--gray-50));
  --gradient-primary: linear-gradient(to bottom, var(--blue-500), var(--blue-600));
  --gradient-secondary: linear-gradient(to bottom, var(--blue-600), var(--blue-700));
  --gradient-cta: linear-gradient(to bottom, var(--orange-500), var(--orange-600));
  --gradient-cta-hover: linear-gradient(to bottom, var(--orange-400), var(--orange-500));

  /* Top highlight for shiny effect */
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  --highlight-strong: inset 0 2px 0 rgba(255, 255, 255, 0.4);

  /* ============================================
     FLUID TYPOGRAPHY
     Scales smoothly across all viewports
     ============================================ */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);      /* 12px → 14px */
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);        /* 14px → 16px */
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);        /* 16px → 18px */
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);       /* 18px → 20px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);        /* 20px → 24px */
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);             /* 24px → 32px */
  --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.5rem);     /* 30px → 40px */
  --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);         /* 36px → 48px */
  --text-5xl: clamp(3rem, 2.4rem + 3vw, 4rem);               /* 48px → 64px */

  /* ============================================
     FLUID SPACING
     Responsive spacing that scales naturally
     ============================================ */
  --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);        /* 8px → 12px */
  --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);         /* 12px → 16px */
  --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);             /* 16px → 24px */
  --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);           /* 24px → 32px */
  --space-xl: clamp(2rem, 1.6rem + 2vw, 3rem);               /* 32px → 48px */
  --space-2xl: clamp(3rem, 2.4rem + 3vw, 4rem);              /* 48px → 64px */
  --space-3xl: clamp(4rem, 3.2rem + 4vw, 6rem);              /* 64px → 96px */

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

  /* ============================================
     TRANSITIONS
     ============================================ */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ============================================
     Z-INDEX LAYERS
     ============================================ */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-skip-link: 10000;
  --z-tooltip: 10010;  /* MUST be highest - tooltips appear above everything */

  /* ============================================
     SEMANTIC ALIASES
     Quick access to common use cases
     ============================================ */
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-secondary: var(--orange-600);
  --color-secondary-hover: var(--orange-500);
  --color-success: var(--green-600);
  --color-warning: var(--yellow-500);
  --color-error: var(--red-600);
  --color-info: var(--blue-500);

  /* Background colors */
  --bg-page: var(--layer-1);
  --bg-card: var(--layer-2);
  --bg-interactive: var(--layer-3);
  --bg-hover: var(--layer-4);

  /* ============================================
     COMPONENT-SPECIFIC VARIABLES
     ============================================ */
  /* Buttons */
  --btn-padding-y: 0.75rem;
  --btn-padding-x: 1.5rem;
  --btn-padding-sm-y: 0.5rem;
  --btn-padding-sm-x: 1rem;
  --btn-padding-lg-y: 1rem;
  --btn-padding-lg-x: 2rem;

  /* Forms */
  --input-padding-y: 0.75rem;
  --input-padding-x: 1rem;
  --input-border-radius: var(--radius-md);

  /* Cards */
  --card-padding: var(--space-lg);
  --card-border-radius: var(--radius-xl);

  /* Container */
  --container-max-width: 1280px;
  --container-padding: var(--space-md);
}

/* ============================================
   DARK MODE SUPPORT (Future Enhancement)
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Uncomment when implementing dark mode */
  /*
  :root {
    --layer-1: var(--gray-900);
    --layer-2: var(--gray-800);
    --layer-3: var(--gray-700);
    --layer-4: var(--gray-600);
    --text-heading: var(--gray-50);
    --text-body: var(--gray-200);
    --text-caption: var(--gray-300);
    --text-muted: var(--gray-400);
  }
  */
}
