/* ============================================
   Boomboom Movie v2 — feuille de style
   Même ADN visuel que la v1 (violet premium / verre dépoli),
   remise au service d'un seul flux : recherche → fiche → demande/lecture.
   ============================================ */

:root {
  --accent: #8B5CF6;
  --accent-hover: #A78BFA;
  --accent-deep: #6D28D9;
  --accent-glow: rgba(139, 92, 246, .4);
  --accent-soft: rgba(139, 92, 246, .14);

  --bg-deep: #07070C;
  --bg: #0C0C14;
  --bg-card: rgba(255, 255, 255, .04);
  --bg-card-hover: rgba(255, 255, 255, .07);
  --bg-glass: rgba(18, 18, 28, .65);
  --bg-input: rgba(255, 255, 255, .06);

  --border: rgba(255, 255, 255, .06);
  --border-hover: rgba(255, 255, 255, .14);

  --text: #f0ece4;
  --text-secondary: #8e8b83;
  --text-muted: #4e4c47;
  --text-bright: #fff;

  --green: #4ade80;
  --amber: #eab308;
  --red: #e05555;

  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; outline: none; border: none; color: inherit; background: none; }
[hidden] { display: none !important; }

/* ---------- Ambient glow ---------- */
.glow {
  position: fixed; border-radius: 50%; pointer-events: none; filter: blur(60px); z-index: 0;
}
.glow-1 { top: -220px; left: -160px; width: 620px; height: 620px; background: radial-gradient(circle, rgba(139,92,246,.28), transparent 70%); }
.glow-2 { bottom: -260px; right: -180px; width: 680px; height: 680px; background: radial-gradient(circle, rgba(109,40,217,.24), transparent 70%); }

/* ---------- Home / search hero ---------- */
.home {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px; padding: 90px 24px 60px; text-align: center; z-index: 1;
}
.wordmark { font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; }
.wordmark b { color: var(--text-bright); font-weight: 800; }
.wordmark span { color: var(--accent); }
.tagline { max-width: 460px; font-size: 1.1rem; color: var(--text-secondary); }

.search-shell {
  width: 660px; max-width: 90vw; display: flex; align-items: center; gap: 14px;
  background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover); border-radius: 100px; padding: 16px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); transition: border-color .2s var(--ease);
}
.search-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 20px 60px rgba(0,0,0,.45); }
.search-shell svg { flex: 0 0 auto; color: var(--text-secondary); }
.search-shell input { flex: 1; font-size: 1.05rem; color: var(--text); }
.search-shell input::placeholder { color: var(--text-muted); }
.search-hint { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }

.corner-note {
  position: relative; z-index: 2; width: 300px; max-width: 90vw; margin: 2px auto 0;
  background: var(--bg-card); border: 1px dashed var(--border-hover); border-radius: 3px;
  padding: 16px 16px 14px; text-align: left; transform: rotate(-1.5deg);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
  animation: note-in .5s var(--ease) both;
}
.corner-note:hover { transform: rotate(0deg); border-color: var(--accent-glow); }
.corner-note::before {
  content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 3px 8px var(--accent-glow);
  animation: pin-pulse 1.4s ease-out 1s 3;
}
@keyframes note-in {
  from { opacity: 0; transform: rotate(-1.5deg) translateY(-8px) scale(.96); }
  to { opacity: 1; transform: rotate(-1.5deg) translateY(0) scale(1); }
}
@keyframes pin-pulse {
  0% { box-shadow: 0 3px 8px var(--accent-glow), 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 3px 8px var(--accent-glow), 0 0 0 9px rgba(139,92,246,0); }
  100% { box-shadow: 0 3px 8px var(--accent-glow), 0 0 0 0 rgba(139,92,246,0); }
}
@media (prefers-reduced-motion: reduce) {
  .corner-note, .corner-note::before { animation: none; }
}
.corner-note-close {
  position: absolute; top: 4px; right: 8px; font-size: 1.05rem; line-height: 1; color: var(--text-muted);
}
.corner-note-close:hover { color: var(--text-secondary); }
.corner-note-brand { display: block; margin-bottom: 10px; }
.corner-note-logo { height: 18px; width: auto; display: block; opacity: .9; }
.corner-note-text { margin: 0 0 8px; font-size: .74rem; line-height: 1.5; color: var(--text-secondary); }
.corner-note-text a { color: var(--accent); font-weight: 600; }
.corner-note-text a:hover { color: var(--accent-hover); }
.corner-note-sub { margin: 0; font-size: .66rem; line-height: 1.45; color: var(--text-muted); }
.corner-note-sub a { color: var(--text-secondary); }
.corner-note-sub a:hover { color: var(--accent-hover); }

