/* ═══════════════════════════════════════════════════════
   INTERFILM — TV EN DIRECT  |  tv.css
   Thème : noir/orange (#f5a623) / blanc
   ══════════════════════════════════════════════════════ */

/* ── CONTAINER PRINCIPAL ── */
#tvView {
  display: none;
  min-height: 100vh;
  padding: 0 0 80px;
  background: var(--bg);
}

/* ── ACCÈS REFUSÉ ── */
.tv-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
}
.tv-locked-icon {
  width: 72px; height: 72px;
  background: rgba(245,166,35,.1);
  border: 2px solid rgba(245,166,35,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.tv-locked h2 {
  font-family: var(--ff-head);
  font-size: 24px; font-weight: 800;
  color: var(--text);
}
.tv-locked p { color: var(--text2); font-size: 15px; max-width: 420px; }

/* ── HEADER TV ── */
.tv-header {
  padding: 28px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tv-header-left { display: flex; align-items: center; gap: 14px; }
.tv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,48,74,.15);
  border: 1px solid rgba(232,48,74,.4);
  color: var(--red2);
  font-size: 11px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tv-live-dot {
  width: 7px; height: 7px;
  background: var(--red2);
  border-radius: 50%;
  animation: tv-pulse 1.2s infinite;
}
@keyframes tv-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.75); }
}
.tv-title {
  font-family: var(--ff-head);
  font-size: 26px; font-weight: 800;
  color: var(--text);
}
.tv-header-back {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text2);
  font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.tv-header-back:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* ── LAYOUT PRINCIPAL ── */
.tv-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto 1fr;
  gap: 0;
  height: calc(100vh - 160px);
  padding: 20px 28px 0;
}

/* ── LECTEUR ── */
.tv-player-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
  background: #000;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.tv-player-screen {
  position: relative;
  width: 100%; flex: 1;
  background: #000;
  min-height: 0;
}
.tv-player-screen iframe,
.tv-player-screen video {
  width: 100%; height: 100%;
  border: none; display: block;
}
.tv-player-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; color: var(--text2);
}
.tv-player-placeholder svg { opacity: .3; }
.tv-player-placeholder span { font-size: 14px; opacity: .6; }

