/* ═══════════════════════════════════════════════════════
   Formation Git & GitHub Avancé — Design System Partagé
   Dark Glassmorphism · Git Red · Responsive · Animé
   ═══════════════════════════════════════════════════════ */

/* ── 1. Variables ───────────────────────────────────── */
:root {
  --bg:         #0a0e1a;
  --bg-2:       #0d1117;
  --bg-3:       #161b22;

  --glass:      rgba(22, 27, 34, 0.70);
  --glass-lite: rgba(255, 255, 255, 0.04);
  --glass-hover:rgba(255, 255, 255, 0.07);

  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.20);

  --text:   #e6edf3;
  --muted:  #8b949e;
  --faint:  #484f58;

  /* Couleur primaire Git — Rouge-Orange */
  --git:      #f05033;
  --git-dark: #bd2b0c;

  --yellow: #f0c419;
  --blue:   #79c0ff;
  --green:  #3fb950;
  --purple: #d2a8ff;
  --red:    #f85149;
  --orange: #f78166;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --blur:    blur(20px);
  --blur-sm: blur(12px);

  --shadow:    0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.30);

  --glow-git: 0 0 28px rgba(240, 80,  51, 0.22);
  --glow-y:   0 0 24px rgba(240, 196,  25, 0.18);
  --glow-b:   0 0 24px rgba(121, 192, 255, 0.15);
  --glow-p:   0 0 24px rgba(210, 168, 255, 0.15);
  --glow-g:   0 0 24px rgba(63,  185,  80, 0.15);

  --transition: all 0.22s ease;
}

/* ── 2. Reset ───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

/* ── 3. Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar               { width: 7px; height: 7px; }
::-webkit-scrollbar-track         { background: var(--bg-2); }
::-webkit-scrollbar-thumb         { background: rgba(240,80,51,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover   { background: rgba(240,80,51,0.30); }

/* ── 4. Sélection ───────────────────────────────────── */
::selection { background: rgba(240,80,51,0.18); color: var(--text); }

/* ── 5. Header ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.6rem;
  display: flex; align-items: center; gap: 1rem;
}
.site-header .header-title {
  font-size: 0.95rem; font-weight: 700;
  color: var(--git);
}
.site-header .header-sub { font-size: 0.76rem; color: var(--muted); }
@media (max-width: 480px) { .site-header .header-sub { display: none; } }

/* ── 6. Bouton retour ───────────────────────────────── */
.back-link {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.79rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.back-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
}

/* ── 7. Boutons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.38rem;
  font-size: 0.80rem; font-weight: 600;
  padding: 0.44rem 0.88rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none; cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  background: rgba(255,255,255,0.04);
  color: var(--muted); line-height: 1;
}
.btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-git { color: var(--git); border-color: rgba(240,80,51,0.25); }
.btn-git:hover {
  background: rgba(240,80,51,0.10);
  border-color: rgba(240,80,51,0.55);
  box-shadow: var(--glow-git);
  color: var(--git);
}

.btn-ghost { color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.07); }

.btn-yellow { color: var(--yellow); border-color: rgba(240,196,25,0.22); }
.btn-yellow:hover {
  background: rgba(240,196,25,0.10);
  border-color: rgba(240,196,25,0.50);
  box-shadow: var(--glow-y); color: var(--yellow);
}

.btn-blue { color: var(--blue); border-color: rgba(121,192,255,0.22); }
.btn-blue:hover {
  background: rgba(121,192,255,0.10);
  border-color: rgba(121,192,255,0.50);
  box-shadow: var(--glow-b); color: var(--blue);
}

.btn-green {
  color: var(--green);
  background: rgba(35,134,54,0.12);
  border-color: rgba(63,185,80,0.28);
}
.btn-green:hover {
  background: rgba(35,134,54,0.22);
  border-color: var(--green); color: var(--green);
}

.btn-primary {
  background: var(--git);
  color: #0d1117;
  border-color: var(--git);
  font-weight: 700;
}
.btn-primary:hover {
  background: #f57355;
  border-color: #f57355;
  box-shadow: 0 0 28px rgba(240,80,51,0.45);
  transform: translateY(-2px);
  color: #0d1117;
}

.btn-sm { font-size: 0.75rem; padding: 0.32rem 0.7rem; }

/* ── 8. Tags / Badges ───────────────────────────────── */
.tag {
  display: inline-block;
  background: rgba(240,80,51,0.07);
  color: var(--git);
  font-size: 0.71rem;
  padding: 0.17rem 0.52rem;
  border-radius: 20px;
  font-family: 'Consolas', monospace;
  border: 1px solid rgba(240,80,51,0.18);
}

