/* ==========================================================================
   STYLE NOTION DARK EXPÉRIENCE PREMIUM — COURS DE 3ÈME
   Design épuré, typographie d'excellence, micro-animations et fidélité Notion
   ========================================================================== */
/* Police chargée de manière non-bloquante via <link> dans le HTML */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-main: #131315;
  --bg-surface: #18181b;
  --bg-card: #1e1e22;
  --bg-card-hover: #26262c;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: #2c2c32;
  --text-main: #f0f0f3;
  --text-body: #d4d4dc;
  --text-muted: #9c9ca6;
  --text-dim: #6c6c76;
  --accent-purple: #8e5de0;
  --accent-purple-glow: rgba(142, 93, 224, 0.25);
  --accent-blue: #4f8cf6;
  --accent-red: #e05260;
  --accent-green: #38b277;
  --accent-amber: #e5933a;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, #1e1829 0%, #131315 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(0, 0, 0, 0.2) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Barre de défilement discrète et élégante */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #2a2a30;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3e3e48;
}

/* ==========================================================================
   HEADER FLOTTANT & BREADCRUMBS
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(19, 19, 21, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb-item {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
  cursor: pointer;
  font-weight: 500;
}

.crumb-item:hover {
  color: #ffffff;
}

.header-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}

.crumb-sep {
  color: var(--text-dim);
  font-size: 0.74rem;
  user-select: none;
}

.crumb-current {
  color: var(--text-main);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.header-search-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.header-search-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.header-search-btn kbd {
  background: #232328;
  border: 1px solid #34343e;
  color: #92929e;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
}

.header-action-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.reading-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   ZONE PRINCIPALE DE LA PAGE
   ========================================================================== */

