/* ==========================================================================
   EventPulse - Theme Material Design (sur base Bootstrap 5)
   ========================================================================== */

:root {
  /* Le theme est uniquement clair : on empeche les navigateurs mobiles
     (Chrome Android "force dark", Safari, etc.) de reinventer les couleurs
     de fond des champs de formulaire et menus, ce qui provoquait un fond
     incoherent dans les resultats de recherche en temps reel du menu. */
  color-scheme: light only;
  --md-primary: #5250c9;
  --md-primary-dark: #3d3ba5;
  --md-primary-light: #eeedff;
  --md-accent: #6254d9;
  --md-accent-dark: #493abd;
  --md-text-primary: #20233d;
  --md-text-secondary: #656b7e;
  --md-divider: #e5e7ef;
  --md-background: #f7f8fc;
  --md-surface: #ffffff;
  --md-success: #4caf50;
  --md-error: #f44336;
  --md-warning: #ff9800;
  --bs-primary: var(--md-primary);
  --bs-primary-rgb: 82, 80, 201;
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background-color: var(--md-background);
  color: var(--md-text-primary);
}

a {
  color: var(--md-primary);
}
a:hover {
  color: var(--md-primary-dark);
}

/* ---- Elevations (Material shadows) ---- */
.elevation-1 { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24); }
.elevation-2 { box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23); }
.elevation-3 { box-shadow: 0 10px 20px rgba(0,0,0,.19), 0 6px 6px rgba(0,0,0,.23); }
.elevation-4 { box-shadow: 0 14px 28px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.22); }

/* ---- App bar / navbar ---- */
.navbar-material {
  background-color: var(--md-primary) !important;
  box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23);
}
.navbar-material .navbar-brand,
.navbar-material .nav-link {
  color: rgba(255,255,255,.92) !important;
  font-weight: 500;
}
.navbar-material .nav-link.active,
.navbar-material .nav-link:hover {
  color: #fff !important;
}

/* ---- Buttons ---- */
.btn-material {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: .03em;
  border: none;
  padding: .55rem 1.4rem;
  transition: box-shadow .2s ease, transform .15s ease;
}
.btn-material.btn-primary,
.btn-material.btn-md-primary {
  background-color: var(--md-primary);
  color: #fff;
}
.btn-material.btn-primary:hover,
.btn-material.btn-md-primary:hover {
  background-color: var(--md-primary-dark);
  box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23);
}
.btn-material.btn-accent {
  background-color: var(--md-accent);
  color: #fff;
}
.btn-material.btn-accent:hover {
  background-color: var(--md-accent-dark);
  box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23);
}
.btn-material.btn-outline-material {
  background: transparent;
  border: 1px solid var(--md-primary);
  color: var(--md-primary);
}
.btn-material:active {
  transform: scale(.98);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transform: scale(0);
  animation: ripple-anim .5s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(2.5); opacity: 0; }
}

/* ---- Cards ---- */
.card-material {
  border: none;
  border-radius: 8px;
  background-color: var(--md-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
  transition: box-shadow .2s ease, transform .2s ease;
  overflow: hidden;
}
.card-material:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,.15), 0 6px 6px rgba(0,0,0,.15);
  transform: translateY(-3px);
}
.card-material .card-img-top {
  height: 180px;
  object-fit: cover;
  background-color: var(--md-primary-light);
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .9rem;
  border-radius: 999px;
  background-color: var(--md-primary-light);
  color: var(--md-primary-dark);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s ease;
}
.chip:hover {
  background-color: var(--md-primary);
  color: #fff;
}
.chip.chip-active {
  background-color: var(--md-primary);
  color: #fff;
}

/* ---- Section headers ---- */
.section-title {
  font-weight: 700;
  letter-spacing: -.01em;
}
.section-subtitle {
  color: var(--md-text-secondary);
}

/* ---- Hero ---- */
.hero-material {
  background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dark) 100%);
  color: #fff;
  border-radius: 0 0 24px 24px;
}