.badge { display: inline-block; font-size: 0.68rem; padding: 0.14rem 0.50rem; border-radius: 20px; font-weight: 700; }
.badge-git  { background: rgba(240,80,51,0.09);  color: var(--git);    border: 1px solid rgba(240,80,51,0.20); }
.badge-js   { background: rgba(240,196,25,0.10);  color: var(--yellow); border: 1px solid rgba(240,196,25,0.22); }
.badge-tip  { background: rgba(63,185,80,0.09);   color: var(--green);  border: 1px solid rgba(63,185,80,0.20); }
.badge-warn { background: rgba(248,81,73,0.09);   color: var(--red);    border: 1px solid rgba(248,81,73,0.20); }

/* ── 9. Barre de progression ────────────────────────── */
.progress-bar-outer {
  background: rgba(255,255,255,0.05);
  border-radius: 20px; height: 8px;
  overflow: hidden; border: 1px solid var(--border);
}
.progress-bar-inner {
  background: linear-gradient(90deg, var(--git-dark), var(--git));
  height: 100%; border-radius: 20px;
  transition: width 0.65s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 12px rgba(240,80,51,0.35);
}

/* ── 10. Cards glass ────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: rgba(240,80,51,0.35);
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(0,0,0,0.40), var(--glow-git);
}
.card.completed  { border-color: rgba(63,185,80,0.38); }
.card.completed:hover {
  border-color: var(--green);
  box-shadow: 0 16px 44px rgba(0,0,0,0.40), var(--glow-g);
}

/* ── 11. Tables ─────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 0.58rem 0.88rem;
  text-align: left; color: var(--muted);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px;
}
td { border: 1px solid var(--border); padding: 0.58rem 0.88rem; }
tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
td code, th code {
  background: rgba(240,80,51,0.08);
  color: var(--git);
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.79rem;
}

/* ── 12. Code / Syntax ──────────────────────────────── */
pre {
  position: relative;
  background: rgba(7,11,20,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.82rem; line-height: 1.65;
}
code { font-family: 'Consolas', 'Monaco', monospace; }
pre code.hljs { background: transparent !important; padding: 0 !important; }

.kw  { color: #ff7b72; }
.fn  { color: #d2a8ff; }
.str { color: #a5d6ff; }
.cm  { color: #6e7681; }
.num { color: #79c0ff; }
.git-c { color: #f05033; }

/* ── Bouton copier ──────────────────────────────────── */
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 5px; color: var(--muted);
  font-size: 0.82rem; padding: 0.22rem 0.52rem;
  cursor: pointer; transition: var(--transition);
  opacity: 0; line-height: 1;
}
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover   { background: rgba(255,255,255,0.14); color: var(--text); }
.copy-btn.copied  { color: var(--green); border-color: rgba(63,185,80,0.5); opacity: 1; }

/* ── 13. Alertes ────────────────────────────────────── */
.tip {
  background: rgba(63,185,80,0.07);
  border: 1px solid rgba(63,185,80,0.22);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.84rem; color: #aff3c4; line-height: 1.55;
}
.warn {
  background: rgba(248,81,73,0.07);
  border: 1px solid rgba(248,81,73,0.22);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.84rem; color: #ffa198; line-height: 1.55;
}
.info {
  background: rgba(240,80,51,0.06);
  border: 1px solid rgba(240,80,51,0.22);
  border-left: 3px solid var(--git);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.84rem; color: #fcd5cc; line-height: 1.55;
}

/* ── 14. Module badge ───────────────────────────────── */
.module-num {
  background: rgba(240,80,51,0.09);
  color: var(--git);
  font-weight: 700; font-size: 0.77rem;
  padding: 0.2rem 0.58rem;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  border: 1px solid rgba(240,80,51,0.22);
  transition: background 0.2s;
  white-space: nowrap;
}

/* ── 15. Section title ──────────────────────────────── */
.section-title {
  font-size: 1.22rem; font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}

/* ── 16. Footer ─────────────────────────────────────── */
.site-footer {
  text-align: center; color: var(--faint);
  font-size: 0.77rem; padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.site-footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--text); }

/* ── 17. Layout cours ───────────────────────────────── */
.layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 1.6rem 0.8rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 0.8rem;
  padding: 0 0.4rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: var(--transition);
  border-left: 2px solid transparent;
  margin-bottom: 0.15rem;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--git); border-left-color: var(--git); background: rgba(240,80,51,0.05); }

.content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 860px;
}

@media (max-width: 767px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0.8rem;
  }
  .sidebar-title { display: none; }
  .nav-link { border-left: none; border-bottom: 2px solid transparent; font-size: 0.79rem; }
  .content { padding: 1.5rem 1.2rem; }
}

/* ── 18. Section cours ──────────────────────────────── */
.section {
  margin-bottom: 3rem;
  padding-top: 1rem;
}
.section h2 {
  font-size: 1.35rem; font-weight: 700;
  margin-bottom: 1rem;
  color: var(--git);
  display: flex; align-items: center; gap: 0.6rem;
}
.section h3 {
  font-size: 1rem; font-weight: 600;
  margin: 1.4rem 0 0.6rem;
  color: var(--text);
}
.section p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.8rem; line-height: 1.7; }
.section ul, .section ol { padding-left: 1.4rem; margin-bottom: 0.8rem; }
.section li { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.3rem; line-height: 1.65; }
.section code {
  background: rgba(240,80,51,0.08);
  color: var(--git);
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.83rem;
}

