/* ==========================================================================
   MAIN.CSS — Design System & Base Styles
   Fauteuil Gaming — fauteuil-gaming.fr
   Dark professional theme — airsoft-attitude inspired
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   --------------------------------------------------------------------------- */
:root {
  /* Background layers (deepest → lightest) */
  --bg-deepest: #061020;
  --bg-deep: #0a1628;
  --bg-base: #0d1f3c;
  --bg-raised: #0f2040;
  --bg-surface: #102844;
  --bg-surface-2: #132d4f;

  /* Semantic background aliases (backward compat) */
  --bg-primary: var(--bg-deep);
  --bg-secondary: var(--bg-base);
  --bg-tertiary: var(--bg-raised);
  --bg-elevated: var(--bg-raised);

  /* Primary palette (backward compat with product pages) */
  --primary-900: #061020;
  --primary-800: #0a1628;
  --primary-700: #0d1f3c;
  --primary-600: #0f2040;
  --primary-500: #102844;
  --primary-400: #132d4f;
  --primary-300: #1a3a5c;
  --primary-200: #2a5078;
  --primary-100: #3a6898;

  /* 2 accent colors only */
  --accent-blue: #0078d4;
  --accent-blue-hover: #005ea2;
  --accent-blue-light: rgba(0, 120, 212, 0.18);
  --accent-teal: #00d4aa;
  --accent-teal-hover: #00b894;
  --accent-teal-light: rgba(0, 212, 170, 0.1);

  /* Map old accent names → new ones for product page backward compat */
  --accent-cyan-500: #00d4aa;
  --accent-cyan-400: #00e4b8;
  --accent-cyan-300: #33e8c6;
  --accent-purple-500: #0078d4;
  --accent-purple-400: #2090e8;
  --accent-orange-500: #0078d4;
  --accent-orange-400: #2090e8;

  /* Text colors */
  --text-heading: #ffffff;
  --text-inverse: #ffffff;
  --text-primary: #d0dce8;
  --text-secondary: #8aa4c8;
  --text-tertiary: #5a7a9a;
  --text-muted: #4a6a8a;
  --text-dimmest: #3a5a7a;
  --text-link: var(--accent-teal);

  /* Borders — single hue (blue #0078d4), varying opacity */
  --border-subtle: rgba(0, 120, 212, 0.08);
  --border-light: rgba(0, 120, 212, 0.12);
  --border-dark: rgba(0, 120, 212, 0.15);
  --border-medium: rgba(0, 120, 212, 0.2);
  --border-strong: rgba(0, 120, 212, 0.3);
  --border-heavy: rgba(0, 120, 212, 0.4);
  --border-intense: rgba(0, 120, 212, 0.5);

  /* Semantic status colors */
  --success: #00d4aa;
  --success-bg: rgba(0, 212, 170, 0.1);
  --warning: #f0a030;
  --warning-bg: rgba(240, 160, 48, 0.1);
  --error: #e84040;
  --error-bg: rgba(232, 64, 64, 0.1);
  --info: #0078d4;
  --info-bg: rgba(0, 120, 212, 0.1);

  /* Neutral scale (mapped for backward compat) */
  --neutral-50: #132d4f;
  --neutral-100: #0f2040;
  --neutral-200: #1a3a5c;
  --neutral-300: #2a5078;
  --neutral-400: #5a7a9a;
  --neutral-500: #6a8aaa;
  --neutral-600: #8aa4c8;
  --neutral-700: #a0b8d0;
  --neutral-800: #d0dce8;
  --neutral-900: #e8f0f8;

  /* Typography — system fonts ONLY */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-lg: 1.05rem;
  --text-xl: 1.2rem;
  --text-2xl: 1.4rem;
  --text-3xl: 1.7rem;
  --text-4xl: 2rem;
  --text-5xl: clamp(1.6rem, 4vw, 2.4rem);

  /* Line heights */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.65;
  --leading-relaxed: 1.8;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 3.5rem;
  --space-20: 4.5rem;
  --space-24: 5.5rem;
  --space-32: 7rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-base: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* NO box-shadows — depth via background color layering only */
  --shadow-sm: none;
  --shadow-base: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;
  --glow-cyan: none;
  --glow-purple: none;
  --glow-orange: none;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ---------------------------------------------------------------------------
   2. LIGHT MODE OVERRIDE
   --------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-deepest: #f0f2f5;
  --bg-deep: #f8f9fb;
  --bg-base: #ffffff;
  --bg-raised: #ffffff;
  --bg-surface: #f4f6f8;
  --bg-surface-2: #edf0f4;
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f4f6f8;
  --bg-elevated: #ffffff;

  --primary-900: #f0f2f5;
  --primary-800: #f4f6f8;
  --primary-700: #ffffff;
  --primary-600: #ffffff;
  --primary-500: #edf0f4;
  --primary-400: #e0e4ea;
  --primary-300: #c8cdd4;
  --primary-200: #a0a8b4;
  --primary-100: #6a7888;

  --text-heading: #1a1f2e;
  --text-inverse: #1a1f2e;
  --text-primary: #2d3748;
  --text-secondary: #5a6578;
  --text-tertiary: #8494a7;
  --text-muted: #a0aec0;
  --text-dimmest: #c0c8d4;

  --border-subtle: rgba(0, 40, 80, 0.04);
  --border-light: rgba(0, 40, 80, 0.08);
  --border-dark: rgba(0, 40, 80, 0.1);
  --border-medium: rgba(0, 40, 80, 0.14);
  --border-strong: rgba(0, 40, 80, 0.2);
  --border-heavy: rgba(0, 40, 80, 0.28);
  --border-intense: rgba(0, 40, 80, 0.36);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.08);
  --info: #0078d4;
  --info-bg: rgba(0, 120, 212, 0.08);

  --accent-blue: #0078d4;
  --accent-blue-hover: #005ea2;
  --accent-teal: #059669;
  --accent-teal-hover: #047857;
  --accent-teal-light: rgba(5, 150, 105, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}