/* Bandeau info chaîne */
.tv-channel-info-bar {
  background: rgba(7,7,15,.9);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.tv-channel-logo-sm {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.tv-channel-logo-sm img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.tv-channel-name-live { font-weight: 800; font-size: 15px; color: var(--text); }
.tv-channel-program { font-size: 12px; color: var(--text2); }
.tv-channel-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.tv-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer; transition: all .2s;
  color: var(--text2);
}
.tv-action-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.tv-action-btn.active { background: rgba(245,166,35,.15); border-color: rgba(245,166,35,.4); color: var(--gold); }
.tv-action-btn.report-btn:hover { background: rgba(232,48,74,.15); border-color: rgba(232,48,74,.3); color: var(--red2); }

/* ── SIDEBAR DROITE ── */
.tv-sidebar {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  background: var(--s1);
  border-radius: 0 16px 16px 0;
  border-left: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}

/* Tabs sidebar */
.tv-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.tv-sidebar-tab {
  flex: 1;
  padding: 14px 0;
  font-size: 12px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text2); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s; text-align: center;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tv-sidebar-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── LISTE DES CHAÎNES ── */
.tv-channels-pane {
  display: none; flex-direction: column;
  flex: 1; overflow: hidden;
}
.tv-channels-pane.active { display: flex; }

.tv-channels-filter {
  padding: 12px 14px;
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.tv-chip {
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
  cursor: pointer; transition: all .2s;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text2);
  text-transform: uppercase; letter-spacing: .04em;
}
.tv-chip.active {
  background: rgba(245,166,35,.15);
  border-color: rgba(245,166,35,.4);
  color: var(--gold);
}

.tv-channels-list {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.tv-channels-list::-webkit-scrollbar { width: 4px; }
.tv-channels-list::-webkit-scrollbar-track { background: transparent; }
.tv-channels-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.tv-channel-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  transition: background .15s; border-radius: 0;
  position: relative;
}
.tv-channel-item:hover { background: rgba(255,255,255,.04); }
.tv-channel-item.selected {
  background: rgba(245,166,35,.08);
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}
.tv-channel-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.tv-channel-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.tv-channel-logo .tv-logo-fallback {
  font-weight: 900; font-size: 11px; color: var(--text2);
  text-align: center; line-height: 1.2; padding: 4px;
}
.tv-channel-meta { flex: 1; min-width: 0; }
.tv-channel-meta-name {
  font-weight: 700; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-channel-meta-cat {
  font-size: 11px; color: var(--text2); margin-top: 1px;
  text-transform: uppercase; letter-spacing: .04em;
}
.tv-fav-star {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer;
  transition: all .2s; flex-shrink: 0;
}
.tv-fav-star:hover, .tv-fav-star.active { color: var(--gold); }
.tv-fav-star.active svg { fill: var(--gold); }
.tv-channel-item-live {
  width: 7px; height: 7px;
  background: #4caf50;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CHAT EN DIRECT ── */
.tv-chat-pane {
  display: none; flex-direction: column;
  flex: 1; overflow: hidden;
}
.tv-chat-pane.active { display: flex; }

.tv-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.tv-chat-messages::-webkit-scrollbar { width: 4px; }
.tv-chat-messages::-webkit-scrollbar-track { background: transparent; }
.tv-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.tv-chat-msg {
  display: flex; gap: 10px;
  animation: tv-msg-in .2s ease;
}
@keyframes tv-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tv-chat-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--s3);
}
.tv-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tv-chat-bubble { flex: 1; min-width: 0; }
.tv-chat-meta {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.tv-chat-user {
  font-size: 12px; font-weight: 800; color: var(--text);
}
.tv-chat-user.role-vip { color: var(--gold); }
.tv-chat-user.role-founder { color: #a78bfa; }
.tv-chat-user.role-moderator { color: var(--red2); }
.tv-chat-user.role-dev { color: #38bdf8; }
.tv-chat-time { font-size: 10px; color: var(--muted); }
.tv-chat-role-badge {
  font-size: 9px; font-weight: 800;
  padding: 1px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.tv-chat-role-badge.vip { background: rgba(245,166,35,.15); color: var(--gold); }
.tv-chat-role-badge.founder { background: rgba(167,139,250,.15); color: #a78bfa; }
.tv-chat-role-badge.moderator { background: rgba(232,48,74,.15); color: var(--red2); }
.tv-chat-role-badge.dev { background: rgba(56,189,248,.15); color: #38bdf8; }

.tv-chat-text {
  font-size: 13.5px; color: var(--text2);
  line-height: 1.5; word-break: break-word;
}
.tv-chat-msg.own .tv-chat-text { color: var(--text); }

/* Barre d'envoi */
.tv-chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.tv-chat-input-row {
  display: flex; gap: 8px; align-items: center;
}
.tv-chat-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px; color: var(--text);
  font-family: var(--ff-body);
  outline: none; resize: none;
  min-height: 40px; max-height: 90px;
  transition: border-color .2s;
}
.tv-chat-input::placeholder { color: var(--muted); }
.tv-chat-input:focus { border-color: rgba(245,166,35,.4); }
.tv-chat-send {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--gold);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; flex-shrink: 0;
  transition: all .2s;
}
.tv-chat-send:hover { background: var(--gold2); transform: scale(1.05); }
.tv-chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.tv-chat-login-hint {
  text-align: center;
  font-size: 13px; color: var(--text2);
  padding: 4px 0 0;
}

/* ── MODAL SIGNALEMENT ── */
.tv-report-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
}
.tv-report-modal.open { display: flex; }
.tv-report-box {
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 28px;
  width: 380px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  animation: tv-modal-in .25s cubic-bezier(.34,1.4,.64,1);
}
@keyframes tv-modal-in {
  from { opacity: 0; transform: scale(.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tv-report-box h3 {
  font-family: var(--ff-head); font-size: 18px; font-weight: 800;
  color: var(--text); margin-bottom: 8px;
}
.tv-report-box p { font-size: 13.5px; color: var(--text2); margin-bottom: 16px; }
.tv-report-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tv-report-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; cursor: pointer; transition: all .2s;
}
.tv-report-option:hover, .tv-report-option.selected {
  background: rgba(232,48,74,.1);
  border-color: rgba(232,48,74,.3);
}
.tv-report-option input[type=radio] { accent-color: var(--red2); }
.tv-report-option label { font-size: 14px; color: var(--text); cursor: pointer; }
.tv-report-actions { display: flex; gap: 10px; }
.tv-report-cancel {
  flex: 1; padding: 11px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; color: var(--text2);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tv-report-cancel:hover { background: rgba(255,255,255,.1); color: var(--text); }
.tv-report-submit {
  flex: 1; padding: 11px;
  background: var(--red);
  border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tv-report-submit:hover { background: var(--red2); }

/* ── SKELETON LOADER ── */
.tv-skeleton-list { padding: 8px 14px; display: flex; flex-direction: column; gap: 10px; }
.tv-skeleton-item {
  display: flex; gap: 12px; align-items: center;
}
.tv-sk-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(255,255,255,.06);
  animation: tv-shimmer 1.4s infinite linear;
}
.tv-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tv-sk-line {
  height: 10px; border-radius: 5px;
  background: rgba(255,255,255,.06);
  animation: tv-shimmer 1.4s infinite linear;
}
.tv-sk-line:last-child { width: 60%; }
@keyframes tv-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.tv-sk-logo, .tv-sk-line {
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 25%,
    rgba(255,255,255,.1) 50%,
    rgba(255,255,255,.05) 75%
  );
  background-size: 200% 100%;
}

/* ── TOAST TV ── */
.tv-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10000;
  background: var(--s2); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); font-size: 13.5px; font-weight: 600;
  padding: 10px 20px; border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: none; opacity: 0;
  transition: all .3s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.tv-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 900px) {
  .tv-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    height: auto;
    padding: 12px 0 0;
  }
  .tv-player-wrap {
    grid-column: 1; grid-row: 1;
    border-radius: 0;
    height: 56vw; min-height: 200px;
  }
  .tv-sidebar {
    grid-column: 1; grid-row: 2 / 4;
    border-radius: 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.07);
    height: calc(100vh - 56vw - 120px);
    min-height: 300px;
  }
  .tv-header { padding: 16px 16px 0; }
  .tv-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .tv-header { padding: 12px 12px 0; }
}

/* ── COMPTEUR D'OBSERVATEURS ── */
.tv-viewers-count {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2); font-weight: 600;
}
.tv-viewers-dot { width: 6px; height: 6px; background: #4caf50; border-radius: 50%; }

/* ── CATÉGORIE BADGE ── */
.tv-category-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── EMPTY STATE ── */
.tv-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
