/* ============================================================
   VARIABLES & PALETTE
   ============================================================ */
:root {
  /* Palette principale */
  --c-rose:   #e92e6c;
  --c-green:  #81bc38;
  --c-purple: #ab31e5;
  --c-blue:   #203a6a;
  --c-yellow: #efe526;

  /* Mode LUMINEUX — fond clair */
  --bg-base:        #eef1fa;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-hero:        #0f1f45;

  /* Texte */
  --text-primary:   #0f1729;
  --text-secondary: #3d5070;
  --text-muted:     #7a90b8;

  /* Bordures */
  --border-subtle: rgba(32, 58, 106, 0.10);
  --border-light:  rgba(32, 58, 106, 0.20);

  /* Layout */
  --nav-h:   68px;
  --crumb-h: 40px;
  --max-w:   1200px;
  --pad-x:   32px;

  /* Transitions */
  --t-fast:   150ms ease;
  --t-normal: 260ms ease;

  /* Rayons */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html                   { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.65;
}

button { font-family: inherit; cursor: pointer; }
a      { text-decoration: none; color: inherit; }

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(32,58,106,0.25); border-radius: 3px; }

/* ============================================================
   NAVBAR — fond blanc, ombre subtile
   ============================================================ */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 16px rgba(32, 58, 106, 0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Bouton marque */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: var(--r-full);
  transition: background var(--t-fast);
}
.nav-brand:hover { background: var(--bg-base); }

/* Logo dans la navbar */
.nav-logo {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Recherche */
.nav-search-wrapper { flex: 1; max-width: 460px; position: relative; }

.search-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--bg-base);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-full);
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}
.search-input-container:focus-within {
  border-color: var(--c-rose);
  box-shadow: 0 0 0 3px rgba(233, 46, 108, 0.10);
  background: #fff;
}

.search-icon { font-size: 13px; opacity: 0.45; flex-shrink: 0; }

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 0;
}
#search-input::placeholder { color: var(--text-muted); }

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 50%;
  display: none;
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.search-clear:hover  { color: var(--text-primary); background: rgba(0,0,0,0.06); }
.search-clear.active { display: flex; align-items: center; justify-content: center; }

/* Dropdown résultats */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 16px 40px rgba(32, 58, 106, 0.16);
  z-index: 200;
}
.search-results-dropdown.visible {
  display: block;
  animation: dropDown 0.16s ease;
}
@keyframes dropDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-group { padding: 6px 0; }
.search-group + .search-group { border-top: 1px solid var(--border-subtle); }

.search-group-label {
  padding: 7px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.search-group-label::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--group-color, #ccc);
  flex-shrink: 0;
}

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.search-result-item:hover {
  background: var(--bg-base);
  border-left-color: var(--item-color, var(--c-rose));
}

.search-result-title   { font-size: 14px; font-weight: 500; margin-bottom: 2px; color: var(--text-primary); }
.search-result-summary { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-result-title mark {
  background: rgba(233, 46, 108, 0.15);
  color: #c0155a;
  border-radius: 2px;
  padding: 0 2px;
}

.search-no-results { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Bouton accueil nav */
.nav-home-btn {
  background: none;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-normal);
}
.nav-home-btn:hover {
  color: var(--c-blue);
  border-color: var(--c-blue);
  background: rgba(32, 58, 106, 0.05);
}

/* ============================================================
   FIL D'ARIANE
   ============================================================ */
#breadcrumb-bar {
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  z-index: 90;
  height: var(--crumb-h);
  background: rgba(238, 241, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.crumb-item { color: var(--text-muted); transition: color var(--t-fast); }
.crumb-item.clickable { cursor: pointer; }
.crumb-item.clickable:hover { color: var(--c-blue); }
.crumb-item.active         { color: var(--text-secondary); font-weight: 500; }
.crumb-sep { color: var(--text-muted); opacity: 0.4; font-size: 11px; }

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + var(--crumb-h) + 40px) var(--pad-x) 80px;
  min-height: 100vh;
}

/* ============================================================
   HERO — compact, gradient foncé, accroche visible
   ============================================================ */
.home-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0c1a35 0%, #1a3060 50%, #162b52 100%);
  border-radius: var(--r-xl);
  padding: 48px 56px 48px 40px;
  margin-bottom: 36px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Halo rose en arrière-plan */