a:hover {
  color: var(--accent-teal);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

input, textarea, select {
  font: inherit;
}

strong, b {
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   4. ACCESSIBILITY
   --------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-base);
  z-index: 10000;
  font-weight: 600;
  font-size: var(--text-sm);
}
.skip-link:focus {
  top: var(--space-2);
}

:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.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;
}

/* ---------------------------------------------------------------------------
   5. CONTAINER
   --------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------------------------------------------------------------------------
   6. TYPOGRAPHY
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  line-height: var(--leading-snug);
}

p {
  margin-bottom: 14px;
}
p:last-child {
  margin-bottom: 0;
}

/* Heading classes (used in product pages) */
.heading-hero {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.heading-1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.heading-2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--text-heading);
}
.heading-3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--text-heading);
}
.heading-4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-heading);
}
.heading-5 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-heading);
}

/* Body text classes */
.body-large {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}
.body-regular {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}
.body-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* ---------------------------------------------------------------------------
   7. CSS GRID SYSTEM
   --------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-6);
}
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   8. FLEXBOX UTILITIES
   --------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.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; }

/* Gap utilities */
.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); }

/* ---------------------------------------------------------------------------
   9. SPACING UTILITIES
   --------------------------------------------------------------------------- */
/* Margin bottom */
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

/* Margin top */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

/* Margin left/right */
.ml-2 { margin-left: var(--space-2); }
.mr-2 { margin-right: var(--space-2); }

/* Padding */
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }
.px-10 { padding-left: var(--space-10); padding-right: var(--space-10); }
.px-12 { padding-left: var(--space-12); padding-right: var(--space-12); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.py-20 { padding-top: var(--space-20); padding-bottom: var(--space-20); }
.pt-4 { padding-top: var(--space-4); }
.pb-4 { padding-bottom: var(--space-4); }

/* Space-y (vertical spacing between children) */
.space-y-1 > * + * { margin-top: var(--space-1); }
.space-y-2 > * + * { margin-top: var(--space-2); }
.space-y-3 > * + * { margin-top: var(--space-3); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }

/* ---------------------------------------------------------------------------
   10. TEXT UTILITIES
   --------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Font weight */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Font size utilities (used inline by product pages) */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

/* Leading */
.leading-relaxed { line-height: var(--leading-relaxed); }

/* Tracking */
.tracking-wider { letter-spacing: 0.05em; }

/* Text color utilities (backward compat — remap to dark theme) */
.text-white { color: #ffffff; }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }

/* Gray scale text (remap to dark-theme equivalents) */
.text-gray-300 { color: var(--text-muted); }
.text-gray-600 { color: var(--text-tertiary); }
.text-gray-700 { color: var(--text-secondary); }
.text-gray-800 { color: var(--text-primary); }
.text-gray-900 { color: var(--text-heading); }

/* Semantic text colors → remap to accent/status */
.text-green-500,
.text-green-600,
.text-green-700,
.text-green-800,
.text-emerald-600,
.text-emerald-700,
.text-emerald-800 { color: var(--success); }

.text-blue-600,
.text-blue-700,
.text-blue-800,
.text-indigo-600,
.text-indigo-700,
.text-indigo-800 { color: var(--accent-blue); }

.text-red-600,
.text-red-700,
.text-red-800 { color: var(--error); }

.text-orange-600,
.text-orange-700,
.text-orange-800,
.text-amber-600,
.text-amber-800 { color: var(--warning); }

.text-yellow-400\/50 { color: rgba(240, 160, 48, 0.5); }
.text-yellow-700,
.text-yellow-800 { color: var(--warning); }

.text-purple-600,
.text-purple-800 { color: var(--accent-blue); }

.text-teal-600,
.text-teal-700,
.text-teal-800,
.text-cyan-800 { color: var(--accent-teal); }

/* ---------------------------------------------------------------------------
   11. BACKGROUND UTILITIES (backward compat)
   --------------------------------------------------------------------------- */
.bg-white { background: var(--bg-raised); }
.bg-white\/50 { background: rgba(15, 32, 64, 0.5); }

.bg-gray-50 { background: var(--bg-base); }
.bg-gray-100 { background: var(--bg-raised); }
.bg-gray-200 { background: var(--bg-surface); }

/* Colored backgrounds → remapped to dark-theme status tints */
.bg-green-50,
.bg-emerald-50,
.bg-teal-50 { background: var(--success-bg); }
.bg-green-600,
.bg-emerald-600,
.bg-teal-600 { background: var(--success); }

.bg-blue-50,
.bg-indigo-50 { background: var(--info-bg); }
.bg-blue-600,
.bg-indigo-600 { background: var(--accent-blue); }

.bg-red-50 { background: var(--error-bg); }
.bg-red-600 { background: var(--error); }

.bg-yellow-50,
.bg-amber-50,
.bg-orange-50 { background: var(--warning-bg); }
.bg-amber-600,
.bg-orange-600 { background: var(--warning); }

.bg-cyan-50 { background: var(--accent-teal-light); }
.bg-cyan-600 { background: var(--accent-teal); }

.bg-purple-50 { background: rgba(0, 120, 212, 0.08); }
.bg-purple-600,
.bg-pink-600 { background: var(--accent-blue); }

.bg-gradient-to-br,
.bg-gradient-to-r {
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-base) 100%);
}