.page-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 90px 18px;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bouton de retour vers l'accueil */
.back-nav {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.back-link:hover {
  color: #ffffff;
  background-color: #242429;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

/* Titre principal H1 */
.main-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  line-height: 1.22;
}

/* ==========================================================================
   SECTIONS NOTION EXACTES (INFORMATIONS, COURS, OUTILS, CONTACT)
   ========================================================================== */

.notion-section {
  margin-bottom: 28px;
}

/* Bandeaux rectangulaires arrondis avec micro-relief Notion */
.banner-header {
  padding: 9px 15px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.015em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 3px 10px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Palette de couleurs exacte Notion de la capture */
.notion-section.rc .banner-header {
  background: linear-gradient(180deg, #5c2426 0%, #4a1c1e 100%);
  border-left: 3px solid #ff5a67;
}

.notion-section.cours .banner-header {
  background: linear-gradient(180deg, #44275c 0%, #341c47 100%);
  border-left: 3px solid #b87cff;
}

.notion-section.tool .banner-header {
  background: linear-gradient(180deg, #5c311c 0%, #462211 100%);
  border-left: 3px solid #f99049;
}

.notion-section.contact .banner-header {
  background: linear-gradient(180deg, #48401e 0%, #373014 100%);
  border-left: 3px solid #d4c942;
}

.notion-section.default .banner-header {
  background: linear-gradient(180deg, #2e2e34 0%, #232328 100%);
  border-left: 3px solid #7c7c88;
}

/* Corps sous le bandeau avec la barre verticale blanche/grise */
.section-body-bar,
.section-body-plain {
  border-left: 2px solid rgba(230, 230, 238, 0.65);
  margin: 12px 0 0 12px;
  padding: 4px 0 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Lignes de contenu */
.section-line {
  font-size: 0.94rem;
  color: var(--text-body);
  line-height: 1.6;
  display: block;
  word-break: normal;
  overflow-wrap: break-word;
}

.section-line strong {
  color: #ffffff;
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}

/* Symbole » blanc/gris comme dans la capture */
.chevron-sign {
  display: inline-block;
  color: #b0b0ba;
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 8px;
  user-select: none;
}

/* ==========================================================================
   LIENS DE COURS & MATIÈRES
   ========================================================================== */

.course-link-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  padding: 5px 9px;
  margin-left: -9px;
  border-radius: 6px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.course-link-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(4px);
}

.course-link-item .course-icon,
.course-link-item .course-link-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--accent-light, #c084fc);
  transition: transform 0.16s ease, stroke 0.16s ease;
}

.course-link-item:hover .course-link-icon {
  stroke: #ffffff;
  transform: scale(1.15);
}

.course-link-item .course-title-text {
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.course-link-item:hover .course-title-text {
  color: #ffffff;
  text-decoration: none;
}

.course-link-item::after {
  content: "→";
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.16s ease;
  font-size: 0.8rem;
  color: #9e9ea7;
  margin-left: 4px;
}

.course-link-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Liens texte normal (Style Notion épuré sans soulignement lourd) */
.notion-text-link {
  color: #c4b5fd;
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 181, 253, 0.35);
  font-weight: 500;
  transition: all 0.15s ease;
}

.notion-text-link:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* Boutons sobres et élégants */
.notion-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #242429;
  color: #f2f2f6;
  border: 1px solid #383840;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  line-height: 1.4;
  user-select: none;
}

.notion-btn-link:hover {
  background-color: #313138;
  border-color: #555562;
  color: #ffffff;
  transform: translateY(-1px);
}

.notion-btn-link .external-arrow {
  font-size: 0.74rem;
  opacity: 0.7;
}

/* Liens pour URLs brutes */
.notion-raw-link {
  color: #93c5fd;
  text-decoration: none;
  border-bottom: 1px solid rgba(147, 197, 253, 0.35);
  word-break: break-all;
  font-size: 0.9em;
  transition: all 0.15s ease;
}

.notion-raw-link:hover {
  color: #bfdbfe;
  border-bottom-color: #bfdbfe;
}


/* ==========================================================================
   CALLOUTS NOTION & GITHUB ALERTS
   ========================================================================== */

.notion-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.notion-callout-icon {
  font-size: 1.25rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.notion-callout-content {
  flex: 1;
}

.notion-callout-header {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  color: #afafba;
}

.notion-callout-important {
  background-color: rgba(142, 93, 224, 0.08);
  border-color: rgba(162, 113, 244, 0.32);
}
.notion-callout-important .notion-callout-header {
  color: #c8a3ff;
}

.notion-callout-warning {
  background-color: rgba(229, 147, 58, 0.09);
  border-color: rgba(240, 160, 50, 0.35);
}
.notion-callout-warning .notion-callout-header {
  color: #f7b466;
}

.notion-callout-tip {
  background-color: rgba(56, 178, 119, 0.09);
  border-color: rgba(56, 178, 119, 0.32);
}
.notion-callout-tip .notion-callout-header {
  color: #6ee3a7;
}

.notion-callout-info {
  background-color: rgba(79, 140, 246, 0.09);
  border-color: rgba(79, 140, 246, 0.32);
}
.notion-callout-info .notion-callout-header {
  color: #8cb8ff;
}

.notion-callout-brevet {
  background-color: rgba(224, 82, 96, 0.09);
  border-color: rgba(240, 90, 110, 0.35);
}
.notion-callout-brevet .notion-callout-header {
  color: #ff8593;
}

.notion-callout-retenir {
  background: #1c1c1e;
  border: 1px solid #353338;
  box-shadow: none;
  border-radius: 6px;
  margin: 32px 0 22px 0;
  padding: 18px 22px;
}

.notion-callout-retenir .notion-callout-icon {
  display: none;
}

.notion-callout-retenir .notion-callout-header {
  color: #c5bbd0;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
}

.notion-callout-retenir li {
  color: #d1cdd5;
  margin-bottom: 8px;
  line-height: 1.65;
}

.notion-callout-retenir strong {
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   TYPOGRAPHIE DU CORPS DE COURS (STYLE ÉDITEUR NOTION SOIGNÉ)
   ========================================================================== */

.notion-h2 {
  font-size: 1.45rem;
  font-weight: 750;
  color: #ffffff;
  margin: 36px 0 16px 0;
  letter-spacing: -0.018em;
  padding-bottom: 8px;
  position: relative;
  border-bottom: 2px solid rgba(168, 85, 247, 0.35);
}

.notion-h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 2px;
}

.notion-h3 {
  font-size: 1.18rem;
  font-weight: 650;
  color: #f3e8ff;
  margin: 26px 0 12px 0;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--accent, #a855f7);
  padding-left: 12px;
}

.notion-h4 {
  font-size: 1.04rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 20px 0 10px 0;
  padding-left: 6px;
}

u {
  text-decoration: none;
  border-bottom: 2px solid var(--accent-light, #c084fc);
  padding-bottom: 1px;
  color: #ffffff;
}

.notion-p {
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--text-body);
  margin-bottom: 14px;
  word-break: break-word;
}

.notion-p strong, .section-line strong {
  color: #ffffff;
  font-weight: 600;
}

.notion-list, .notion-ol {
  margin: 10px 0 16px 20px;
  line-height: 1.68;
  color: var(--text-body);
}

.notion-list li, .notion-ol li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.notion-list li.notion-sub-item {
  margin-left: 20px;
  list-style-type: circle;
  color: var(--text-muted);
}

/* Checklists & Tâches interactives Notion */
.notion-task-list {
  list-style: none;
  margin: 12px 0 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notion-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-body);
  user-select: none;
}

.notion-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #585864;
  border-radius: 4px;
  background: #19191d;
  cursor: pointer;
  margin-top: 3px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
}

.notion-checkbox:hover {
  border-color: #8e5de0;
  background: #202026;
}

.notion-checkbox:checked {
  background: #8e5de0;
  border-color: #8e5de0;
}

.notion-checkbox:checked::after {
  content: "✓";
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.notion-task-checked .task-text {
  text-decoration: line-through;
  color: var(--text-dim);
  transition: color 0.15s;
}

.task-text {
  flex: 1;
}

.notion-mermaid-container {
  background: #17171a;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  overflow-x: auto;
  text-align: center;
}


.notion-quote {
  border-left: 3px solid #8e5de0;
  padding: 8px 16px;
  margin: 18px 0;
  background: rgba(142, 93, 224, 0.05);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #d2d2dc;
}

/* ==========================================================================
   TABLEAUX MODERNES NOTION (GRID & RESPONSIVE TABLES)
   ========================================================================== */

.notion-table-wrapper {
  margin: 26px 0 30px 0;
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 26, 0.75);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.notion-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.93rem;
  line-height: 1.64;
  color: var(--text-body, #d1d1d8);
  text-align: left;
}

.notion-table th {
  background: rgba(35, 30, 50, 0.9);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 18px;
  border-bottom: 2px solid rgba(168, 85, 247, 0.45);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.notion-table th:last-child {
  border-right: none;
}

.notion-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
  line-height: 1.68;
}

.notion-table td:last-child {
  border-right: none;
}

.notion-table tbody tr:last-child td {
  border-bottom: none;
}

.notion-table tbody tr {
  transition: background-color 0.15s ease;
}

.notion-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

.notion-table td strong {
  color: #ffffff;
  font-weight: 650;
}

.notion-inline-code {
  background-color: #202025;
  border: 1px solid #303038;
  color: #d9c6ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 4px;
}

.notion-code-block {
  background-color: #161619;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #e5e5ed;
}

/* ==========================================================================
   TABLEAUX NOTION
   ========================================================================== */

.notion-table-wrapper {
  overflow-x: auto;
  margin: 22px 0;
  border-radius: 8px;
  border: 1px solid var(--border-card);
}

.notion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.notion-table th {
  background-color: #202026;
  color: #ffffff;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-card);
  border-right: 1px solid var(--border-card);
}

.notion-table th:last-child {
  border-right: none;
}

.notion-table td {
  padding: 10px 14px;
  color: var(--text-body);
  border-bottom: 1px solid #25252c;
  border-right: 1px solid #25252c;
  background-color: #18181b;
}

.notion-table tr:last-child td {
  border-bottom: none;
}

.notion-table td:last-child {
  border-right: none;
}

.notion-table tr:hover td {
  background-color: #202025;
}

/* ==========================================================================
   FORMULES MATHÉMATIQUES
   ========================================================================== */

.notion-math-block {
  background: #1b1b1f;
  border: 1px solid #2d2d35;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  text-align: center;
}

.notion-math-block .math-expr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: #c9b1ff;
  letter-spacing: 0.02em;
}

.notion-math-inline {
  background: #202026;
  border: 1px solid #31313a;
  color: #c9b1ff;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

/* ==========================================================================
   IMAGES & ILLUSTRATIONS AVEC LIGHTBOX
   ========================================================================== */

.notion-image-container {
  margin: 24px 0;
  text-align: center;
}

.notion-content-img {
  max-width: 100%;
  max-height: 480px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.notion-content-img:hover {
  transform: scale(1.015);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.25);
}

.notion-img-caption {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 8px;
  font-style: italic;
}

.notion-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 28px 0;
}

/* ==========================================================================
   BARRE D'ACTIONS DE BAS DE COURS
   ========================================================================== */

.course-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 36px 0 18px;
  padding-top: 20px;
  border-top: 1px solid #2b282e;
}
.course-pagination-link {
  color: #a19ba8;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 150ms;
}
.course-pagination-link:hover { color: #d6c5e6; }
.course-pagination-link.previous { grid-column: 1; justify-self: start; }
.course-pagination-link.next { grid-column: 2; justify-self: end; }
.course-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.action-pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 0.81rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
}

.action-pill-btn:hover {
  background: #242429;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.pill-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}

/* ==========================================================================
   WIDGET FEEDBACK DISCRET
   ========================================================================== */

.feedback-widget {
  margin-top: 36px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.feedback-icon {
  font-size: 1.05rem;
}

.feedback-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.feedback-textarea {
  width: 100%;
  background-color: #121214;
  border: 1px solid #2c2c32;
  border-radius: 6px;
  padding: 11px 13px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.48;
  resize: vertical;
  min-height: 68px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.feedback-textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.feedback-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.feedback-status {
  font-size: 0.84rem;
  font-weight: 500;
}

/* ==========================================================================
   PALETTE DE RECHERCHE RAPIDE (CTRL + K)
   ========================================================================== */

.search-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 70px 16px 20px 16px;
  animation: fadeIn 0.18s ease-out;
}

.search-modal-backdrop.active {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 600px;
  background: #19191c;
  border: 1px solid #2f2f36;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.search-modal-icon {
  font-size: 1.15rem;
  opacity: 0.75;
}

.search-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
}

.search-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.15s;
}

.search-close-btn:hover {
  color: #ffffff;
}

/* Filtres de matières dans la palette */
.search-filter-pills {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  background: #141417;
}

.search-filter-pill {
  background: #202026;
  border: 1px solid #2e2e38;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.search-filter-pill:hover, .search-filter-pill.active {
  background: #2e2a40;
  border-color: #7c5ce6;
  color: #ffffff;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 7px;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.9rem;
}

.search-result-item:hover,
.search-result-item.selected {
  background: #26262e;
  color: #ffffff;
}

.search-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-badge {
  font-size: 0.72rem;
  color: #9d9db2;
  background: #212128;
  border: 1px solid #2e2e38;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-modal-footer {
  padding: 10px 18px;
  background: #141416;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.esc-badge {
  background: #212128;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #2e2e38;
}

/* ==========================================================================
   LIGHTBOX MODALE D'IMAGE PLEIN ÉCRAN
   ========================================================================== */

.lightbox-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox-backdrop.active {
  display: flex;
  animation: fadeIn 0.18s ease-out;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: default;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-caption {
  color: #e5e5ed;
  font-size: 0.92rem;
  margin-top: 12px;
  text-align: center;
}

.lightbox-close-btn {
  position: absolute;
  top: -42px;
  right: 0;
  background: #242429;
  border: 1px solid #383840;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}

.lightbox-close-btn:hover {
  background: #3a3a42;
  transform: scale(1.08);
}

/* Toast de notification flottant */
.global-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #211c2e;
  border: 1px solid #8e5de0;
  color: #ffffff;
  padding: 9px 20px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3000;
}

.global-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Pied de page */
.page-footer {
  margin-top: 60px;
  padding-top: 20px;
  text-align: center;
}

.admin-footer-link {
  color: #828292;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  padding: 6px 14px;
  border-radius: 6px;
  background: #13131a;
  border: 1px solid #22222d;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-footer-link:hover {
  color: #ffffff;
  background: #1c1c26;
  border-color: #38384a;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .page-wrapper {
    padding: 20px 14px 60px 14px;
  }
  .main-title {
    font-size: 1.85rem;
  }
  .header-search-btn kbd {
    display: none;
  }
}

/* ==========================================================================
   WIDGET ASSISTANT (DESIGN SOBRE NOIR & GRIS STYLE CHATGPT)
   ========================================================================== */

.chatbot-root {
  position: relative;
  z-index: 2100;
}

/* Bouton Flottant Sobre (FAB) */
.chatbot-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 12px;
  background: #212121;
  color: #ececec;
  border: 1px solid #363636;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.chatbot-fab:hover {
  background: #2a2a2a;
  border-color: #484848;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.chatbot-fab:active {
  transform: translateY(0);
}

.chatbot-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.chatbot-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d4;
}

.chatbot-fab-label {
  letter-spacing: -0.01em;
}

/* Fenêtre Tiroir ChatGPT */
.chatbot-drawer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 40px);
  background: #171717;
  border: 1px solid #303030;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transform-origin: bottom right;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-drawer.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* En-tête sobre */