/* ---- FAB ---- */
.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--md-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0,0,0,.19), 0 6px 6px rgba(0,0,0,.23);
  border: none;
  font-size: 1.4rem;
  z-index: 1030;
  transition: transform .15s ease;
}
.fab:hover { transform: scale(1.06); color: #fff; }

/* ---- Forms (Material-ish, on top of Bootstrap floating labels) ---- */
.form-floating > label {
  color: var(--md-text-secondary);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 .2rem rgba(63,81,181,.18);
}

/* ---- Badges ---- */
.badge-status-published { background-color: var(--md-success); }
.badge-status-draft { background-color: var(--md-warning); }
.badge-status-cancelled { background-color: var(--md-error); }

/* ---- Footer (moderne, harmonise sur toutes les pages publiques) ---- */
.footer-material,
.footer-modern {
  background: radial-gradient(ellipse at 15% 0%, #2b2f52 0%, #20233d 55%);
  color: rgba(255,255,255,.7);
}
.footer-material a { color: rgba(255,255,255,.85); }

.footer-modern {
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}
.footer-brand .material-symbols-outlined {
  color: #8f8bf0;
}
.footer-tagline {
  margin-top: .9rem;
  color: rgba(255,255,255,.6);
  max-width: 360px;
  line-height: 1.6;
}
.footer-heading {
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1rem;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.footer-links a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .92rem;
  transition: color .15s ease;
}
.footer-links a:hover,
.footer-links a:focus-visible {
  color: #fff;
}
.footer-divider {
  border-color: rgba(255,255,255,.1);
  margin: 2.5rem 0 1.5rem;
  opacity: 1;
}
.footer-copy {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
}
@media (max-width: 575.98px) {
  .footer-brand { justify-content: center; }
  .footer-tagline { max-width: none; text-align: center; margin-left: auto; margin-right: auto; }
}

/* ---- Tableaux triables (admin) ---- */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover {
  color: var(--md-primary);
}
th.sortable .sort-indicator {
  display: inline-block;
  font-size: .7rem;
  opacity: .35;
  margin-left: .2rem;
}
th.sortable.sort-active .sort-indicator {
  opacity: 1;
  color: var(--md-primary);
}

/* ---- Admin layout ---- */
.admin-sidebar {
  background-color: var(--md-primary);
  min-height: 100vh;
  color: rgba(255,255,255,.9);
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.78);
  border-radius: 4px;
  font-weight: 500;
  padding: .65rem 1rem;
}
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  background-color: rgba(255,255,255,.14);
  color: #fff;
}
.admin-topbar {
  background-color: var(--md-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
}
.stat-card {
  border-radius: 8px;
  padding: 1.25rem;
  color: #fff;
}
.stat-card .material-symbols-outlined {
  font-size: 2.2rem;
  opacity: .85;
}

/* ---- Snackbar / toast ---- */
.toast-material {
  background-color: #323232;
  color: #fff;
  border-radius: 4px;
}

/* ---- Recherche temps reel (menu du haut) ---- */
.nav-search {
  min-width: 200px;
  max-width: 320px;
}
.nav-search input {
  border-radius: 20px;
  border: none;
  padding-left: 1rem;
}
.nav-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--md-surface) !important;
  color: var(--md-text-primary) !important;
  border: 1px solid var(--md-divider);
  border-radius: 12px;
  box-shadow: 0 12px 32px #20233d1a;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1050;
  color-scheme: light only;
  text-align: left;
}
.nav-search-group-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  background-color: var(--md-background) !important;
  color: var(--md-text-primary) !important;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .4rem .9rem;
}
.nav-search-group-title::before {
  content: '';
  flex: 0 0 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--category-color, var(--md-primary));
}
.nav-search-item {
  display: block;
  padding: .5rem .9rem;
  text-decoration: none;
  color: var(--md-text-primary);
  background-color: var(--md-surface);
  border-top: 1px solid var(--md-divider);
}
.nav-search-item:hover,
.nav-search-item:focus-visible {
  background-color: var(--md-primary-light);
  color: var(--md-primary-dark);
}
.nav-search-viewall {
  display: block;
  padding: .6rem .9rem;
  text-align: center;
  font-weight: 600;
  color: var(--md-primary);
  background-color: var(--md-surface);
  text-decoration: none;
  border-top: 1px solid var(--md-divider);
}
.nav-search-viewall:hover,
.nav-search-viewall:focus-visible {
  background-color: var(--md-primary-light);
  color: var(--md-primary-dark);
}