.home-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(233, 46, 108, 0.30) 0%, transparent 65%);
  pointer-events: none;
}

/* Points décoratifs */
.home-hero::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(129, 188, 56, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

/* Bande arc-en-ciel à gauche du hero */
.hero-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, #e92e6c, #efe526, #81bc38, #203a6a, #ab31e5);
  border-radius: 0;
  z-index: 2;
}

.hero-content { flex: 1; position: relative; z-index: 1; }

.hero-list {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #fff 0%, #d0e0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-candidate {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.70);
  margin-bottom: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
}

.hero-tag-accent {
  background: rgba(233, 46, 108, 0.30);
  border-color: rgba(233, 46, 108, 0.50);
  color: #ffb3cc;
}

/* ============================================================
   GRILLE DES THÈMES — cartes horizontales compactes
   ============================================================ */
.themes-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-left: 4px;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Carte thème — layout horizontal aéré */
.theme-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-left: 5px solid var(--card-color, var(--c-rose));
  border-radius: var(--r-lg);
  cursor: pointer;
  /* Animation d'entrée */
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  text-align: left;
}

.theme-card:hover {
  transform: translateY(-3px) translateX(2px);
  box-shadow: 0 6px 22px rgba(var(--card-rgb), 0.20);
  border-color: rgba(var(--card-rgb), 0.5);
  border-left-color: var(--card-color);
}

.theme-card:focus-visible {
  outline: 2px solid var(--card-color);
  outline-offset: 3px;
}

/* Icône dans carré arrondi coloré */
.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(var(--card-rgb), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  transition: background 0.22s ease;
}
.theme-card:hover .card-icon-wrap { background: rgba(var(--card-rgb), 0.20); }

.card-body    { flex: 1; min-width: 0; }
.card-title   { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.card-desc    {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.card-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--card-color);
  background: rgba(var(--card-rgb), 0.10);
  border: 1px solid rgba(var(--card-rgb), 0.22);
  padding: 5px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Délais d'animation échelonnés */
.theme-card:nth-child(1)  { animation-delay:   0ms; }
.theme-card:nth-child(2)  { animation-delay:  50ms; }
.theme-card:nth-child(3)  { animation-delay: 100ms; }
.theme-card:nth-child(4)  { animation-delay: 150ms; }
.theme-card:nth-child(5)  { animation-delay: 200ms; }
.theme-card:nth-child(6)  { animation-delay: 250ms; }
.theme-card:nth-child(7)  { animation-delay: 300ms; }
.theme-card:nth-child(8)  { animation-delay: 350ms; }
.theme-card:nth-child(9)  { animation-delay: 400ms; }
.theme-card:nth-child(10) { animation-delay: 450ms; }

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

/* ============================================================
   VUE THÈME — EN-TÊTE
   ============================================================ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-full);
  margin-bottom: 20px;
  transition: all var(--t-normal);
}
.back-btn:hover {
  color: var(--c-blue);
  border-color: var(--c-blue);
  background: rgba(32, 58, 106, 0.05);
}

.theme-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 32px;
  background: #fff;
  border: 1.5px solid var(--border-subtle);
  border-top: 5px solid var(--theme-color, var(--c-rose));
  border-radius: var(--r-xl);
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(32, 58, 106, 0.06);
}

/* Halo en coin */
.theme-header::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -5%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(var(--theme-rgb), 0.10) 0%, transparent 70%);
  pointer-events: none;
}

.theme-header-icon { font-size: 52px; line-height: 1; flex-shrink: 0; }
.theme-header-content { flex: 1; }

.theme-header-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.theme-header-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
}

.theme-header-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--theme-color);
  background: rgba(var(--theme-rgb), 0.10);
  border: 1px solid rgba(var(--theme-rgb), 0.22);
  padding: 4px 13px;
  border-radius: var(--r-full);
}

/* ============================================================
   BADGE MEL
   ============================================================ */
.mel-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  background: #efe526;
  color: #1a1600;
  vertical-align: middle;
  margin-left: 7px;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}

/* ============================================================
   LISTE DE PROPOSITIONS — ACCORDÉON
   ============================================================ */