.chatbot-header {
  padding: 12px 14px;
  background: #171717;
  border-bottom: 1px solid #262626;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #242424;
  border: 1px solid #383838;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d1d1;
  flex-shrink: 0;
}

.chatbot-title-group {
  display: flex;
  flex-direction: column;
}

.chatbot-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ececec;
  letter-spacing: -0.01em;
}

.chatbot-subtitle {
  font-size: 0.72rem;
  color: #808080;
  font-weight: 400;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-action-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #858585;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.chatbot-action-icon:hover {
  background: #262626;
  color: #ececec;
}

/* Barre de contexte du cours */
.chatbot-context-bar {
  padding: 6px 14px;
  background: #1a1a1a;
  border-bottom: 1px solid #262626;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.chatbot-context-text {
  color: #a3a3a3;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.context-indicator-dot {
  width: 6px;
  height: 6px;
  background: #606060;
  border-radius: 50%;
  flex-shrink: 0;
}

.chatbot-context-toggle {
  background: #242424;
  border: 1px solid #383838;
  color: #c4c4c4;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chatbot-context-toggle:hover {
  background: #2f2f2f;
  color: #ffffff;
}

.chatbot-context-toggle.disabled {
  background: transparent;
  border-color: #2b2b2b;
  color: #555555;
}

