/* TENDÈ ACADEMY — En-tête, navigation mobile (barre basse), pied de page. */

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg-card); border-bottom: 1px solid var(--ink-100);
  height: var(--header-h);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--navy-800); flex-shrink: 0; }
.brand img { height: 46px; width: auto; display: block; }
.brand .tag { display: none; }

/* Logo officiel sur fond sombre : toujours présenté sur un socle clair pour rester lisible et cohérent partout. */
.logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: var(--radius-md); padding: 10px 16px; box-shadow: var(--shadow-sm); }
.logo-chip img { height: 38px; width: auto; display: block; }

.main-nav { display: none; }
@media (min-width: 900px) {
  .main-nav { display: flex; align-items: center; gap: 18px; margin-left: 16px; }
  .main-nav a { color: var(--ink-700); font-weight: 600; font-size: .89rem; padding: 8px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .main-nav a:hover, .main-nav a.active { color: var(--royal-600); border-color: var(--gold-500); text-decoration: none; }
}
@media (min-width: 1180px) {
  .main-nav { gap: 24px; }
  .main-nav a { font-size: .93rem; }
}

.lang-switch { display: flex; align-items: center; border: 1px solid var(--ink-100); border-radius: var(--radius-pill); overflow: hidden; flex-shrink: 0; }
.lang-switch button { border: none; background: transparent; color: var(--ink-500); font-weight: 700; font-size: .74rem; letter-spacing: .03em; padding: 7px 10px; cursor: pointer; }
.lang-switch button.active { background: var(--royal-600); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-search { display: none; }
@media (min-width: 1080px) {
  .header-search { display: flex; align-items: center; gap: 8px; background: var(--bg-app); border: 1px solid var(--ink-100); border-radius: var(--radius-pill); padding: 8px 14px; width: 260px; }
  .header-search input { border: none; background: transparent; outline: none; font-size: .88rem; width: 100%; }
}
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-app); border: 1px solid var(--ink-100); color: var(--navy-800); cursor: pointer; position: relative; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); border: 2px solid var(--bg-card); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--royal-600); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hamburger { display: inline-flex; }
@media (min-width: 900px) { .hamburger { display: none; } }

.mobile-menu { position: fixed; inset: 0; background: rgba(10,20,45,.55); z-index: 300; display: none; }
.mobile-menu.open { display: block; }
.mobile-menu-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); background: var(--bg-card); padding: 20px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.mobile-menu-panel a { display: block; padding: 13px 6px; font-weight: 600; color: var(--navy-800); border-bottom: 1px solid var(--ink-100); }
.mobile-menu-close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-700); }

/* ---------- Barre de navigation basse (mobile, façon app) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--bg-card); border-top: 1px solid var(--ink-100);
  display: flex; height: var(--nav-h-mobile);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 900px) { .bottom-nav { display: none; } }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-500); font-size: .68rem; font-weight: 600; }
.bottom-nav a.active { color: var(--royal-600); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.82); padding: 44px 0 90px; }
@media (min-width: 900px) { .site-footer { padding: 56px 0; } }
.site-footer .brand { color: #fff; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--gold-400); }
.footer-tagline { font-family: var(--font-display); font-size: 1.05rem; color: #fff; margin: 14px 0 24px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.footer-col a { display: block; font-size: .9rem; margin-bottom: 8px; }
.footer-badges { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.footer-badge { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: rgba(255,255,255,.75); }
.footer-bottom { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; color: rgba(255,255,255,.55); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- Assistant Tendè AI (bouton flottant + panneau) ---------- */
.ai-fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h-mobile) + 16px); z-index: 250;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--royal-600), var(--emerald-600)); color: #fff;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
@media (min-width: 900px) { .ai-fab { bottom: 24px; } }
.ai-panel {
  position: fixed; z-index: 260; right: 0; left: 0; bottom: 0; top: 12%;
  background: var(--bg-card); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.ai-panel.open { display: flex; }
@media (min-width: 640px) { .ai-panel { left: auto; top: auto; bottom: 100px; right: 18px; width: 380px; height: 560px; border-radius: 20px; } }
.ai-panel-header { background: linear-gradient(135deg, var(--navy-900), var(--royal-700)); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.ai-panel-header strong { display: block; }
.ai-panel-header span { font-size: .78rem; opacity: .8; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-app); }
.ai-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.4; }
.ai-msg.user { align-self: flex-end; background: var(--royal-600); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--white); color: var(--ink-900); border: 1px solid var(--ink-100); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.ai-msg .course-chip { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--royal-100); color: var(--royal-700); font-weight: 600; font-size: .82rem; }
.ai-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--ink-100); background: var(--bg-card); }
.ai-input-row input { flex: 1; border: 1.5px solid var(--ink-100); border-radius: var(--radius-pill); padding: 10px 16px; font-size: .9rem; }
.ai-input-row button { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--royal-600); color: #fff; cursor: pointer; }

/* Raccourcis Formateur / Admin : dans l'en-tête sur grand écran, dans le menu mobile sinon */
@media (max-width: 899px) { .header-role-link { display: none !important; } }
@media (max-width: 1439px) { .header-role-link .role-text { display: none; } }
/* La recherche de l'en-tête rétrécit plutôt que de faire déborder la page */
.site-header .header-search { flex: 0 1 260px; width: auto; min-width: 120px; }
.site-header .header-actions { min-width: 0; }
.site-header .header-actions > :not(.header-search) { flex-shrink: 0; }

/* Bandeau d'annonce (Administration → Contenu du site) */
.site-banner { display: block; background: var(--gold-500); color: var(--navy-900); text-align: center; font-weight: 700; font-size: .88rem; padding: 8px 16px; text-decoration: none; }
a.site-banner:hover { text-decoration: underline; color: var(--navy-900); }
[data-cms-block][hidden] { display: none !important; }
/* Petits écrans : connexion / inscription passent dans le menu (évite le débordement de l'en-tête) */
@media (max-width: 520px) { .site-header .header-actions > a.btn { display: none; } }
