/* ═══════════════════════════════════════════════
   Workout App — Design System v2
   Thème : sport-tech, sombre, lime électrique
═══════════════════════════════════════════════ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

:root {
  /* Backgrounds */
  --ink-0: #050505;
  --ink-1: #0a0a0a;
  --ink-2: #121213;
  --ink-3: #1a1a1d;
  --ink-4: #242428;
  --ink-5: #35353b;

  /* Lines */
  --line:        rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);

  /* Text */
  --text:       #f4f4f5;
  --text-dim:   #a1a1aa;
  --text-muted: #52525b;
  --text-faint: #3f3f46;

  /* Accent lime */
  --accent:     #E6FF55;
  --accent-hot: #d4ed3d;
  --accent-dim: rgba(230,255,85,0.12);
  --accent-glow:rgba(230,255,85,0.25);

  /* Status */
  --success: #4ADE80;
  --danger:  #F87171;
  --amber:   #FBBF24;

  /* Programme colors */
  --g-chest:  #FF4D3D;
  --g-back:   #60A5FA;
  --g-legs:   #4ADE80;
  --g-cardio: #FBBF24;
  --g-free:   #A78BFA;
  --g-abs:    #00E5A0;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 100px;

  /* Typography */
  --ff-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ff-body:    'Inter', system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, monospace;
}

html, body {
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

#root { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Typography ── */
.t-display {
  font-family: var(--ff-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.t-mono {
  font-family: var(--ff-mono);
  letter-spacing: 0.02em;
}
.t-micro {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.t-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes ring  {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

.anim-fade    { animation: fadeInUp 0.35s cubic-bezier(0.2,0.8,0.2,1) both; }
.anim-slideup { animation: slideUp 0.3s cubic-bezier(0.2,0.8,0.2,1) both; }

/* Cascade delays for lists */
.anim-fade:nth-child(1) { animation-delay: 0s; }
.anim-fade:nth-child(2) { animation-delay: 0.05s; }
.anim-fade:nth-child(3) { animation-delay: 0.1s; }
.anim-fade:nth-child(4) { animation-delay: 0.15s; }
.anim-fade:nth-child(5) { animation-delay: 0.2s; }

/* ── Layout ── */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 68px 20px 120px;
}

/* ── Cards ── */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--ff-body);
  font-size: 15px; font-weight: 600;
  transition: transform 0.12s, background 0.15s, opacity 0.15s;
  background: var(--ink-3);
  color: var(--text);
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #0a0a0a; box-shadow: 0 8px 24px var(--accent-glow), 0 0 0 1px rgba(230,255,85,0.1); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hot); }
.btn-ghost    { background: transparent; border: 1px solid var(--line-strong); color: var(--text); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--ink-3); }
.btn-danger   { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.25); color: var(--danger); box-shadow: none; }
.btn-icon     { padding: 10px; border-radius: var(--r-pill); background: var(--ink-2); border: 1px solid var(--line); }
.btn-block    { width: 100%; }
.btn-xl       { padding: 20px 28px; font-size: 17px; }
.btn-sm       { padding: 8px 16px; font-size: 13px; }

/* ── Inputs ── */
input, textarea, select {
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 15px;
  padding: 14px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-muted); }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--ink-3);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.chip-accent {
  background: var(--accent-dim);
  border-color: rgba(230,255,85,0.25);
  color: var(--accent);
}
.chip-solid {
  background: var(--accent);
  border: none;
  color: #0a0a0a;
}

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.2);
  border-top-color: #0a0a0a;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* ── Loading screen ── */
.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--ink-0);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 40;
  padding: 10px 8px 28px;
  background: linear-gradient(180deg, transparent 0%, rgba(5,5,5,0.9) 40%, rgba(5,5,5,1) 100%);
  backdrop-filter: blur(20px);
  display: flex; justify-content: space-around; align-items: center;
  gap: 4px;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 4px;
  color: var(--text-muted);
  transition: color 0.2s;
  font-family: var(--ff-mono);
}
.nav-btn.active { color: var(--accent); }
.nav-btn span {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Plus button (center) */
.nav-plus {
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: 18px;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow), 0 0 0 6px rgba(230,255,85,0.08);
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-top: -16px;
}
.nav-plus:active { transform: scale(0.93); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; zIndex: 200;
  background: rgba(0,0,0,0.8);
  display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease;
  z-index: 200;
}
.modal-sheet {
  background: var(--ink-2);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
  margin-top: auto;
  padding: 8px 20px 32px;
  display: flex; flex-direction: column;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--ink-4); border-radius: 4px;
  margin: 0 auto 18px;
}

/* ── Noise overlay ── */
.noise::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Misc utils ── */
.text-accent  { color: var(--accent); }
.text-dim     { color: var(--text-dim); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.w-full       { width: 100%; }
.text-center  { text-align: center; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