/* ── 19. Exercices ──────────────────────────────────── */
.exo-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}
.exo-card:hover { border-color: rgba(240,80,51,0.25); }

.exo-header {
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 0.7rem;
}
.exo-num {
  background: rgba(240,80,51,0.10);
  color: var(--git);
  font-weight: 700; font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-family: 'Consolas', monospace;
  border: 1px solid rgba(240,80,51,0.22);
}
.exo-header h3 { font-size: 1rem; font-weight: 600; }

.editor-area {
  width: 100%;
  background: rgba(7,11,20,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.81rem;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  margin-top: 0.7rem;
}
.editor-area:focus { border-color: rgba(240,80,51,0.40); }

.output-area {
  display: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: 'Consolas', monospace;
  font-size: 0.83rem;
  margin-top: 0.6rem;
  white-space: pre-wrap;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: rgba(7,11,20,0.85);
}
.output-area.show { display: block; color: var(--green); }
.output-area.show.error { color: var(--red); }

/* ── 20. Animations ─────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── 21. Inputs ─────────────────────────────────────── */
input[type="checkbox"] { accent-color: var(--git); width: 14px; height: 14px; cursor: pointer; }
input[type="text"], input[type="search"] {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); padding: 0.65rem 1rem;
  font-size: 0.9rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input[type="text"]:focus, input[type="search"]:focus {
  border-color: rgba(240,80,51,0.45);
  box-shadow: 0 0 0 3px rgba(240,80,51,0.08);
}

/* ── 22. Responsive ─────────────────────────────────── */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.2rem; }
@media (min-width: 768px) { .container { padding: 0 2rem; } }
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  table { font-size: 0.79rem; }
  th, td { padding: 0.42rem 0.6rem; }
}
@media (min-width: 768px) { .hide-desktop { display: none !important; } }

/* ── 23. Git & YAML Syntax Highlighting ─────────────── */
.git-cmd     { color: #f05033; font-weight: 600; }
.git-flag    { color: #79c0ff; }
.git-arg     { color: #a5d6ff; }
.git-comment { color: #8b949e; font-style: italic; }
.yaml-key    { color: #79c0ff; }
.yaml-str    { color: #a5d6ff; }
.yaml-anchor { color: #f0c419; }
.yaml-comment{ color: #8b949e; font-style: italic; }

/* ── Bouton accueil ─────────────────────────────── */
.site-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm, 8px);
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}
.site-home-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.20);
}


/* ══ Mobile Complet (640 · 420 px) ══════════════════════ */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .site-header { height: auto; min-height: 52px; padding: 0.5rem 0.9rem; }
  .site-header .header-sub { display: none; }
  pre, .code-block { font-size: 0.75rem; padding: 0.8rem 0.85rem; }
  table, .ts-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .container, .container-wide { padding-left: 0.9rem; padding-right: 0.9rem; }
  .content { padding: 1rem 0.9rem !important; }
  .sidebar { display: none !important; }
  .layout { flex-direction: column !important; }
  .modules-grid { grid-template-columns: 1fr !important; }
  .hero-stats, .stats-row { gap: 1rem; }
}
@media (max-width: 420px) {
  h1 { font-size: 1.3rem !important; }
}