.ready-section { width: 100%; max-width: 900px; margin-top: 8px; }
.ready-title { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; text-align: left; }
.ready-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.ready-card { flex: 0 0 120px; width: 120px; min-width: 0; cursor: pointer; text-align: left; }
.ready-card .poster { aspect-ratio: 2/3; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.ready-card:hover .poster { transform: translateY(-3px); }
.ready-card .card-title { font-size: .8rem; margin-top: 8px; }
.ready-ttl { display: flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--amber); margin-top: 2px; }

.home-footer {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; font-size: .72rem; color: var(--text-muted); z-index: 1;
}
.home-footer a { color: var(--text-muted); }
.home-footer a:hover { color: var(--text-secondary); }

/* ---------- Top bar (results / detail) ---------- */
.topbar { display: flex; align-items: center; gap: 24px; padding: 22px 40px 0; }
.topbar .wordmark { font-size: 1.05rem; white-space: nowrap; }
.topbar-search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-glass); border: 1px solid var(--border-hover); border-radius: 100px; padding: 12px 18px;
}
.topbar-search input { flex: 1; font-size: .92rem; }
.topbar-search svg { flex: 0 0 auto; color: var(--text-secondary); }
.topbar-search .clear-btn { display: flex; color: var(--text-muted); }
.topbar-search .clear-btn:hover { color: var(--text); }

/* ---------- Results grid ---------- */
.results-wrap { padding: 26px 40px 60px; position: relative; z-index: 1; }
.results-count { font-size: .9rem; color: var(--text-secondary); margin-bottom: 18px; }
.results-count b { color: var(--text-bright); font-weight: 600; }
.results-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px;
}
.rcard { cursor: pointer; }
.poster {
  position: relative; width: 100%; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .25s var(--ease);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard:hover .poster { transform: translateY(-4px); }
.poster-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2rem; color: rgba(255,255,255,.35); }
.scrim { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
  background: linear-gradient(transparent 38%, rgba(7,7,12,.86) 74%, rgba(7,7,12,.97) 100%); }
.badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 100px; font-size: .64rem; font-weight: 700; white-space: nowrap; }
.badge-avail { background: rgba(74,222,128,.14); color: var(--green); border: 1px solid rgba(74,222,128,.3); }
.badge-add { background: rgba(139,92,246,.14); color: var(--accent-hover); border: 1px solid rgba(139,92,246,.35); }
.card-title { font-weight: 700; font-size: .86rem; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-secondary); margin-top: 3px; }
.rating { display: flex; align-items: center; gap: 3px; color: var(--green); font-weight: 700; }
.no-results { text-align: center; padding: 100px 20px; color: var(--text-muted); }