/* État d'accueil sobre */
.chatbot-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.chatbot-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #212121;
  border: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d1d1;
  margin-bottom: 14px;
}

.chatbot-empty-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #ececec;
  margin-bottom: 6px;
}

.chatbot-empty-sub {
  font-size: 0.8rem;
  color: #878787;
  line-height: 1.45;
  max-width: 280px;
}

/* Zone des Messages */
.chatbot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #171717;
  scroll-behavior: smooth;
}

.chatbot-msg {
  display: flex;
  flex-direction: column;
  animation: chatbotFadeIn 0.18s ease-out;
}

@keyframes chatbotFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-msg-user {
  align-self: flex-end;
  max-width: 86%;
}

.chatbot-msg-ai {
  align-self: flex-start;
  max-width: 96%;
}

.chatbot-bubble {
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

.chatbot-msg-user .chatbot-bubble {
  background: #2f2f2f;
  color: #ececec;
  padding: 9px 13px;
  border-radius: 18px 18px 4px 18px;
}

.chatbot-msg-ai .chatbot-bubble {
  background: transparent;
  color: #d4d4d4;
  padding: 2px 4px;
}

.chatbot-bubble p {
  margin: 0 0 8px 0;
}
.chatbot-bubble p:last-child {
  margin-bottom: 0;
}

.chatbot-bubble ul, .chatbot-bubble ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.chatbot-bubble li {
  margin-bottom: 4px;
}

.chatbot-bubble strong {
  color: #ffffff;
  font-weight: 600;
}

.chatbot-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: #242424;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #363636;
  color: #f0f0f0;
}

