/* ===== MEGA MENU — domaines fonctionnels ===== */
.ai-mega-panel {
  left: 0 !important;
  transform: translateY(-14px) !important;
  min-width: 880px;
  max-width: calc(100vw - 32px);
}
.menu-dropdown.is-open .ai-mega-panel {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ── Layout ── */
.mega-layout { display: flex; min-height: 370px; }

/* ── Sidebar ── */
.mega-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid #eef2f7;
  border-radius: 28px 0 0 28px;
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
}
.mega-domain-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
  transition: background 0.13s, border-color 0.13s;
}
.mega-domain-item:hover  { background: rgba(185,67,193,0.05); border-left-color: rgba(185,67,193,0.3); }
.mega-domain-item.active { background: #fff; border-left-color: #b943c1; }
.mega-domain-item.active .domain-title  { color: #b943c1; }
.mega-domain-item.active .mega-domain-icon { color: #b943c1; }
.mega-domain-icon { font-size: 0.82rem; color: #94a3b8; width: 15px; text-align: center; flex-shrink: 0; }
.mega-domain-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.domain-title { font-size: 0.77rem; font-weight: 600; color: #13223f; line-height: 1.2; }
.domain-sub   { font-size: 0.65rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Content panel ── */
.mega-content {
  flex: 1;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mega-content-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f0f4f8;
  padding-bottom: 8px;
}
.mega-content-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #13223f;
  margin: 0;
}
.mega-content-sub {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ── Course list ── */
.mega-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 1;
}

/* High specificity to beat .menu-links a { color:#fff } */
.ai-mega-panel a.mega-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  text-decoration: none;
  color: #13223f;
  border-bottom: none;
  transition: background 0.12s;
}
.ai-mega-panel a.mega-item:hover {
  background: #f0f4ff;
  color: #13223f;
  text-decoration: none;
  border-bottom: none;
}
.ai-mega-panel a.mega-item.mega-hidden { display: none !important; }
.ai-mega-panel a.mega-item .mega-item-text {
  flex: 1;
  min-width: 0;
}
.ai-mega-panel a.mega-item .mega-item-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #13223f;
  line-height: 1.3;
}
.ai-mega-panel a.mega-item .mega-item-desc {
  display: block;
  font-size: 0.64rem;
  color: #94a3b8;
  line-height: 1.3;
  margin-top: 2px;
}

/* ── Histograms in mega-menu items ── */
.mega-item .histogram-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.mega-item .histogram {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 18px;
}
.mega-item .histogram-bar {
  width: 9px;
  border-radius: 2px 2px 0 0;
  background: #cbd5f5;
  opacity: 0.35;
}
.mega-item .level-beginner .histogram-bar:nth-child(1)    { height: 7px;  opacity: 1; }
.mega-item .level-beginner .histogram-bar:nth-child(2),
.mega-item .level-beginner .histogram-bar:nth-child(3)    { height: 4px; }
.mega-item .level-intermediate .histogram-bar:nth-child(1) { height: 13px; opacity: 1; }
.mega-item .level-intermediate .histogram-bar:nth-child(2) { height: 9px;  opacity: 1; }
.mega-item .level-expert .histogram-bar:nth-child(1)      { height: 16px; opacity: 1; }
.mega-item .level-expert .histogram-bar:nth-child(2)      { height: 12px; opacity: 1; }
.mega-item .level-expert .histogram-bar:nth-child(3)      { height: 8px;  opacity: 1; }
.mega-item .functional-profile .histogram-bar { background: #ff5fa2; }
.mega-item .technical-profile  .histogram-bar { background: #5da6ff; }
.mega-item .course-level {
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Level pills ── */
.level-pill {
  font-size: 0.57rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.level-pill.decouverte   { background: rgba(37,99,235,0.09);  color: #2563eb; }
.level-pill.miseenoeuvre { background: rgba(124,58,237,0.09); color: #7c3aed; }
.level-pill.expertise    { background: rgba(219,39,119,0.1);  color: #db2777; }

/* ── Empty state ── */
.mega-empty {
  display: none;
  grid-column: 1 / -1;
  padding: 20px 8px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}
.mega-empty.visible { display: block; }

/* ── Footer ── */
.mega-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f4f8; }
.ai-mega-panel a.mega-view-all {
  font-size: 0.71rem;
  font-weight: 700;
  color: #b943c1;
  text-decoration: none;
  border-bottom: none;
}
.ai-mega-panel a.mega-view-all:hover { text-decoration: underline; }

/* ── Tech mega-panel: narrower sidebar (only 3 items, no subtitles) ── */
.ai-tech-panel .mega-sidebar { width: 170px; }
.ai-tech-panel .mega-layout  { min-height: 240px; }

/* ── Responsive ── */
@media (max-width: 920px) {
  .ai-mega-panel { min-width: unset !important; left: auto !important; }
  .mega-layout { flex-direction: column; min-height: unset; }
  .mega-sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid #eef2f7;
    border-radius: 16px 16px 0 0; flex-direction: row; flex-wrap: wrap;
    padding: 8px 10px; gap: 4px;
  }
  .mega-sidebar-group-label { display: none; }
  .mega-domain-item { border-left: none; border-radius: 8px; padding: 5px 9px; border: 1px solid #eef2f7; }
  .mega-domain-item.active { border-color: rgba(185,67,193,0.4); background: rgba(185,67,193,0.07); }
  .domain-sub { display: none; }
  .mega-list { grid-template-columns: 1fr; }
}

/* ===== Domain bar — training pages ===== */
.domain-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 28px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}
.domain-bar__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  white-space: nowrap;
}
.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #13223f;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.domain-chip i {
  font-size: 0.68rem;
  color: #b943c1;
}
.domain-chip:hover {
  border-color: #b943c1;
  background: rgba(185,67,193,0.06);
  color: #b943c1;
  text-decoration: none;
}
.domain-chip.active {
  border-color: #b943c1;
  background: #b943c1;
  color: #fff;
  cursor: default;
}
.domain-chip.active i { color: #fff; }

/* Domain context label — shown when a domain is active, on its own row */
.domain-context-label {
  display: none;
  flex-basis: 100%;        /* force new flex row */
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #13223f;
  padding-top: 6px;
  border-top: 1px solid #f0f4f8;
  margin-top: 4px;
}
.domain-context-label.is-visible { display: flex; }
.domain-context-label i { font-size: 0.7rem; color: #b943c1; }
.domain-context-label strong { font-weight: 700; color: #b943c1; }
.dctx-sep { color: #cbd5e1; margin: 0 2px; }
.dctx-sub { color: #64748b; }

@media (max-width: 640px) {
  .domain-bar { padding: 8px 16px; gap: 8px; }
  .domain-bar__label { width: 100%; }
}

/* ===== CPF & Qualiopi trust badges ===== */
.hero-trust-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.trust-badge:hover { transform: translateY(-2px); }
.trust-badge i { font-size: 1.1rem; flex-shrink: 0; }

.trust-badge__label { display: flex; flex-direction: column; gap: 1px; }
.trust-badge__title { font-size: 0.82rem; font-weight: 800; line-height: 1.1; }
.trust-badge__sub   { font-size: 0.62rem; font-weight: 600; opacity: 0.8; letter-spacing: 0.02em; }

/* CPF — blanc (même style que Qualiopi) */
.trust-badge--cpf {
  background: #fff;
  color: #0d1b2a;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.trust-badge--cpf i { color: #1a6eff; }

/* Qualiopi — blanc sur fond sombre */
.trust-badge--qualiopi {
  background: #fff;
  color: #0d1b2a;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.trust-badge--qualiopi i { color: #e63946; }

/* ===== Domain-specific content section ===== */
#domain-content-section { margin: 0; }

.domain-section {
  display: none;
  margin: 12px 28px 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 20px rgba(19,34,63,0.08), 0 1px 4px rgba(19,34,63,0.04);
  overflow: hidden;
  animation: dsFadeIn 0.22s ease;
}
.domain-section.is-visible { display: block; }
.domain-section::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #b943c1 0%, #7c3aed 55%, #5da6ff 100%);
}

@keyframes dsFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.ds-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px 9px;
  background: #fdfaff;
  border-bottom: 1px solid #f1f5f9;
}
.ds-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(185,67,193,0.13) 0%, rgba(124,58,237,0.09) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-icon-wrap i { font-size: 0.82rem; color: #b943c1; }
.ds-meta { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.ds-adapted-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
}
.ds-domain-name { font-size: 0.76rem; font-weight: 700; color: #b943c1; }
.ds-sep         { color: #e2e8f0; }
.ds-persona     { font-size: 0.68rem; color: #64748b; font-weight: 500; }

/* Body */
.ds-body {
  display: flex;
  align-items: stretch;
  padding: 16px 18px;
  gap: 0;
}
.ds-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 20px;
}
.ds-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #13223f;
  margin: 0 0 5px;
  line-height: 1.25;
}
.ds-subtitle {
  font-size: 0.77rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

/* Vertical divider */
.ds-divider {
  width: 1px;
  background: #f1f5f9;
  flex-shrink: 0;
  align-self: stretch;
  margin: 2px 0;
}

/* Use cases */
.ds-cases {
  flex: 0 0 auto;
  width: 290px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ds-cases-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.ds-case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-case-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.73rem;
  color: #334155;
  line-height: 1.35;
}
.ds-num {
  font-size: 0.58rem;
  font-weight: 800;
  color: #b943c1;
  background: rgba(185,67,193,0.09);
  border-radius: 5px;
  padding: 1px 5px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .domain-section { margin: 10px 16px 6px; }
  .ds-body { flex-direction: column; padding: 14px 16px; gap: 0; }
  .ds-main { padding-right: 0; padding-bottom: 14px; }
  .ds-divider { width: 100%; height: 1px; margin: 0 0 14px; }
  .ds-cases { width: 100%; padding-left: 0; }
}