/* ---------- Detail ---------- */
.detail-hero { position: relative; width: 100%; height: 46vh; min-height: 340px; max-height: 460px; overflow: hidden; background: linear-gradient(135deg,#2a1a4d,#6d28d9 55%,#3b2470); z-index: 1; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%); }
.detail-hero-scrim { position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: linear-gradient(transparent, var(--bg-deep)); }
.back-btn {
  position: absolute; top: 22px; left: 28px; width: 40px; height: 40px; border-radius: 50%; z-index: 2;
  background: var(--bg-glass); backdrop-filter: blur(10px); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.back-btn:hover { background: rgba(255,255,255,.1); }
.detail-hero-info { position: absolute; left: 48px; right: 48px; bottom: 28px; z-index: 2; }
.detail-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; color: var(--text-bright); margin-bottom: 14px; }
.detail-meta { display: flex; align-items: center; gap: 14px; font-size: .92rem; color: var(--text-secondary); flex-wrap: wrap; }
.detail-meta .rating { font-size: .95rem; }
.pill { padding: 3px 10px; border: 1px solid var(--border-hover); border-radius: 100px; font-size: .75rem; }

.detail-body { display: grid; grid-template-columns: 1.8fr 1fr; gap: 44px; padding: 34px 48px 60px; position: relative; z-index: 1; }
.detail-body p.overview { font-size: .96rem; line-height: 1.75; color: var(--text-secondary); max-width: 620px; }

.avail-title { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.platform-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-hover); border-radius: 100px; color: var(--text);
  font-size: .92rem; font-weight: 600; margin-bottom: 10px; transition: background .15s;
}
.platform-btn:hover { background: rgba(255,255,255,.09); color: var(--text); }

.request-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.request-panel label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.field { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px; font-size: .88rem; margin-bottom: 12px; transition: border-color .15s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field::placeholder { color: var(--text-muted); }
.btn-primary {
  width: 100%; padding: 14px; background: var(--accent); color: var(--bg-deep); font-size: .92rem; font-weight: 700;
  border-radius: var(--radius-sm); transition: all .15s var(--ease);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 0 30px var(--accent-glow); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.request-note { font-size: .82rem; color: var(--text-secondary); margin-top: 12px; }
.already-status { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(234,179,8,.1); border: 1px solid rgba(234,179,8,.25); color: var(--amber); font-size: .88rem; }

/* ---------- Épisodes (séries) ---------- */
.ep-season-label { font-size: .82rem; font-weight: 700; color: var(--text-secondary); margin: 16px 0 8px; }
.ep-season-label:first-child { margin-top: 0; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.ep-btn {
  padding: 10px 6px; text-align: center; background: rgba(255,255,255,.05); border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm); color: var(--text); font-size: .82rem; font-weight: 600; transition: background .15s;
}
.ep-btn:hover { background: var(--accent); color: var(--bg-deep); }

/* ---------- Confirmation modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 100; display: flex; align-items: center; justify-content: center;
  pointer-events: none; transition: background .25s var(--ease);
}
.modal-overlay.active { background: rgba(0,0,0,.65); backdrop-filter: blur(6px); pointer-events: auto; }
.confirm-card {
  width: 460px; max-width: 90vw; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 40px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55); text-align: center; transform: translateY(20px) scale(.97); opacity: 0; transition: all .3s var(--ease);
}
.modal-overlay.active .confirm-card { transform: translateY(0) scale(1); opacity: 1; }
.confirm-check { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; }
.confirm-title { font-size: 1.4rem; font-weight: 800; color: var(--text-bright); margin-bottom: 8px; }
.confirm-sub { font-size: .92rem; color: var(--text-secondary); margin-bottom: 28px; }
.confirm-row { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; text-align: left; margin-bottom: 16px; }
.confirm-poster { width: 44px; min-width: 44px; height: 66px; border-radius: 6px; background: var(--bg-card); overflow: hidden; }
.confirm-poster img { width: 100%; height: 100%; object-fit: cover; }
.confirm-info { flex: 1; min-width: 0; }
.confirm-info .t { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.confirm-info .m { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.status-pill { padding: 5px 14px; border-radius: 100px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status-pending { background: rgba(234,179,8,.12); color: var(--amber); border: 1px solid rgba(234,179,8,.25); }
.status-ready { background: rgba(74,222,128,.12); color: var(--green); border: 1px solid rgba(74,222,128,.25); }
.confirm-email-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .8rem; color: var(--text-secondary); margin-bottom: 26px; }

/* ---------- Player ---------- */
.player-page { position: fixed; inset: 0; background: #000; z-index: 500; }
.player-page video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-topbar {
  position: absolute; top: 0; left: 0; right: 0; padding: 26px 36px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,.6), transparent); z-index: 2;
}
.player-title { font-size: 1rem; font-weight: 700; color: var(--text-bright); }
.ttl-badge { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 100px;
  background: rgba(234,179,8,.14); border: 1px solid rgba(234,179,8,.3); color: var(--amber); font-size: .78rem; font-weight: 700; }
.ttl-badge.ok { background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.3); color: var(--green); }
.ttl-badge.crit { background: rgba(224,85,85,.14); border-color: rgba(224,85,85,.3); color: var(--red); }
.lang-badge { display: flex; align-items: center; padding: 6px 12px; border-radius: 100px;
  background: rgba(255,255,255,.08); border: 1px solid var(--border); color: var(--text-secondary); font-size: .78rem; font-weight: 700; }
.player-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: var(--text-secondary); text-align: center; padding: 24px; }

/* ---------- Loader ---------- */
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail-body { grid-template-columns: 1fr; padding: 28px 22px 50px; }
  .detail-hero-info { left: 22px; right: 22px; }
  .detail-title { font-size: 1.6rem; }
  .topbar { padding: 18px 20px 0; flex-wrap: wrap; }
  .results-wrap { padding: 20px 20px 50px; }
}
@media (max-width: 600px) {
  .search-shell { padding: 14px 20px; }
  .home { padding: 70px 18px 40px; gap: 20px; }
  .tagline { font-size: 1rem; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .home-footer { flex-direction: column; gap: 6px; text-align: center; padding: 16px; }
  .corner-note { width: 100%; max-width: 300px; }
}