.chatbot-bubble pre {
  background: #121212;
  border: 1px solid #2a2a2a;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

/* Indicateur de saisie sobre */
.chatbot-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #222222;
  border-radius: 12px;
  width: fit-content;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: #808080;
  border-radius: 50%;
  animation: typingBounce 1.3s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.35; }
  40% { transform: scale(1.05); opacity: 0.9; }
}

/* Puces de suggestions style ChatGPT */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: #171717;
  border-top: 1px solid #242424;
  flex-shrink: 0;
  max-height: 84px;
  overflow-y: auto;
}

.chatbot-suggestion-chip {
  background: #212121;
  border: 1px solid #333333;
  color: #b5b5b5;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 400;
  padding: 5px 11px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chatbot-suggestion-chip:hover {
  background: #2b2b2b;
  color: #ffffff;
  border-color: #484848;
}

/* Zone et conteneur de saisie style ChatGPT */
.chatbot-input-bar {
  padding: 6px 14px 4px 14px;
  background: #171717;
  flex-shrink: 0;
}

.chatbot-input-container {
  background: #212121;
  border: 1px solid #363636;
  border-radius: 22px;
  padding: 6px 6px 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.chatbot-input-container:focus-within {
  border-color: #525252;
}

.chatbot-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #ececec;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 4px 0;
  resize: none;
  max-height: 100px;
  outline: none;
  line-height: 1.4;
}

.chatbot-textarea::placeholder {
  color: #6a6a6a;
}

/* Bouton envoyer rond avec flèche haut style ChatGPT */
.chatbot-send-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chatbot-send-btn:hover:not(:disabled) {
  background: #f0f0f0;
  transform: scale(1.04);
}

.chatbot-send-btn:disabled {
  background: #2d2d2d;
  color: #5f5f5f;
  cursor: not-allowed;
}

.chatbot-footer-caption {
  font-size: 0.66rem;
  color: #636363;
  text-align: center;
  padding: 3px 14px 8px 14px;
  background: #171717;
  flex-shrink: 0;
}

/* Plein écran sur Mobile */
@media (max-width: 600px) {
  .chatbot-fab {
    bottom: 16px;
    right: 16px;
    padding: 8px 13px 8px 11px;
    font-size: 0.82rem;
  }

  .chatbot-drawer {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}

