/* ============================================================
   GenIAcademy - page détail live / replay
   ============================================================ */
.live-detail { max-width: 1180px; margin-top: 8px; }

/* Layout 2 colonnes : lecteur/contenu + carte détails (sticky) */
.live-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
.live-main { min-width: 0; }
.live-aside { position: sticky; top: 20px; }

.live-player-wrap { position: relative; margin-bottom: 22px; }

/* Conteneur 16:9 du lecteur. */
.live-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0e08 0%, #0a0503 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.live-player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* États (programmé / verrouillé / lien externe). */
.live-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 32px;
  text-decoration: none; color: inherit;
}
.live-state.locked {
  background:
    radial-gradient(circle at 50% 35%, rgba(204, 31, 31, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, #1a0e08 0%, #0a0503 100%);
}
.live-state-icon { font-size: 44px; }
.live-state-title { font-family: 'Fraunces', serif; font-size: 24px; }
.live-state-sub { color: var(--muted); font-size: 14px; max-width: 420px; }
.live-state-actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  justify-content: center; margin-top: 12px;
}
.live-state-actions .btn-pay { display: inline-block; width: auto; }
.live-state-link { color: var(--terra-light); text-decoration: none; font-size: 14px; }
.live-state-link:hover { color: var(--paper); }

/* Badge EN DIRECT par-dessus le lecteur. */
.live-badge-detail {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--live); color: var(--paper);
  padding: 6px 14px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  box-shadow: 0 4px 16px rgba(204, 31, 31, 0.5);
}

/* Infos sous le lecteur. */
.live-status-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
}
.live-status-pill {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px; border: 1px solid var(--line);
}
.live-status-pill.status-live { color: var(--paper); background: var(--live); border-color: var(--live); }
.live-status-pill.status-scheduled { color: var(--gold); border-color: rgba(200, 150, 71, 0.4); }
.live-status-pill.status-replay_available { color: var(--jade-light); border-color: rgba(74, 128, 103, 0.4); }

.live-detail-title {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 30px; letter-spacing: -0.5px; line-height: 1.15; margin-bottom: 12px;
}
.live-detail-speaker {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: rgba(255, 255, 255, 0.82); margin-bottom: 16px;
}
.live-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--terra), var(--gold));
}
.live-detail-desc { color: rgba(255, 255, 255, 0.78); line-height: 1.7; margin-bottom: 4px; }
.live-detail-meta { font-size: 13px; color: var(--muted); }

