/**
 * IzyDownload - Professional Design System v2.0
 * Inspired by izyboost.site (Clean, robust, high-performance, realistic SaaS)
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Tokens — Mode sombre (défaut) ── */
:root, [data-theme="dark"], .dark {
  --bg:             #0A0B0D;
  --surface:        #111318;
  --surface-2:      #181C23;
  --border:         #1E2229;
  --border-strong:  #2A3040;

  --text:           #F1F3F5;
  --text-secondary: #8A919E;
  --text-muted:     #555D6B;

  --accent:         #00D97E;
  --accent-dim:     #00B368;
  --accent-subtle:  rgba(0, 217, 126, 0.10);
  --accent-glow:    rgba(0, 217, 126, 0.25);

  --header-scrolled-bg: rgba(10, 11, 13, 0.94);

  --success:        #00D97E;
  --warning:        #F5A623;
  --error:          #E5484D;
  --info:           #3B82F6;

  color-scheme: dark;
}

/* ── Tokens — Mode clair ── */
[data-theme="light"], .light {
  --bg:             #FFFFFF;
  --surface:        #F8F9FA;
  --surface-2:      #F1F3F5;
  --border:         #E5E7EB;
  --border-strong:  #D1D5DB;

  --text:           #111318;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;

  --accent:         #009958;
  --accent-dim:     #007A46;
  --accent-subtle:  rgba(0, 153, 88, 0.10);
  --accent-glow:    rgba(0, 153, 88, 0.20);

  --header-scrolled-bg: rgba(255, 255, 255, 0.94);

  color-scheme: light;
}

/* ── Variables de dimensionnement & ergonomie (izyboost) ── */
:root {
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms ease;

  --header-h: 60px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── Reset strict & anti-débordement horizontal mobile ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

/* ── Barre de Navigation Réaliste (izyboost style) ── */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-base), border-color var(--t-base);
  width: 100%;
}

.app-header.scrolled {
  background: var(--header-scrolled-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Bouton CTA d'action professionnel */
.btn-cta-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #0A0B0D;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--r-md);
  transition: filter var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}

.btn-cta-accent:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-cta-accent:active {
  transform: translateY(0);
}

/* Bouton secondaire sur surface */
.btn-surface {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-md);
  transition: background var(--t-fast), border-color var(--t-fast);
}

.btn-surface:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* Sélecteur de langue avec drapeaux */
.lang-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.lang-selector-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* Sélecteur de thème 3 états */
.theme-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  gap: 2px;
}

.theme-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: color var(--t-fast), background var(--t-fast);
}

.theme-pill-btn:hover {
  color: var(--text);
}

.theme-pill-btn.active {
  background: var(--surface-2);
  color: var(--accent);
}

/* ── Section Hero réaliste (izyboost layout) ── */
.hero-input-container {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.hero-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Drawer Mobile (Strictly under Header, no jumping, no covering button) */
#mobile-drawer {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 90;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#mobile-drawer.open {
  display: flex;
}

/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 9999px;
}