.propositions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prop-card {
  background: #fff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  animation: fadeUp 0.35s ease forwards;
  box-shadow: 0 1px 4px rgba(32, 58, 106, 0.05);
}

.prop-card:nth-child(1) { animation-delay:   0ms; }
.prop-card:nth-child(2) { animation-delay:  60ms; }
.prop-card:nth-child(3) { animation-delay: 120ms; }
.prop-card:nth-child(4) { animation-delay: 180ms; }
.prop-card:nth-child(5) { animation-delay: 240ms; }
.prop-card:nth-child(6) { animation-delay: 300ms; }
.prop-card:nth-child(7) { animation-delay: 360ms; }
.prop-card:nth-child(8) { animation-delay: 420ms; }

.prop-card.open {
  border-color: rgba(var(--theme-rgb), 0.40);
  box-shadow: 0 4px 20px rgba(var(--theme-rgb), 0.10);
}

/* En-tête cliquable */
.prop-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast);
}
.prop-header:hover { background: rgba(var(--theme-rgb), 0.04); }

/* Numéro */
.prop-number {
  font-size: 11px;
  font-weight: 800;
  color: var(--theme-color);
  background: rgba(var(--theme-rgb), 0.12);
  border: 1px solid rgba(var(--theme-rgb), 0.20);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prop-text { flex: 1; min-width: 0; }

.prop-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.prop-card.open .prop-title { color: var(--text-primary); }

.prop-summary { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.prop-chevron {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.28s ease, color var(--t-fast);
}
.prop-card.open .prop-chevron {
  transform: rotate(180deg);
  color: var(--theme-color);
}

/* Corps accordéon */
.prop-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.40s cubic-bezier(0.4, 0, 0.2, 1);
}

.prop-body-inner {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
  background: rgba(var(--theme-rgb), 0.015);
}

.prop-detail {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.85;
  white-space: pre-line;
  margin-bottom: 18px;
}

/* Liens croisés */
.prop-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.related-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  transition: all var(--t-normal);
}
.related-chip:hover {
  background: var(--bg-base);
  border-color: var(--border-light);
  color: var(--text-primary);
}
.related-chip:focus-visible { outline: 2px solid var(--c-rose); outline-offset: 2px; }

/* ============================================================
   EFFET HIGHLIGHT
   ============================================================ */
.prop-card.highlighted {
  animation: pulseHL 1.8s ease forwards;
}
@keyframes pulseHL {
  0%   { box-shadow: 0 0 0 0    rgba(var(--theme-rgb), 0.6); }
  40%  { box-shadow: 0 0 0 10px rgba(var(--theme-rgb), 0.15); }
  100% { box-shadow: 0 4px 20px rgba(var(--theme-rgb), 0.10); }
}

/* ============================================================
   ÉTATS DE CHARGEMENT / ERREUR
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 50vh;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--c-rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 14px; }

.error-state  { text-align: center; padding: 80px 24px; }
.error-icon   { font-size: 48px; margin-bottom: 16px; }
.error-title  { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.error-body   { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.error-hint   {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-family: monospace;
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 80px;
  padding: 24px var(--pad-x);
  background: #fff;
}
.footer-inner    { max-width: var(--max-w); margin: 0 auto; text-align: center; }
.footer-list     { font-size: 14px; font-weight: 700; color: var(--c-blue); margin-bottom: 4px; }
.footer-meta     { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.footer-sep      { opacity: 0.4; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  :root { --pad-x: 16px; }

  .nav-home-btn   { display: none; }
  .nav-inner      { gap: 10px; }

  .home-hero       { padding: 28px 24px 28px 20px; flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-list       { font-size: 20px; }

  .themes-grid  { grid-template-columns: 1fr; gap: 10px; }

  .theme-card      { padding: 16px 18px; gap: 14px; }
  .card-icon-wrap  { width: 44px; height: 44px; font-size: 22px; }

  .theme-header    { flex-direction: column; gap: 12px; padding: 24px; }

  .prop-header     { padding: 14px 16px; }
  .prop-body-inner { padding: 14px 16px 16px; }
}

@media (min-width: 641px) and (max-width: 900px) {
  :root { --pad-x: 24px; }
  .home-hero  { padding: 36px 40px 36px 32px; gap: 32px; }
}