/* Carte « Détails » (colonne latérale) */
.live-info-card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px;
}
.live-info-card-title {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.live-meta-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.live-meta-list li { display: flex; align-items: flex-start; gap: 12px; }
.live-meta-list li i { color: var(--terra-light); font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; margin-top: 1px; }
.live-meta-list li div { display: flex; flex-direction: column; min-width: 0; }
.live-meta-list li span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.live-meta-list li strong { font-size: 14px; font-weight: 500; color: var(--paper); text-transform: capitalize; }

.live-info-access { margin-top: 18px; }
.live-info-access .btn-pay { display: block; text-align: center; width: 100%; }
.live-info-access .access-granted { display: inline-flex; }
.live-info-res {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.live-info-res i { color: var(--terra-light); }

@media (max-width: 900px) {
  .live-detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .live-aside { position: static; }
}
@media (max-width: 600px) {
  .live-detail-title { font-size: 24px; }
  .live-state-icon { font-size: 36px; }
  .live-state-title { font-size: 20px; }
  .live-state-actions { flex-direction: column; align-items: stretch; }
  .live-state-actions .btn-pay { width: 100%; text-align: center; }
}
@media (max-width: 520px) {
  .live-resource { flex-wrap: wrap; }
  .live-resource-meta { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   Notes & ressources téléchargeables jointes à un live
   ============================================================ */
.live-attach { margin-top: 34px; }
.live-attach-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Fraunces', serif; font-size: 19px; margin-bottom: 14px;
}
.live-attach-title i { color: var(--terra-light); }

.live-notes { display: flex; flex-direction: column; gap: 12px; }
.live-note {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.live-note-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.live-note-body { color: rgba(255, 255, 255, 0.82); line-height: 1.7; font-size: 14px; }
.live-note-body p { margin: 0 0 8px; }
.live-note-body p:last-child { margin: 0; }

.live-resources { display: flex; flex-direction: column; gap: 10px; }
.live-resource {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.15s;
}
.live-resource:hover { border-color: var(--terra); transform: translateY(-2px); }
.live-resource-ext {
  flex-shrink: 0; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #1d100a, #0a0503);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.05em; color: var(--terra-light);
}
.live-resource-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-resource-title { font-size: 14.5px; font-weight: 500; }
.live-resource-desc { font-size: 12.5px; color: var(--muted); }
.live-resource-meta {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.live-resource-meta i { font-size: 16px; color: var(--terra-light); }

.live-attach-locked {
  margin-top: 28px; display: flex; align-items: center; gap: 10px;
  background: rgba(200, 150, 71, 0.08);
  border: 1px solid rgba(200, 150, 71, 0.25);
  border-radius: 12px; padding: 14px 16px;
  color: var(--gold); font-size: 13.5px;
}

/* ---- Discussion en direct (chat par polling) ---- */
.live-chat-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.live-chat-livedot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--live);
}

.live-chat-wrap { position: relative; }
.live-chat-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 380px; overflow-y: auto; scroll-behavior: smooth;
  padding: 6px 2px; margin-bottom: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.live-chat-list::-webkit-scrollbar { width: 7px; }
.live-chat-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.live-chat-msg {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 6px 8px; border-radius: 12px;
  transition: background 0.15s;
}
.live-chat-msg:hover { background: rgba(255, 255, 255, 0.03); }
.live-chat-msg.is-me { background: rgba(200, 100, 71, 0.06); }

.live-chat-avatar {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13.5px;
  background: linear-gradient(135deg, var(--terra), #7a3a22);
}
/* Palette déterministe par utilisateur (dernier chiffre de l'id) */
.live-chat-avatar[data-avatar="0"] { background: linear-gradient(135deg, #c0654a, #7a3a22); }
.live-chat-avatar[data-avatar="1"] { background: linear-gradient(135deg, #4a8fc0, #234a7a); }
.live-chat-avatar[data-avatar="2"] { background: linear-gradient(135deg, #5bb094, #22624a); }
.live-chat-avatar[data-avatar="3"] { background: linear-gradient(135deg, #c09a4a, #7a5f22); }
.live-chat-avatar[data-avatar="4"] { background: linear-gradient(135deg, #a06ac0, #4a2378); }
.live-chat-avatar[data-avatar="5"] { background: linear-gradient(135deg, #c05a7a, #7a2242); }
.live-chat-avatar[data-avatar="6"] { background: linear-gradient(135deg, #4ab0b0, #226262); }
.live-chat-avatar[data-avatar="7"] { background: linear-gradient(135deg, #8ba04a, #4f6222); }
.live-chat-avatar[data-avatar="8"] { background: linear-gradient(135deg, #6a7ac0, #23347a); }
.live-chat-avatar[data-avatar="9"] { background: linear-gradient(135deg, #c07a4a, #7a4222); }
.live-chat-msg.is-staff .live-chat-avatar {
  background: linear-gradient(135deg, var(--gold), #8a6a20);
  box-shadow: 0 0 0 2px rgba(200, 150, 71, 0.3);
}

.live-chat-body { flex: 1; min-width: 0; }
.live-chat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.live-chat-author { font-size: 13px; font-weight: 600; color: var(--paper); }
.live-chat-msg.is-me .live-chat-author { color: var(--terra-light); }
.live-chat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gold); background: rgba(200, 150, 71, 0.12);
  border: 1px solid rgba(200, 150, 71, 0.25);
  padding: 1px 7px; border-radius: 100px;
}
.live-chat-time {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted);
}
.live-chat-delete {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12.5px; padding: 2px 4px; line-height: 1;
  opacity: 0; transition: color 0.15s, opacity 0.15s;
}
.live-chat-msg:hover .live-chat-delete { opacity: 1; }
.live-chat-delete:hover { color: var(--live); }
.live-chat-text {
  display: inline-block;
  color: rgba(255, 255, 255, 0.9); font-size: 14px; line-height: 1.5;
  background: var(--ink-2); border-radius: 4px 12px 12px 12px;
  padding: 7px 12px; max-width: 100%;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.live-chat-msg.is-me .live-chat-text {
  background: rgba(200, 100, 71, 0.14);
}

.live-chat-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px; padding: 24px 4px;
}
.live-chat-loading .spin { display: inline-block; animation: live-spin 0.9s linear infinite; }
@keyframes live-spin { to { transform: rotate(360deg); } }

.live-chat-empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 13.5px; padding: 28px 4px; text-align: center;
}
.live-chat-empty i { font-size: 26px; color: var(--line); margin-bottom: 4px; }
.live-chat-empty small { font-size: 12px; opacity: 0.7; }

.live-chat-jump {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--terra); color: #fff; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 100px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: live-jump-in 0.2s ease;
}
.live-chat-jump:hover { background: var(--terra-light); }
@keyframes live-jump-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.live-chat-form { display: flex; gap: 10px; align-items: center; }
.live-chat-form input[type="text"] {
  flex: 1; min-width: 0;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 100px; padding: 12px 18px;
  color: var(--paper); font-size: 14px; font-family: inherit;
  transition: border-color 0.15s;
}
.live-chat-form input[type="text"]:focus {
  outline: none; border-color: var(--terra);
}
.live-chat-form input::placeholder { color: var(--muted); }
.live-chat-send {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  background: var(--terra); border: none; border-radius: 100px;
  padding: 12px 20px; color: var(--paper); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
}
.live-chat-send:hover { background: var(--terra-light); }
.live-chat-note {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13.5px;
}
.live-chat-note a { color: var(--terra-light); }

@media (max-width: 600px) {
  .live-chat-send span { display: none; }
  .live-chat-send { padding: 12px 16px; }
  .live-chat-form { gap: 8px; }
}
