/* MAXTV Titan OS — Cinema Dark Theme */
/* Synced with shared/API_CONTRACT.json theme colors */

:root {
  --onyx: #08090C;
  --obsidian: #0E1014;
  --graphite: #16181F;
  --slate: #1F222B;
  --smoke: #2A2E3A;
  --ash: #3A3F4D;
  --brand: #76B74F;
  --brand-bright: #9FE36E;
  --brand-deep: #4A8A2C;
  --brand-glow: rgba(118, 183, 79, 0.33);
  --live: #FF3B5C;
  --live-glow: rgba(255, 59, 92, 0.33);
  --info: #2FA8E0;
  --text-primary: #F5F6F8;
  --text-secondary: #B5BAC7;
  --text-muted: #7A8091;
  --text-dim: #4E5462;
  --glass: rgba(255,255,255,0.16);
  --scrim: rgba(0,0,0,0.8);

  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--onyx);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
  width: 1920px;
  height: 1080px;
}

/* Screen management */
.screen { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.screen.active { display: flex; }

/* Splash */
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--obsidian), var(--onyx));
}
.splash-logo { width: 280px; margin-bottom: 48px; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--smoke);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Focus system for TV remote */
.focusable { transition: all 0.16s ease; outline: none; }
.focusable.focused {
  box-shadow: 0 0 0 2px var(--brand), 0 0 28px var(--brand-glow);
  transform: scale(1.03);
}

/* Glass surface */
.glass {
  background: rgba(22, 24, 31, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 0.5px solid var(--smoke);
  background: linear-gradient(to bottom, rgba(22,24,31,0.6), rgba(22,24,31,0.2));
}
.section-header .icon-pill {
  padding: 8px;
  background: rgba(118,183,79,0.12);
  border-radius: 8px;
  display: flex;
}
.section-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.count-badge {
  background: var(--brand);
  color: var(--onyx);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

/* Channel / VOD list item */
.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  margin: 4px 12px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
}
.list-item:hover, .list-item.focused {
  background: var(--slate);
  border-color: var(--brand);
}
.list-item.selected {
  background: var(--slate);
  border-color: var(--brand);
}
.list-item.selected .item-name {
  color: var(--brand);
  font-weight: 700;
}
.list-item img {
  width: 80px; height: 50px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--graphite);
}
.item-name {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* EPG / Program list */
.epg-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  margin: 3px 12px;
  border-radius: 10px;
  transition: all 0.16s ease;
}
.epg-item.current {
  background: rgba(118,183,79,0.12);
  border: 1px solid var(--brand);
}
.epg-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.epg-item.current .epg-time { color: var(--brand); }
.epg-title { font-size: 15px; color: var(--text-secondary); }
.epg-item.current .epg-title { color: var(--text-primary); font-weight: 700; }
.live-dot {
  width: 6px; height: 6px;
  background: var(--live);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live-glow);
}

/* Brand button */
.btn-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  color: var(--onyx);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border: none;
  border-radius: 14px;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  border: 1.2px solid var(--ash);
  color: var(--text-primary);
}

/* Input field */
.brand-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--graphite);
  border: 1.5px solid var(--smoke);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: all 0.18s ease;
}
.brand-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 24px var(--brand-glow);
}
.input-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  background: linear-gradient(to bottom, #111420, #0B0D12);
  border-left: 0.5px solid var(--smoke);
  box-shadow: -4px 0 20px rgba(0,0,0,0.4);
}
.sidebar-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
}
.sidebar-icon span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Player */
.player-container {
  width: 100%; height: 100%;
  background: var(--onyx);
  position: relative;
}
.player-overlay {
  position: absolute;
  top: 16px; left: 20px;
  z-index: 10;
}
.channel-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
}

/* Shimmer loading */
.shimmer-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin: 4px 8px;
  background: var(--graphite);
  border-radius: 12px;
}
.shimmer-block {
  background: linear-gradient(90deg, var(--smoke) 25%, var(--ash) 50%, var(--smoke) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s ease-out both; }
