/* Page « Découvrir les créateurs » — fond, animations, chips, cards, modal.
 *
 * Le rendu interactif (carousel 3D, filtres, modal) est géré par
 * static/js/discover-page.js (île React inline-styles). Cette feuille
 * porte :
 *   - le fond de page + reset minimal (compat avec base.html)
 *   - les @keyframes utilisés par le JS via className
 *   - les chips/inputs en dehors du React (cohérence visuelle au boot)
 *   - les media queries tablette/mobile pour la grille et le coverflow
 */

.zh-discover-page,
.zh-discover-page body {
  background: #0f0722;
  color: #fff;
  overflow-x: hidden;
  max-width: 100%;
}

.zh-discover-shell {
  background: radial-gradient(ellipse at 20% 0%, #4c1d95 0%, transparent 55%),
    radial-gradient(ellipse at 85% 30%, #7c3aed 0%, transparent 50%),
    linear-gradient(180deg, #1a0840 0%, #0f0722 50%, #0a0418 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.zh-discover-shell #zd-root {
  overflow-x: hidden;
  max-width: 100%;
}

[data-discover-coverflow] {
  box-sizing: border-box;
}

/* ─── App shell + hero (template ZIC Discover.html) ─────────────── */
.zd-discover-app {
  position: relative;
  isolation: isolate;
}

.zd-discover-hero {
  position: relative;
  overflow: hidden;
}
.zd-discover-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background: conic-gradient(
    from 210deg at 50% 20%,
    rgba(167, 139, 245, 0.14) 0deg,
    rgba(249, 115, 22, 0.06) 120deg,
    rgba(34, 197, 94, 0.05) 240deg,
    rgba(167, 139, 245, 0.12) 360deg
  );
  animation: zd-hero-mesh 38s linear infinite;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.zd-discover-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: min(900px, 140vw);
  height: min(420px, 80vw);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.22) 0%,
    transparent 68%
  );
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.zd-discover-hero-inner {
  position: relative;
  z-index: 1;
}
.zd-discover-hero-inner > * {
  animation: zd-fadeUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.zd-discover-hero-inner > *:nth-child(1) {
  animation-delay: 0.04s;
}
.zd-discover-hero-inner > *:nth-child(2) {
  animation-delay: 0.1s;
}
.zd-discover-hero-inner > *:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes zd-hero-mesh {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1.04);
  }
}

.zd-discover-coverflow-zone {
  position: relative;
}
.zd-discover-coverflow-zone::before {
  content: "";
  position: absolute;
  inset: 0 0 40%;
  background: radial-gradient(
    ellipse 80% 60% at 50% 100%,
    rgba(109, 40, 217, 0.18),
    transparent 55%
  );
  pointer-events: none;
  z-index: 0;
}
.zd-discover-coverflow-zone > * {
  position: relative;
  z-index: 1;
}

.zd-explore-hint {
  border-radius: 12px;
  padding: 6px 14px 10px;
  transition: background 0.2s, transform 0.2s;
}
.zd-explore-hint:hover {
  background: rgba(255, 255, 255, 0.04);
}
.zd-explore-hint:focus-visible {
  outline: 2px solid rgba(167, 139, 245, 0.85);
  outline-offset: 3px;
}

.zd-discover-content-zone {
  position: relative;
}
.zd-discover-content-inner {
  position: relative;
}

/* Bande « en live » : défilement tactile soigné */
.zd-live-rail {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 245, 0.5) rgba(255, 255, 255, 0.06);
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 2%,
    #000 98%,
    transparent
  );
}
.zd-live-rail > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Grille créateurs — breakpoints (sans inline style) */
.zd-creators-grid-wrap {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.zd-join-strip {
  position: relative;
  overflow: hidden;
}
.zd-join-strip::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.06) 48%,
    transparent 62%
  );
  animation: zd-join-shimmer 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes zd-join-shimmer {
  0%,
  100% {
    transform: translateX(-18%) rotate(8deg);
  }
  50% {
    transform: translateX(18%) rotate(8deg);
  }
}
.zd-join-strip > * {
  position: relative;
  z-index: 1;
}

.zd-load-more:not(:disabled):hover {
  transform: translateY(-1px);
}

/* Forcer la nav transparente sur fond foncé pour ne pas hériter des styles
   de la home (qui peuvent appliquer un fond clair) */
