/* ============================================================
   ORON UNION TV — styles
   ============================================================ */

:root {
  --tv-dark:    #0d0d0d;
  --tv-dark2:   #161616;
  --tv-border:  rgba(255,255,255,0.08);
  --tv-ctrl:    rgba(0,0,0,0.72);
  --tv-red:     #cc2200;
  --tv-gold:    #c8a951;
  --chat-bg:    #ffffff;
  --chat-msg-me: rgba(128,0,32,0.08);
  --chat-msg-bot: #f5f5f5;
}

/* ── Page shell ── */
.tv-page { background: var(--tv-dark); min-height: 100vh; padding-top: 70px; }

/* ── Layout: player + sidebar ── */
.tv-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: calc(100vh - 70px);
  align-items: start;
}
.tv-main  { background: var(--tv-dark); }
.tv-sidebar {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  border-left: 1px solid var(--card-border);
  overflow: hidden;
}

/* ── Player ── */
.tv-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
#live-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* ── Offline screen ── */
.tv-offline {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a0a0a 0%, #000 100%);
  z-index: 4;
}
.tv-offline.hidden { display: none; }
.tv-offline-inner {
  text-align: center;
  color: #fff;
  padding: 24px;
}
.tv-offline-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.7;
  margin-bottom: 20px;
}
.tv-offline-inner h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--tv-gold);
  margin-bottom: 10px;
}
.tv-offline-inner p { font-size: 0.95rem; color: rgba(255,255,255,0.55); margin-bottom: 24px; }
.tv-offline-next {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  line-height: 1.6;
}
.tv-offline-next strong { color: rgba(255,255,255,0.75); }

/* ── Controls overlay ── */
.tv-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    transparent 25%,
    transparent 60%,
    rgba(0,0,0,0.75) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tv-player-wrap:hover .tv-overlay,
.tv-player-wrap.controls-visible .tv-overlay { opacity: 1; }

/* ── Top bar ── */
.tv-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.tv-live-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #cc2200;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tv-now-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-viewers {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
}
.tv-viewers svg { width: 14px; height: 14px; }

/* ── Centre click zone ── */
.tv-center-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tv-big-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bigIconFade 0.6s ease forwards;
}
.tv-big-icon.hidden { display: none; }
.tv-big-icon svg { width: 28px; height: 28px; }
@keyframes bigIconFade {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 0.8; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* ── Bottom controls ── */
.tv-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 14px;
}
.tv-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.tv-btn:hover { background: rgba(255,255,255,0.15); }
.tv-btn svg { width: 18px; height: 18px; }
.tv-btn-live {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ff4444;
  border: 1px solid rgba(255,68,68,0.5);
  border-radius: 4px;
  padding: 4px 10px;
}
.tv-btn-live:hover { background: rgba(255,68,68,0.15); }
.tv-vol-slider {
  width: 80px;
  height: 3px;
  accent-color: var(--tv-red);
  cursor: pointer;
  flex-shrink: 0;
}
.tv-spacer { flex: 1; }

/* ── On-air banner ── */
.tv-on-air-banner {
  background: var(--tv-dark2);
  padding: 20px 24px;
  border-bottom: 1px solid var(--tv-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.on-air-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff4444;
}
.on-air-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.on-air-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ── TV sections ── */
.tv-section { background: var(--tv-dark); }
.tv-section-beige { background: var(--beige); }
.tv-section-inner { max-width: 100%; padding: 36px 24px; }
.tv-sec-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.tv-sec-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #fff;
  color: #fff;
}
.tv-section-beige .tv-sec-title {
  background: linear-gradient(135deg, var(--black) 0%, #4a1a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--black);
}
.tv-sec-date, .tv-sec-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}
.tv-section-beige .tv-sec-sub { color: var(--gray); }

/* ── Schedule ── */
.tv-schedule { display: flex; flex-direction: column; gap: 2px; }
.sched-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.15s;
}
.sched-item:hover { background: rgba(255,255,255,0.04); }
.sched-item.now {
  background: rgba(200,169,81,0.1);
  border: 1px solid rgba(200,169,81,0.25);
}
.sched-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  font-variant-numeric: tabular-nums;
}
.sched-item.now .sched-time { color: var(--tv-gold); }
.sched-info { min-width: 0; }
.sched-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-item.now .sched-title { color: #fff; }
.sched-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sched-badge.live-badge-sm { background: #cc2200; color: #fff; }
.sched-badge.upcoming-badge { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.45); }
.sched-badge.done-badge { color: rgba(255,255,255,0.2); }

/* ── VOD grid ── */
.tv-vod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.vod-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.vod-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.vod-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  position: relative;
}
.vod-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.vod-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
}
.vod-card:hover .vod-play-btn { background: rgba(0,0,0,0.35); }
.vod-play-btn svg {
  width: 44px;
  height: 44px;
  opacity: 0;
  transition: opacity 0.2s;
}
.vod-card:hover .vod-play-btn svg { opacity: 1; }
.vod-info { padding: 12px 14px 14px; }
.vod-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vod-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--gray);
}
.vod-meta .vod-dot { opacity: 0.35; }

