/* =============================================================================
 * Landing ZIC Live — popup « Passer en live » (portage admin) + section home.
 *
 * 1) Tokens : le CSS admin consomme les variables --aw-* (shell workspace) et
 *    --zd-* (dashboard) qui n'existent pas côté landing — on les définit sur
 *    l'overlay avec les valeurs admin (admin-workspace.css / admin-dashboard.css).
 * 2) Corps : copie VERBATIM de zic_admin_python/.../admin-ziclive.css, à une
 *    exception près — la règle globale `[hidden]{display:none!important}`
 *    (l.102 admin) est SCOPÉE à l'overlay, sinon elle écrase tous les
 *    `[hidden]` de la home.
 * 3) Couche overlay : wrapper popup calqué sur landing-multipost-overlay.css
 *    (backdrop, carte, close, mobile full-screen), z-index 1500 (palier
 *    multishop/multiproducer, sous l'auth-modal 9999 — voulu : le gate invité
 *    ouvre l'auth-modal PAR-DESSUS le popup).
 * 4) Section home : cartes réelles cliquables (hydratation
 *    landing-ziclive-section.js) — <a> + thumbnail <img>.
 * ============================================================================= */

.zh-zl-overlay {
  --aw-text: #1f1340;
  --aw-muted: rgba(31, 19, 64, 0.55);
  --aw-border: rgba(31, 19, 64, 0.08);
  --aw-purple: #6d28d9;
  --aw-purple-dk: #4c1d95;
  --zd-card-bg: #fff;
  --zd-text: #2b3674;
  --zd-purple: #7c3aed;
  --zd-purple-dark: #5b21b6;
  --zd-purple-soft: rgba(124, 58, 237, 0.08);
  --zd-pink: #ec4899;
  --zd-green: #10b981;
  --zd-red: #ef4444;
  --zd-shadow-sm: 0 1px 2px rgba(31, 19, 64, 0.06);
}

/* ==========================================================================
   ZIC Live — espace créateur (copie admin-ziclive.css, préfixe .zl-*)
   ========================================================================== */

.zl-root {
  --zl-gap: 18px;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--zd-text, #2b3674);
  max-width: 1200px;
  margin: 0 auto;
}