/* ---- Documentation ---- */
.doc-hero {
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-divider);
  padding: 2.75rem 0;
}
.doc-sidebar {
  padding: .6rem;
  border-radius: 16px;
  background: var(--md-surface);
  border: 1px solid var(--md-divider);
}
.doc-sidebar .list-group-item {
  border: none;
  border-radius: 10px !important;
  margin-bottom: .2rem;
  padding: .7rem 1rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--md-text-secondary);
  display: flex;
  align-items: center;
  gap: .65rem;
  background: transparent;
  transition: background-color .15s ease, color .15s ease;
}
.doc-sidebar .list-group-item .material-symbols-outlined {
  font-size: 1.15rem;
  color: var(--md-text-secondary);
  transition: color .15s ease;
}
.doc-sidebar .list-group-item:hover {
  background: var(--md-background);
  color: var(--md-text-primary);
}
.doc-sidebar .list-group-item.active {
  background: var(--md-primary-light);
  color: var(--md-primary-dark);
  font-weight: 700;
}
.doc-sidebar .list-group-item.active .material-symbols-outlined {
  color: var(--md-primary);
}
.doc-card {
  border: 1px solid var(--md-divider);
}
.doc-card h2 {
  font-size: 1.05rem;
}
.doc-card ol, .doc-card ul {
  padding-left: 1.25rem;
}
.doc-card li + li {
  margin-top: .4rem;
}
.doc-card code {
  background: var(--md-background);
  padding: .15rem .4rem;
  border-radius: 6px;
  font-size: .85em;
}

/* ---- Language switcher ---- */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
}
.lang-switcher .lang-btn {
  background: none;
  border: none;
  padding: 0 .1rem;
  color: inherit;
  opacity: .6;
  cursor: pointer;
}
.lang-switcher .lang-btn.active {
  opacity: 1;
  text-decoration: underline;
}
.lang-switcher .lang-sep {
  opacity: .5;
}

/* ---- Utilities ---- */
.text-primary-material { color: var(--md-primary); }
.bg-primary-material { background-color: var(--md-primary); }
.cursor-pointer { cursor: pointer; }

/* ---- Responsive tweaks ---- */
@media (max-width: 767.98px) {
  .hero-material h1 { font-size: 1.8rem; }
  .card-material .card-img-top { height: 150px; }
}