/* ── Admin bar ── */
.tv-admin-bar {
  padding: 20px 24px;
  background: var(--tv-dark);
  border-top: 1px solid var(--tv-border);
  text-align: center;
}
.tv-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px 10px;
}
.tv-admin-link:hover { color: rgba(255,255,255,0.6); }
.tv-admin-link svg { width: 13px; height: 13px; }

/* ── Chat sidebar ── */
.tv-chat-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.tv-chat-hdr {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.tv-chat-hdr h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
}
.chat-watchers {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--gray);
}
.tv-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.tv-chat-msgs::-webkit-scrollbar { width: 4px; }
.tv-chat-msgs::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }

/* Chat message bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.chat-msg-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
}
.chat-msg-name.is-bot { color: #2563eb; }
.chat-msg-name.is-me  { color: var(--red); }
.chat-msg-time {
  font-size: 0.64rem;
  color: var(--gray);
  opacity: 0.6;
}
.chat-msg-text {
  font-size: 0.82rem;
  color: var(--black);
  line-height: 1.45;
  background: var(--chat-msg-bot);
  border-radius: 0 8px 8px 8px;
  padding: 7px 10px;
  max-width: 100%;
  word-break: break-word;
}
.chat-msg.is-me .chat-msg-text {
  background: var(--chat-msg-me);
  border-radius: 8px 0 8px 8px;
}
.chat-msg-system {
  font-size: 0.72rem;
  color: var(--gray);
  text-align: center;
  padding: 4px 0;
  font-style: italic;
}

/* Chat footer */
.tv-chat-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.chat-name-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.chat-name-input:focus { border-color: var(--red); }
.chat-send-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-msg-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.chat-msg-input:focus { border-color: var(--red); }
.chat-send-btn {
  width: 38px;
  height: 38px;
  background: var(--red);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.chat-send-btn:hover { background: #a00018; }
.chat-send-btn:active { transform: scale(0.94); }
.chat-send-btn svg { width: 15px; height: 15px; stroke: #fff; }

/* ── Stream config modal ── */
.stream-config-box {
  background: var(--white);
  border-radius: 18px;
  padding: 36px 32px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.stream-config-box h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--red);
  margin: 0 0 8px;
}
.stream-config-box p {
  font-size: 0.85rem;
  color: var(--gray);
  margin: 0 0 20px;
  line-height: 1.5;
}
.sc-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sc-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--card-border);
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}
.sc-input:focus { border-color: var(--red); }
.stream-status-row { min-height: 20px; margin-bottom: 12px; }
.sc-status { font-size: 0.78rem; color: var(--gray); }
.sc-status.ok  { color: #15803d; }
.sc-status.err { color: #dc2626; }
.sc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-btn {
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}
.sc-btn:active { transform: scale(0.97); }
.sc-go { background: var(--red); color: #fff; flex: 1; }
.sc-go:hover { background: #a00018; }
.sc-offline { background: var(--beige); color: var(--black); border: 1.5px solid var(--card-border); }
.sc-offline:hover { background: #e0ddd4; }
.sc-note {
  font-size: 0.72rem !important;
  color: rgba(0,0,0,0.35) !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
}

/* ── Nav: Live TV badge ── */
.nav-live-badge {
  display: inline-block;
  background: #cc2200;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
  animation: badge-pulse 2.5s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
.nav-tv { color: var(--black) !important; }
.nav-tv:hover, .nav-tv-active { color: var(--red) !important; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .tv-layout { grid-template-columns: 1fr 300px; }
  .tv-vod-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .tv-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .tv-sidebar {
    position: static;
    height: 480px;
    border-left: none;
    border-top: 1px solid var(--card-border);
  }
  .tv-vod-grid { grid-template-columns: repeat(2, 1fr); }
  .tv-controls { gap: 4px; }
  .tv-vol-slider { width: 60px; }
}

@media (max-width: 540px) {
  .tv-vod-grid { grid-template-columns: 1fr; }
  .tv-on-air-banner { padding: 16px; }
  .tv-section-inner { padding: 24px 16px; }
  .sched-item { grid-template-columns: 60px 1fr auto; gap: 10px; }
  .sched-desc { display: none; }
}