.zh-discover-page .zh-nav {
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.zh-discover-page .zh-nav.zh-nav--scrolled {
  background: rgba(20, 8, 64, 0.94) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* ─── Animations utilisées par le JS via className ───────────────── */
@keyframes zd-fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes zd-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes zd-pulseLive {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}
@keyframes zd-chevronBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(7px);
  }
}
@keyframes zd-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Live dot (rouge pulsant) ──────────────────────────────────── */
.zd-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: zd-pulseLive 1.6s infinite;
  display: inline-block;
}

/* ─── Chips univers (filtre par univers) ────────────────────────── */
.zd-chip-univ {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 100px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  transition: all 0.18s;
  white-space: nowrap;
}
.zd-chip-univ:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.zd-chip-univ.is-active {
  background: #fff;
  color: #1a0a3d;
  border-color: #fff;
  box-shadow: 0 6px 22px rgba(255, 255, 255, 0.2);
}

/* ─── Chips tri ─────────────────────────────────────────────────── */
.zd-sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.15s;
}
.zd-sort-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.zd-sort-chip.is-active {
  background: rgba(167, 139, 245, 0.18);
  border-color: rgba(167, 139, 245, 0.5);
  color: #fff;
}

/* ─── Carte coverflow (centre vs latérales) ─────────────────────── */
.zd-cf-card-shell {
  border-radius: 28px;
  overflow: hidden;
  background: #1c1635;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
  user-select: none;
}
.zd-cf-card-shell.is-center {
  box-shadow: 0 40px 110px rgba(109, 40, 217, 0.55),
    0 0 0 1px rgba(167, 139, 245, 0.35);
}

/* ─── Tile grille créateur ──────────────────────────────────────── */
.zd-creator-tile {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #1c1635;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.zd-creator-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(109, 40, 217, 0.35);
  border-color: rgba(167, 139, 245, 0.4);
}

/* ─── Input recherche ───────────────────────────────────────────── */
.zd-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 13px 16px 13px 46px;
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.zd-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.zd-search-input:focus {
  border-color: rgba(167, 139, 245, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

/* ─── Modal ─────────────────────────────────────────────────────── */
.zd-modal-backdrop {
  animation: zd-fadeIn 0.25s ease;
}
.zd-modal-shell {
  animation: zd-fadeUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─── Boot placeholder (avant montage React) ────────────────────── */
.zd-root {
  position: relative;
  min-height: 60vh;
}
.zd-boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zd-boot-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(167, 139, 245, 0.2);
  border-top-color: #a78bf5;
  animation: zd-spin 0.9s linear infinite;
}

/* ─── Footer (clone de ZIC Landing v2) ──────────────────────────── */
.zd-footer {
  background: #0f0722;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 26px 36px;
}
.zd-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.zd-footer-logo {
  display: flex;
  align-items: center;
  height: 44px;
}
.zd-footer-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
}
.zd-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.zd-footer-links a,
.zd-footer-links button.zic-footer-legal {
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0;
}
.zd-footer-links a:hover,
.zd-footer-links button.zic-footer-legal:hover {
  color: rgba(255, 255, 255, 0.75);
}
.zd-footer-copy {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
}

/* ─── No-script fallback ────────────────────────────────────────── */
.zd-noscript {
  padding: 120px 24px 40px;
  text-align: center;
}
.zd-noscript-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.zd-noscript h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 44px);
  color: #fff;
}
.zd-noscript p {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}
.zd-noscript-hint {
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.45) !important;
}

/* ─── Tablette (≤1024px) ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .zd-footer {
    padding: 22px 24px;
  }
  .zd-creators-grid-wrap {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
}

/* ─── Mobile (≤768px) ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .zd-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .zd-footer-links {
    gap: 16px;
  }
  .zd-search-input {
    padding: 12px 14px 12px 42px;
    font-size: 14px;
  }
  .zd-chip-univ {
    padding: 7px 13px;
    font-size: 12.5px;
  }
  .zd-creators-grid-wrap {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .zd-join-strip::before {
    animation-duration: 12s;
  }
}

/* ─── Petits mobiles (≤420px) ───────────────────────────────────── */
@media (max-width: 420px) {
  .zd-footer {
    padding: 20px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zd-discover-hero::before,
  .zd-discover-hero-inner > *,
  .zd-join-strip::before {
    animation: none !important;
  }
  .zd-discover-hero-inner > * {
    opacity: 1;
    transform: none;
  }
  .zd-live-dot {
    animation: none !important;
  }
}
