@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

@page {
  size: A4 landscape;
  margin: 1cm;
}

:root {
  --bg:       #181c24;
  --surface:  #232837;
  --border:   #2d3347;
  --text:     #f3f3f3;
  --muted:    #8b95a8;
  --primary:  #0059ff;
  --primary-h:#0047cc;
  --blue:     #5b9bff;
  --accent:   #4cd97b;
  --radius:   12px;
  --shadow:   0 12px 28px rgba(0,0,0,0.4);
  --ease:     cubic-bezier(.2,.9,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Header / Sidebar ── */
.sidebar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--primary) 100%);
  box-shadow: 0 6px 16px rgba(0,89,255,0.35);
  flex-shrink: 0;
}

.brand .title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: none;
}

.toggle:hover { background: rgba(91,155,255,0.1); }

.nav { display: flex; flex-direction: row; gap: 6px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover  { background: rgba(91,155,255,0.1); color: var(--text); }
.nav a.active { background: rgba(91,155,255,0.18); color: var(--blue); }

/* ── Topbar (pages j + voir-formation) ── */
.vf-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.vf-brand {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-brand span { color: var(--blue); }

.vf-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sélecteur de journée — segmented control */
.vf-days {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.vf-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.vf-day:hover  { background: rgba(255,255,255,0.08); color: var(--text); }
.vf-day.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(91,155,255,0.4);
}

/* Bouton nav générique */
.vf-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.vf-nav-btn:hover         { background: rgba(255,255,255,.06); color: var(--text); }
.vf-nav-btn.active        { background: rgba(91,155,255,.12); border-color: rgba(91,155,255,.35); color: var(--blue); }
.vf-nav-btn.back          { color: var(--text); border-color: rgba(255,255,255,.15); }
.vf-nav-btn:disabled      { opacity: .3; cursor: default; }

/* Content ── */
.content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  min-height: calc(100vh - 70px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

h1 {
  margin: 0 0 20px 0;
  font-size: clamp(1.4rem, 2.2vw + 1rem, 2.2rem);
  color: var(--text);
}

.muted { color: var(--muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 180ms var(--ease);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,89,255,0.3);
}

.btn-primary:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,89,255,0.4);
}

/* ── Timeline sections ── */
.section {
  position: relative;
  padding-left: 114px;
  margin-bottom: 36px;
}

.horaire {
  position: absolute;
  left: 0;
  top: 2px;
  width: 92px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--blue);
  background: rgba(91,155,255,0.1);
  border: 1.5px solid rgba(91,155,255,0.28);
  border-radius: 20px;
  padding: 5px 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 10px rgba(91,155,255,0.12);
  line-height: 1.4;
}

.horaire::after {
  content: '';
  position: absolute;
  left: 92px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 1.5px;
  background: rgba(91,155,255,0.35);
}

.section::before {
  content: '';
  position: absolute;
  left: 103px;
  top: 0;
  bottom: -36px;
  width: 2px;
  background: linear-gradient(180deg, rgba(91,155,255,0.4) 0%, rgba(91,155,255,0.06) 100%);
  border-radius: 2px;
}

.section:last-child::before {
  background: linear-gradient(180deg, rgba(91,155,255,0.35) 0%, transparent 100%);
}

.section .important {
  background: linear-gradient(90deg, rgba(76,217,123,0.12), transparent);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text);
}

.section h2 {
  color: var(--blue);
  font-size: 1.1rem;
  margin-top: 16px;
  margin-bottom: 8px;
}

.section ul {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--text);
}

.section li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.section p { color: var(--text); }

.section hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  margin: 24px 0;
}

/* ── Dropdown ── */
.dropdown { position: relative; display: inline-block; }

.dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: inherit;
  box-shadow: 0 2px 10px rgba(0,89,255,0.3);
}

.dropdown-btn:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
}

.dropdown-content {
  display: none;
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-radius: 10px;
  z-index: 1000;
  margin-top: 5px;
  overflow: hidden;
}

.dropdown-content a {
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.dropdown-content a:hover { background: rgba(91,155,255,0.12); }

.dropdown.active .dropdown-content { display: block; }

/* ── Tab system ── */
.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ── Nav days bar ── */
.nav-days { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .toggle { display: block; }
  .brand .title { display: none; }
  .nav { gap: 4px; }
  .nav a { padding: 8px 12px; font-size: 0.85rem; }
}

/* Tablette */
@media (max-width: 900px) {
  .section         { padding-left: 90px; }
  .horaire         { width: 72px; font-size: 0.68rem; padding: 4px 8px; }
  .horaire::after  { left: 72px; width: 10px; }
  .section::before { left: 80px; }
}

/* Téléphone */
@media (max-width: 600px) {
  /* Topbar : brand 1re ligne, nav scrollable 2e ligne */
  .vf-topbar {
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 6px;
  }
  .vf-brand { font-size: 13px; }
  .vf-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 5px;
    padding-bottom: 2px;
  }
  .vf-nav::-webkit-scrollbar { display: none; }
  .vf-days    { padding: 3px; gap: 1px; border-radius: 10px; }
  .vf-day     { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
  .vf-nav-btn { padding: 5px 10px; font-size: 12px; }

  /* Contenu */
  .content { padding: 14px; gap: 10px; min-height: calc(100vh - 100px); }
  h1 { font-size: 1.4rem; margin-bottom: 14px; }

  /* Timeline */
  .section         { padding-left: 76px; margin-bottom: 22px; }
  .horaire         { width: 60px; font-size: 0.63rem; padding: 4px 7px; }
  .horaire::after  { left: 60px; width: 8px; }
  .section::before { left: 67px; bottom: -22px; }

  /* Boutons */
  .btn { font-size: 0.82rem; padding: 8px 12px; }
}

/* Très petit écran : horaire bascule au-dessus du contenu */
@media (max-width: 380px) {
  .section {
    padding-left: 0;
    padding-top: 36px;
    margin-bottom: 20px;
  }
  .section::before { display: none; }
  .horaire { width: auto; }
  .horaire::after { display: none; }
}

/* ── Print ── */
@media print {
  body { background: #fff; color: #000; }

  .tab-content {
    display: block !important;
    page-break-before: always;
  }
  .tab-content:first-of-type { page-break-before: auto; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: #fff;
    border-bottom: 2px solid #0059ff;
    page-break-after: avoid;
  }

  .content { margin-top: 80px; }
  .toggle  { display: none; }
}