.zl-h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--aw-text, #1f1340);
  margin: 0 0 2px;
  display: flex; align-items: center; gap: 8px;
}
.zl-sub { font-size: 13px; color: var(--aw-muted, rgba(31,19,64,.55)); margin: 0 0 18px; }
.zl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--zd-red, #ef4444); display: inline-block; }

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.zl-tabs {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--aw-border, rgba(31,19,64,.08));
  padding-bottom: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.zl-tab {
  padding: 9px 14px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 13.5px;
  color: var(--aw-muted, rgba(31,19,64,.55)); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.zl-tab:hover { color: var(--aw-text, #1f1340); }
.zl-tab.is-active { color: var(--aw-purple, #6d28d9); border-bottom-color: var(--aw-purple, #6d28d9); }

.zl-panel[hidden] { display: none; }

/* ── Cartes / champs partagés ────────────────────────────────────────────── */
.zl-card {
  background: var(--zd-card-bg, #fff);
  border: 1px solid var(--aw-border, rgba(31,19,64,.08));
  border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--zd-shadow-sm, 0 1px 2px rgba(31,19,64,.06));
}
.zl-card + .zl-card { margin-top: var(--zl-gap); }
.zl-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--aw-muted); margin-bottom: 8px; display: block; }
.zl-input, .zl-select {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--aw-border); border-radius: 10px; background: #fff; color: var(--zd-text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.zl-input:focus, .zl-select:focus { border-color: var(--aw-purple); box-shadow: 0 0 0 3px var(--zd-purple-soft, rgba(124,58,237,.08)); }
.zl-input:disabled, .zl-select:disabled { background: #f4f3fb; color: var(--aw-muted); cursor: not-allowed; }

/* Chips catégorie / segmented */
.zl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zl-chip {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: #f4f3fb; border: 1px solid var(--aw-border); color: var(--zd-text); transition: .15s;
}
.zl-chip:hover { border-color: var(--aw-purple); }
.zl-chip.is-active { background: var(--aw-purple); border-color: var(--aw-purple); color: #fff; }

/* Segmented visibility */
.zl-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zl-seg-btn {
  text-align: left; padding: 11px 13px; border-radius: 11px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--aw-border); transition: .15s;
}
.zl-seg-btn:hover { border-color: var(--aw-purple); }
.zl-seg-btn.is-active { border-color: var(--aw-purple); background: var(--zd-purple-soft, rgba(124,58,237,.08)); }
.zl-seg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.zl-seg-title { font-weight: 700; font-size: 13.5px; color: var(--zd-text); }
.zl-seg-hint { font-size: 11.5px; color: var(--aw-muted); margin-top: 2px; }

/* Toggle */
.zl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zl-toggle { width: 42px; height: 24px; border-radius: 999px; background: #d1d5db; position: relative; cursor: pointer; flex: none; border: none; transition: background .2s; }
.zl-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.zl-toggle.is-on { background: var(--zd-green, #10b981); }
.zl-toggle.is-on::after { transform: translateX(18px); }
.zl-toggle[disabled] { opacity: .5; cursor: not-allowed; }

/* Buttons */
.zl-btn { padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; border: 1px solid transparent; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: .15s; }
.zl-btn--primary { background: var(--aw-purple); color: #fff; }
.zl-btn--primary:hover { background: var(--aw-purple-dk); }
.zl-btn--ghost { background: #fff; color: var(--zd-text); border-color: var(--aw-border); }
.zl-btn--ghost:hover { border-color: var(--aw-purple); }
.zl-btn--danger { background: var(--zd-red, #ef4444); color: #fff; }
.zl-btn--green { background: var(--zd-green, #10b981); color: #fff; }
.zl-btn:disabled { opacity: .55; cursor: not-allowed; }
.zl-btn--lg { padding: 15px; font-size: 15.5px; font-family: "Space Grotesk", sans-serif; font-weight: 800; width: 100%; }
.zl-btn--start { background: linear-gradient(135deg, var(--zd-red, #ef4444), var(--zd-pink, #ec4899)); color: #fff; box-shadow: 0 12px 28px rgba(239,68,68,.35); }

.zl-muted { color: var(--aw-muted); font-size: 12px; }
/* ⚠️ Divergence vs admin : `[hidden]` scopé à l'overlay (l.102 admin est
   globale et casserait tous les [hidden] de la home). */
.zl-hidden, .zh-zl-overlay [hidden] { display: none !important; }

/* Stripe gate encart */
.zl-stripe-gate { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; }
.zl-stripe-gate h4 { margin: 0 0 4px; font-size: 13.5px; color: #9a3412; font-family: "Space Grotesk", sans-serif; }
.zl-stripe-gate p { margin: 0 0 10px; font-size: 12.5px; color: #b45309; }

/* Tips disabled bloc */
.zl-tips { position: relative; opacity: .6; pointer-events: none; }
.zl-soon { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--aw-purple); background: var(--zd-purple-soft); padding: 3px 8px; border-radius: 999px; margin-left: 6px; }

/* ── SETUP (grille 2 colonnes) ───────────────────────────────────────────── */
.zl-setup-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--zl-gap); align-items: start; }
.zl-preview {
  position: relative; aspect-ratio: 9 / 13; border-radius: 14px; overflow: hidden;
  background: #15082b; display: flex; align-items: center; justify-content: center;
}
.zl-preview video { width: 100%; height: 100%; object-fit: cover; }
.zl-preview-badge { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; font-size: 10.5px; font-weight: 700; backdrop-filter: blur(6px); z-index: 2; }
.zl-preview-cta { color: #e7e2f5; text-align: center; padding: 20px; }

/* ── LIVE (grille vidéo + chat) ──────────────────────────────────────────── */
.zl-live-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; align-items: stretch; }
.zl-live-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.zl-badge-live { display: inline-flex; align-items: center; gap: 6px; background: var(--zd-red, #ef4444); color: #fff; font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 11px; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.zl-badge-live .zl-dot { background: #fff; animation: zlpulse 1.6s infinite; }
@keyframes zlpulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.zl-stage { position: relative; border-radius: 16px; overflow: hidden; background: #15082b; border: 1px solid var(--aw-border); min-height: 360px; display: flex; }
.zl-stage video { width: 100%; height: 100%; object-fit: cover; }
.zl-stage-overlay { position: absolute; inset: 0; pointer-events: none; }
.zl-stat-badges { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.zl-stat-badge { background: rgba(0,0,0,.5); color: #fff; font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 12.5px; padding: 5px 11px; border-radius: 8px; backdrop-filter: blur(6px); }
.zl-controls { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; }
.zl-ctrl { height: 40px; padding: 0 13px; border-radius: 11px; border: none; cursor: pointer; font-weight: 600; font-size: 12.5px; color: #fff; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.zl-ctrl.is-off { background: var(--zd-red, #ef4444); }
.zl-ctrl.is-on-accent { background: var(--aw-purple); }

/* Chat panel */
.zl-chat { background: var(--zd-card-bg, #fff); border: 1px solid var(--aw-border); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.zl-chat-head { padding: 13px 16px; border-bottom: 1px solid var(--aw-border); font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; }
.zl-pinned { padding: 10px 14px; background: var(--zd-purple-soft); border-bottom: 1px solid var(--aw-border); font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.zl-feed { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; max-height: 460px; }
.zl-msg { font-size: 12.5px; line-height: 1.4; }
.zl-msg b { color: var(--aw-purple); }
.zl-msg .zl-pin-btn { float: right; cursor: pointer; color: var(--aw-muted); font-size: 11px; }
.zl-feed-empty { color: var(--aw-muted); font-size: 12.5px; text-align: center; margin: auto; }
.zl-chat-input { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--aw-border); }
.zl-chat-input .zl-input { padding: 9px 11px; }

/* Private requests */
.zl-priv { margin-top: 12px; }
.zl-priv-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--aw-border); }
.zl-priv-item:last-child { border-bottom: none; }
.zl-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--aw-purple); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }

/* KPI cards (ended) */
.zl-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.zl-kpi { background: var(--zd-card-bg, #fff); border: 1px solid var(--aw-border); border-radius: 13px; padding: 15px 17px; }
.zl-kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--aw-muted); }
.zl-kpi-value { font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -0.6px; color: var(--zd-text); margin-top: 4px; }
.zl-kpi-sub { font-size: 11px; color: var(--aw-muted); margin-top: 2px; }

/* Ended recap */
.zl-ended { max-width: 560px; margin: 24px auto 0; text-align: center; }
.zl-ended-icon { width: 74px; height: 74px; border-radius: 50%; background: var(--zd-green, #10b981); color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }

/* Toast — position:fixed MAIS le backdrop-filter de l'overlay en fait le
   containing block : le toast se pose donc dans l'overlay plein écran. */
.zl-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #15082b; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px; z-index: 400; box-shadow: 0 12px 40px rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; }
.zl-toast.is-show { opacity: 1; }

/* ── Responsive (copie admin, sections non portées élaguées) ─────────────── */
@media (max-width: 1023px) {
  .zl-setup-grid { grid-template-columns: 1fr; }
  .zl-preview { aspect-ratio: 16 / 10; max-height: 420px; }
  .zl-live-grid { grid-template-columns: 1fr; }
  .zl-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .zl-root { --zl-gap: 12px; }
  .zl-card { padding: 16px; }
  .zl-seg { grid-template-columns: 1fr; }
  .zl-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .zl-kpi-value { font-size: 22px; }
  .zl-h1 { font-size: 20px; }
  .zl-stage { min-height: 260px; }
  .zl-btn { min-height: 44px; }
}

/* =============================================================================
 * Couche overlay popup (calquée landing-multipost-overlay.css).
 * ============================================================================= */

.zh-zl-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  background: var(--pp-scrim, rgba(15, 23, 42, 0.55));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zh-zl-overlay[hidden] { display: none; }

.zh-zl-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.zh-zl-overlay-card {
  position: relative;
  width: 100%;
  max-width: 1240px;
  max-height: calc(100vh - 48px);
  background: var(--pp-card, #ffffff);
  border-radius: 18px;
  box-shadow: 0 30px 80px var(--pp-shadow, rgba(15, 23, 42, 0.4));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.985);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zh-zl-overlay.is-open .zh-zl-overlay-card {
  transform: translateY(0) scale(1);
}

.zh-zl-overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--pp-border, #e5e7eb);
  background: var(--pp-card, #ffffff);
  color: var(--pp-text, #1f2937);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}

.zh-zl-overlay-close:hover {
  background: var(--pp-overlay, #f3f4f6);
  transform: scale(1.05);
}

.zh-zl-overlay-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Le panel admin (.zl-root) dans la carte : scroll interne + padding (fourni
 * par le shell workspace côté admin). */
.zh-zl-overlay-card .zl-root {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  border-radius: 18px;
  padding: 22px 24px;
}

/* Les titres de phase perdent la zone du bouton close. */
.zh-zl-overlay-card [data-phase] .zl-h1 { padding-right: 56px; }

/* Empêche le double-scroll : seul le .zl-root scrolle. */
body.zh-zl-overlay-open { overflow: hidden; }

/* Mobile : full-screen sheet. */
@media (max-width: 700px) {
  .zh-zl-overlay { padding: 0; }
  .zh-zl-overlay-card {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .zh-zl-overlay-card .zl-root { border-radius: 0; }
}

/* =============================================================================
 * Section home « ZIC Live » — cartes réelles (hydratation).
 * ============================================================================= */

a.zh-zlive-card { display: block; text-decoration: none; color: inherit; }
.zh-zlive-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