/* ---------------------------------------------------------------------------
   12. BORDER UTILITIES (backward compat)
   --------------------------------------------------------------------------- */
.border { border: 1px solid var(--border-light); }
.border-2 { border: 2px solid var(--border-medium); }
.border-l-4 { border-left: 4px solid var(--accent-blue); }
.divide-y > * + * { border-top: 1px solid var(--border-light); }
.divide-gray-200 > * + * { border-top: 1px solid var(--border-light); }
.divider { border-top: 1px solid var(--border-light); margin: var(--space-6) 0; }

/* Colored borders → remap */
.border-gray-200,
.border-gray-300,
.border-gray-500 { border-color: var(--border-light); }

.border-green-200,
.border-green-500,
.border-emerald-100,
.border-emerald-200,
.border-teal-100,
.border-teal-200,
.border-teal-500 { border-color: rgba(0, 212, 170, 0.2); }

.border-blue-100,
.border-blue-200,
.border-blue-500,
.border-indigo-100,
.border-indigo-200,
.border-indigo-500 { border-color: rgba(0, 120, 212, 0.25); }

.border-red-100,
.border-red-200,
.border-red-500 { border-color: rgba(232, 64, 64, 0.2); }

.border-amber-100,
.border-amber-200,
.border-amber-500,
.border-orange-100,
.border-orange-200,
.border-orange-500,
.border-yellow-500 { border-color: rgba(240, 160, 48, 0.2); }

.border-cyan-200 { border-color: rgba(0, 212, 170, 0.2); }
.border-purple-200 { border-color: rgba(0, 120, 212, 0.2); }

/* ---------------------------------------------------------------------------
   13. BORDER RADIUS UTILITIES
   --------------------------------------------------------------------------- */
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: 14px; }
.rounded-3xl { border-radius: 18px; }
.rounded-full { border-radius: var(--radius-full); }
.rounded-tl-2xl { border-top-left-radius: 14px; }
.rounded-tr-2xl { border-top-right-radius: 14px; }
.rounded-bl-2xl { border-bottom-left-radius: 14px; }
.rounded-br-2xl { border-bottom-right-radius: 14px; }

/* ---------------------------------------------------------------------------
   14. SIZE UTILITIES
   --------------------------------------------------------------------------- */
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-full { width: 100%; }
.h-3 { height: 0.75rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-full { height: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-none { max-width: none; }

/* ---------------------------------------------------------------------------
   15. DISPLAY / POSITION / OVERFLOW
   --------------------------------------------------------------------------- */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }

/* Shadow utilities → none (depth only via bg layering) */
.shadow-sm,
.shadow,
.shadow-md,
.shadow-lg,
.shadow-xl { box-shadow: none; }

/* Border collapse for tables */
.border-collapse { border-collapse: collapse; }

/* ---------------------------------------------------------------------------
   16. SECTION SPACING
   --------------------------------------------------------------------------- */
.section {
  padding: var(--space-16) 0;
}
.section-large {
  padding: var(--space-20) 0;
}

/* ---------------------------------------------------------------------------
   17. LINKS
   --------------------------------------------------------------------------- */
.hover-link {
  color: var(--text-secondary);
  transition: color var(--transition-base);
}
.hover-link:hover {
  color: var(--accent-teal);
}

/* ---------------------------------------------------------------------------
   18. RESPONSIVE TYPOGRAPHY
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .heading-hero { font-size: var(--text-3xl); }
  .heading-1 { font-size: var(--text-2xl); }
  .heading-2 { font-size: var(--text-xl); }
  .container { padding-inline: 16px; }
  .section { padding: var(--space-10) 0; }
  .section-large { padding: var(--space-12) 0; }
}

/* ---------------------------------------------------------------------------
   19. REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