/* Modern shared interface */
body { line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .navbar-brand { letter-spacing: -.035em; }
.navbar-material { background: #fff !important; border-bottom: 1px solid var(--md-divider); box-shadow: 0 4px 24px #20233d05; padding-block: 1rem; }
/* La navbar doit toujours passer au-dessus des autres elements "sticky-top"
   de la page (ex. la carte d'inscription sur evenement-detail.html) : sans
   cela, a z-index Bootstrap egal (1020), l'element le plus bas dans le DOM
   gagne l'egalite et peut recouvrir le menu deroulant "Comptes". */
.navbar-material.sticky-top { z-index: 1035; }
.navbar-material .dropdown-menu { z-index: 1040; }
/* Contenir les elements sticky du detail sous la navigation et ses menus. */
body[data-page="event-detail"] > main { position: relative; z-index: 0; }
.navbar-material .navbar-brand { color: var(--md-text-primary) !important; font-size: 1.35rem; }
.navbar-brand > .material-symbols-outlined { color: var(--md-primary); }
.navbar-material .nav-link { color: #555a70 !important; font-size: .875rem; border-radius: 8px; }
.navbar-material .nav-link.active, .navbar-material .nav-link:hover { color: var(--md-primary) !important; background: #f0effc; }
.navbar-material .navbar-toggler { filter: none !important; border-color: var(--md-divider); }
.nav-search input { background: var(--md-background); border: 1px solid var(--md-divider); }
.btn-material { border-radius: 10px; text-transform: none; letter-spacing: 0; font-weight: 600; padding: .75rem 1.2rem; }
.btn-material:hover { box-shadow: 0 6px 16px #5250c921; }
.card-material { border: 1px solid var(--md-divider); border-radius: 18px; box-shadow: 0 4px 16px #20233d04; }
.card-material:hover { box-shadow: 0 12px 30px #20233d0d; transform: none; }
.event-card:hover { transform: translateY(-4px); }
.card-material .card-body { padding: 1.5rem; }
.card-material .card-img-top { height: 210px; }
.event-cover { height: 210px; background: linear-gradient(135deg, #e4defb, #d6edf0); display: grid; place-items: center; }
.event-cover > span { color: #5250c9; font-size: 4rem; }
.event-card .card-title { font-size: 1.2rem; line-height: 1.4; }
.event-card-carousel { height: 210px; overflow: hidden; }
.event-card-carousel .carousel-inner,
.event-card-carousel .carousel-item { height: 100%; }
.event-card-carousel .carousel-item img { height: 100%; width: 100%; object-fit: cover; }
.event-card-carousel .carousel-control-prev,
.event-card-carousel .carousel-control-next { width: 15%; opacity: 0; transition: opacity .15s ease; }
.event-card-carousel:hover .carousel-control-prev,
.event-card-carousel:hover .carousel-control-next { opacity: 1; }
.event-card-carousel .carousel-control-prev-icon,
.event-card-carousel .carousel-control-next-icon { width: 1.5rem; height: 1.5rem; }
.event-card-carousel .carousel-indicators { margin-bottom: .4rem; }
.event-card-carousel .carousel-indicators [data-bs-target] { width: 6px; height: 6px; border-radius: 50%; }
@media (max-width: 767.98px) {
  .event-card-carousel { height: 150px; }
}
.chip { padding: .6rem 1rem; font-weight: 500; border: 1px solid #20233d0a; }
.form-control, .form-select { border-radius: 10px; border-color: #dce0eb; }
.form-control:focus, .form-select:focus { border-color: var(--md-primary); box-shadow: 0 0 0 .2rem #5250c920; }
.dropdown-menu, .modal-content { border: 1px solid var(--md-divider); border-radius: 14px; box-shadow: 0 12px 40px #20233d12; }
/* Certaines modales (evenement, categorie) placent tout leur contenu dans un
   <form> qui englobe le header/body/footer. Bootstrap attend que ces trois
   sections soient des enfants directs de .modal-content (flexbox en colonne)
   pour contraindre la hauteur et faire defiler .modal-body ; le <form>, bloc
   non flex, casse ce calcul et pousse le pied de modale hors de l'ecran.
   display:contents retire sa boite tout en gardant son comportement (submit,
   FormData, etc.) intact. */
.modal-content > form { display: contents; }
.dropdown-item { padding: .6rem 1.2rem; }
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--md-divider); }
.table > :not(caption) > * > * { padding: 1rem; }
.table thead th { color: var(--md-text-secondary); font-size: .8rem; font-weight: 600; background: #f7f8fc; }
.admin-sidebar { background: #22243f; }
.admin-sidebar .nav-link { border-radius: 10px; }
.admin-sidebar .nav-link.active { background: #5250c9; }
.admin-sidebar + .flex-grow-1 { min-width: 0; }
.admin-topbar { border-bottom: 1px solid var(--md-divider); box-shadow: none; gap: 1rem; flex-wrap: wrap; }
.stat-card { border-radius: 16px; padding: 1.5rem; box-shadow: none; }
.footer-material,
.footer-modern { background: radial-gradient(ellipse at 15% 0%, #2b2f52 0%, #20233d 55%); }
.toast-material { border-radius: 12px; }
:focus-visible { outline: 3px solid #7770e0; outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 3000; padding: .75rem 1.2rem; background: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.discovery-hero { padding: 5rem 0 4rem; background: radial-gradient(ellipse at 90% 25%, #e9e4fc, transparent 55%), #f4f3fb; border-bottom: 1px solid #e8e5f3; }
.eyebrow { color: var(--md-primary); text-transform: uppercase; font-size: .72rem; font-weight: 700; letter-spacing: .13em; margin-bottom: 1rem; }
.hero-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7770e0; margin-right: 6px; }
.discovery-hero h1 { font-size: clamp(2.75rem, 5.1vw, 4.8rem); line-height: 1.08; font-weight: 700; margin-bottom: 1.5rem; }
.discovery-hero h1 em { color: var(--md-primary); font-style: normal; }
.hero-description { max-width: 510px; color: var(--md-text-secondary); font-size: 1.075rem; }
.hero-search { display: flex; align-items: center; gap: .8rem; padding: .6rem; padding-left: 1rem; margin-top: 2rem; background: white; border: 1px solid #e2dfef; border-radius: 14px; box-shadow: 0 8px 30px #20233d06; }
.hero-search > span { color: var(--md-primary); }
.hero-search input { width: 100%; min-width: 0; border: 0; background: transparent; padding: .6rem 0; font-size: .9rem; }
.hero-search .btn { flex-shrink: 0; }
.hero-hint { color: var(--md-text-secondary); font-size: .78rem; margin-top: .8rem; }
.hero-art { position: relative; height: 420px; display: grid; place-items: center; isolation: isolate; }
.orbit { position: absolute; border: 1px solid #d4cdec; border-radius: 50%; width: 360px; height: 360px; z-index: -1; }
.orbit-two { width: 280px; height: 280px; }
.art-spark { position: absolute; top: 0; right: 8%; font-size: 5rem; color: #a194dc; }
.experience-ticket { width: 275px; background: #fff; padding: 1.4rem; border-radius: 20px; transform: rotate(-8deg); box-shadow: 10px 20px 50px #42378620; }
.ticket-top { display: flex; justify-content: space-between; align-items: center; font-size: .65rem; font-weight: 700; letter-spacing: .15em; }
.ticket-visual { height: 155px; margin: 1rem 0; border-radius: 12px; display: grid; place-items: center; background: #5550c7; overflow: hidden; }
.soundwave { display: flex; gap: 7px; align-items: center; transform: rotate(12deg); }
.soundwave i { display: block; width: 12px; height: 50px; border-radius: 20px; background: #c9c1ff; }
.soundwave i:nth-child(2n) { height: 85px; background: #e2ddff; }
.soundwave i:nth-child(3n) { height: 115px; }
.soundwave i:nth-child(5) { height: 140px; background: #c4efce; }
.ticket-caption { font-size: .6rem; letter-spacing: .13em; color: #656b7e; margin-bottom: .4rem; }
.ticket-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -.05em; margin-bottom: 1rem; }
.ticket-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 2px dashed #e5e7ef; padding-top: 1rem; font-size: .7rem; color: #656b7e; }
.ticket-bottom strong { color: #20233d; }
.art-note { position: absolute; bottom: 14px; right: 0; display: flex; align-items: center; gap: .6rem; border: 1px solid #e2dfef; border-radius: 12px; padding: .8rem 1.1rem; background: white; box-shadow: 0 8px 24px #20233d08; font-size: .85rem; }
.art-note > span { color: var(--md-primary); }
.discovery-section { padding-top: 3.5rem; }
.section-title { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.section-link { font-weight: 600; font-size: .9rem; text-decoration: none; }
.organizer-banner { margin-top: 4rem; padding: 2.5rem; background: #eeedfa; border: 1px solid #e2dff3; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.organizer-banner h2 { font-size: 1.65rem; font-weight: 700; }
.organizer-banner .btn { flex-shrink: 0; }
.organizer-banner p:not(.eyebrow) { color: var(--md-text-secondary); }
.empty-state { padding: 2.5rem; text-align: center; border: 1px dashed #d5d7e4; border-radius: 16px; background: #fff; color: var(--md-text-secondary); }
.empty-state > .material-symbols-outlined { font-size: 2.5rem; color: var(--md-primary); margin-bottom: .75rem; }
@media (min-width: 992px) and (max-width: 1399.98px) {
  .navbar-material > .container { flex-wrap: wrap; }
  .navbar-material .navbar-collapse { flex-basis: 100%; margin-top: .6rem; }
  .navbar-material .navbar-nav { margin-left: 0 !important; width: 100%; justify-content: space-between; }
}
@media (max-width: 991.98px) {
  .discovery-hero { padding: 3rem 0; }
  .hero-art { height: 380px; max-width: 420px; margin: auto; }
  .navbar-material .navbar-collapse { padding-top: 1rem; }
  .organizer-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767.98px) {
  body > .d-flex:has(> .admin-sidebar) { flex-direction: column; }
  .admin-sidebar { width: 100% !important; min-height: auto; }
  .admin-sidebar .nav { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .5rem; }
  .admin-sidebar .nav-link { white-space: nowrap; }
  .discovery-section { padding-top: 2.5rem; }
  .organizer-banner { padding: 1.5rem; }
  .organizer-banner .btn { white-space: normal; }
}
@media (max-width: 479.98px) {
  .navbar-material .nav-search { order: 3 !important; min-width: 100% !important; margin: .75rem 0 0 !important; }
  .hero-search { flex-wrap: wrap; }
  .hero-search input { flex: 1; }
  .hero-search .btn { width: 100%; }
  .orbit { width: 280px; height: 280px; }
  .hero-art { height: 380px; }
  .art-note { right: 0; bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Billet (page publique + impression) ---- */
.ticket-card {
  border: 2px dashed var(--md-primary);
}
.ticket-field-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--md-on-surface-variant, #6b6f80);
}
.ticket-qr-image {
  max-width: 240px;
  width: 100%;
  height: auto;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  padding: .5rem;
  background: #fff;
}
.ticket-print-brand {
  border-bottom: 1px solid #ddd;
  padding-bottom: 1rem;
}
.ticket-print-brand .material-symbols-outlined {
  color: var(--md-primary);
}
@media print {
  body * { visibility: hidden; }
  #ticket-card, #ticket-card * { visibility: visible; }
  #ticket-card { position: absolute; top: 0; left: 0; width: 100%; border: 2px solid #000; }
}

/* ---- Scanner (organisateur / admin) ---- */
.scanner-video-wrapper {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.scanner-video-wrapper video {
  width: 100%;
  display: block;
}
.scanner-result-card {
  border-left: 6px solid var(--md-success);
}
.scanner-result-card.is-error {
  border-left-color: var(--md-error);
}

/* ---- Tableau de bord admin (modernise) ---- */
.dashboard-hero {
  background: linear-gradient(135deg, #4b4fd1 0%, #6a4fd6 100%);
  border-radius: 20px;
  color: #fff;
  padding: 2rem 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.dashboard-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: rgba(255,255,255,.7);
  margin-bottom: .35rem;
}
.dashboard-hero h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.dashboard-hero p { color: rgba(255,255,255,.82); margin-bottom: 0; }
.dashboard-hero .btn-glass {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  white-space: nowrap;
}
.dashboard-hero .btn-glass:hover { background: rgba(255,255,255,.28); color: #fff; }

.kpi-card {
  background: var(--md-surface);
  border: 1px solid var(--md-divider);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20,20,50,.08); }
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.kpi-icon .material-symbols-outlined { font-size: 1.4rem; }
.kpi-label { font-size: .8rem; color: var(--md-text-secondary); margin-bottom: .15rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }

.dashboard-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.dashboard-card-title .material-symbols-outlined { color: var(--md-primary); }

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--md-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .82rem;
  flex-shrink: 0;
}
.rank-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--md-background);
  border: 1px solid var(--md-divider);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  color: var(--md-text-secondary);
}
.rank-badge.rank-1 { background: #fff4d6; border-color: #f4d998; color: #92700c; }

.empty-state-mini {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--md-text-secondary);
}
.empty-state-mini .material-symbols-outlined { font-size: 2rem; opacity: .5; display: block; margin-bottom: .4rem; }

@media (max-width: 767.98px) {
  .dashboard-hero { padding: 1.5rem; }
}

/* ---- Autocomplétion (champ lieu) ---- */
.autocomplete-wrapper {
  position: relative;
}
.autocomplete-suggestions {
  position: absolute;
  z-index: 1050;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: .25rem;
  background: var(--md-surface);
  border: 1px solid var(--md-divider);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(20,20,50,.12);
  max-height: 260px;
  overflow-y: auto;
}
.autocomplete-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .55rem .9rem;
  background: none;
  border: none;
  font-size: .9rem;
  color: var(--md-text-primary, #1a1a2e);
}
.autocomplete-suggestions button:hover,
.autocomplete-suggestions button.is-active {
  background: var(--md-background);
}
.autocomplete-suggestions .autocomplete-empty {
  padding: .55rem .9rem;
  color: var(--md-text-secondary);
  font-size: .85rem;
}

/* ---- Zone de depot (medias) ---- */
.media-dropzone {
  border: 2px dashed var(--md-divider);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--md-text-secondary);
  transition: border-color .15s ease, background-color .15s ease;
}
.media-dropzone.is-dragover {
  border-color: var(--md-primary);
  background-color: rgba(63,81,181,.06);
}

/* ---- Galerie media (zoomable + diaporama) ---- */
.media-gallery-item {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.media-gallery-item img,
.media-gallery-item video {
  transition: transform .2s ease;
}
.media-gallery-item:hover img,
.media-gallery-item:hover video {
  transform: scale(1.04);
}


.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(10,10,20,.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-btn {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-btn:hover { background: rgba(255,255,255,.24); }
.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.75);
  font-size: .85rem;
}
@media (max-width: 575.98px) {
  .lightbox-prev { left: .5rem; width: 40px; height: 40px; }
  .lightbox-next { right: .5rem; width: 40px; height: 40px; }
  .lightbox-close { top: .5rem; right: .5rem; width: 40px; height: 40px; }
}

/* ---- Programme de l'evenement (timeline, menu, artistes) ---- */
.program-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--md-background);
}
.program-section-title .material-symbols-outlined {
  color: var(--md-primary);
}

.program-timeline {
  position: relative;
  padding-left: 2rem;
}
.program-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--md-divider);
}
.program-timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.program-timeline-item:last-child { padding-bottom: 0; }
.program-timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--md-primary);
  border: 3px solid var(--md-surface);
  box-shadow: 0 0 0 2px var(--md-primary);
}
.program-timeline-time {
  font-weight: 700;
  color: var(--md-primary);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .15rem;
}

.menu-item-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--md-background);
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
}
.menu-item-card .material-symbols-outlined {
  color: var(--md-primary);
  flex-shrink: 0;
}

.artist-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  height: 100%;
}
.artist-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--md-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Selecteur d'image de couverture (parmi les medias deja ajoutes) ---- */
.image-picker-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid transparent;
}
.image-picker-thumb img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}
.image-picker-thumb.is-selected {
  border-color: var(--md-primary);
}
.image-picker-thumb.is-selected::after {
  content: 'check_circle';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  top: 2px;
  right: 2px;
  color: var(--md-primary);
  background: #fff;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}

/* Le visuel lui-meme est le bouton de zoom, sans icone ajoutee. */
.media-image-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: inherit; cursor: zoom-in; }
.media-image-button img { display: block; }
.media-image-button:focus-visible { outline: 3px solid var(--md-primary); outline-offset: 4px; }
.lightbox-btn[hidden] { display: none; }
