:root {
  --color-bg: #0a0a0f;
  --color-surface: #141419;
  --color-primary: #f59e0b;
  --color-primary-hover: #d97706;
  --color-text: #ffffff;
  --color-text-muted: #cbd5e1;
  --color-border: #2a2a35;
  --radius: 12px;
  --transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease, background-color 150ms ease;
  --glass-bg: rgba(20, 20, 25, 0.92);
  /* Tizen GPU'sinde kapali tutulur. */
  --glass-blur: none;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: block;
}

/* Glass panel */
.glass-panel {
  background: var(--glass-bg);
  
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* Login & Pairing Screen */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1a24 0%, #0a0a0f 100%);
}

.login-box {
  width: 650px;
  padding: 50px 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.login-title {
  font-size: 38px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 35px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-label {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: 18px;
  box-sizing: border-box;
  margin-bottom: 12px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus,
.form-input.focused {
  border-color: var(--color-primary);
  background: rgba(10, 10, 15, 0.96);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.pairing-code {
  font-size: 64px;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: 12px;
  margin: 20px 0;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
  padding: 15px;
  border-radius: var(--radius);
  border: 1px dashed rgba(245, 158, 11, 0.4);
}

.pairing-steps {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.02);
  padding: 15px 20px;
  border-radius: 8px;
  text-align: left;
}

/* Buttons */
.btn {
  padding: 16px 40px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--color-primary);
  color: #000000;
  transition: var(--transition);
  outline: none;
}

.btn:focus,
.btn.focused,
.focusable:focus {
  outline: none;
  transform: scale(1.06);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px var(--color-primary);
  background: #fbbf24;
  color: #000000 !important;
}

/* Specific focus state for inputs to prevent yellow bg and unwanted zoom */
.form-input:focus,
.form-input.focused,
.form-input.focusable:focus {
  outline: none;
  transform: none !important;
  border-color: #ffffff !important;
  background: #111827 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px var(--color-primary) !important;
}

/* Danger buttons */
.btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.btn-danger:focus,
.btn-danger.focused,
.btn-danger.focusable:focus {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px #f87171, 0 0 16px rgba(239, 68, 68, 0.6) !important;
  transform: scale(1.06) !important;
}

/* Theme color circle buttons focus */
.btn-theme:focus,
.btn-theme.focused,
.btn-theme.focusable:focus {
  outline: none !important;
  transform: scale(1.25) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 4px #ffffff, 0 0 16px rgba(255, 255, 255, 0.6) !important;
}

.search-result-card.focusable:focus {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: #ffffff !important;
  transform: scale(1.03) !important;
  box-shadow: 0 0 0 3px var(--color-primary) !important;
  outline: none !important;
  position: relative;
  z-index: 5;
}

/* Category tabs header */
.category-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 45px;
  background: rgba(10, 10, 15, 0.96);
  border-bottom: 1px solid var(--color-border);
  height: 80px;
}

.tab-btn {
  padding: 10px 26px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #0a0a0f;
}

.tab-btn:focus {
  outline: none;
  transform: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Home Layout: Sol Kategori Menüsü + Sağ İçerik & Önizleme */
.home-layout {
  display: flex;
  height: calc(1080px - 80px);
  width: 1920px;
  overflow: hidden;
}

/* Sol Kategori Sidebar */
.sidebar-categories {
  width: 380px;
  background: rgba(15, 15, 22, 0.94);
  border-right: 1px solid var(--color-border);
  padding: 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  /* Sidebar odak/scroll yeniden boyamaları sağdaki ızgaraya taşmasın */
  contain: layout paint;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  /* Hızlı D-pad gezinmesinde geçiş animasyonu yok: her adımda yeniden boyama maliyetini düşürür */
  transition: none;
  outline: none;
}

.category-item .cat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.category-item .cat-badge {
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 12px;
  color: #cbd5e1;
}

.category-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-primary);
  border-color: rgba(245, 158, 11, 0.35);
}

.category-item:focus {
  background: var(--color-primary);
  color: #000;
  transform: none;
  box-shadow: 0 0 0 2px var(--color-primary);
  outline: none;
  border-color: #fff;
}
.category-item:focus .cat-badge {
  background: #000;
  color: var(--color-primary);
  transform: scale(1.05);
}

/* Sağ Bölüm: Üst Önizleme Kartı + Alt Kanallar Izgarası */
.main-content-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(1000px 500px at 80% 20%, #1e1e2d 0%, #0a0a0f 60%);
  contain: layout paint;
}

/* Üst Önizleme Paneli (Hover Preview) */
.preview-panel {
  height: 240px;
  padding: 24px 45px;
  display: flex;
  align-items: center;
  gap: 35px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(to bottom, rgba(20, 20, 30, 0.8), rgba(10, 10, 15, 0.95));
  flex-shrink: 0;
}

.preview-logo-box {
  width: 200px;
  height: 150px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.preview-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-details {
  flex: 1;
  min-width: 0;
}

.preview-tag {
  display: inline-block;
  background: var(--color-primary);
  color: #000;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.preview-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.preview-meta {
  font-size: 16px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 20px;
}

.preview-action-hint {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #f59e0b;
  font-weight: 600;
}

/* Önizleme panelindeki hızlı işlem butonları */
.preview-action-btn {
  transition: var(--transition);
}

.preview-action-btn:focus,
.preview-action-btn.focused {
  outline: none;
  transform: scale(1.08);
  border: 1px solid #fff !important;
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Kaldığın Yerden Devam Et rozeti */
.preview-resume-badge {
  background: #3b82f6;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Alt Kanal Izgarası */
.channel-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 24px 45px 50px;
  overflow-y: auto;
}

.channel-grid.poster-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
}

.channel-card {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  transition: var(--transition);
  height: 155px;
  /* Yuvarlak köşe kırpmasını ayrı bir yığın bağlamında tut (yeniden boyamada köşeler sivrilmesin) */
  
}

.channel-card.card-poster {
  width: 100%;
  height: 260px;
  display: flex;
  flex-direction: column;
}

.channel-card:focus {
  outline: none;
  border-color: var(--color-primary);
  transform: scale(1.04);
  z-index: 10;
}

.channel-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 20%, transparent);
}

.channel-card .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal and Context Menu Overlays */
.details-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  background: rgba(10, 10, 15, 0.96);
  
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.details-modal-box {
  width: 1300px;
  max-height: 880px;
  background: #12121a;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 20px;
  padding: 45px 55px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.details-modal-box .btn.focusable:focus,
.details-modal-box .btn.focused {
  z-index: 5;
  position: relative;
}

.context-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  background: rgba(10, 10, 15, 0.96);
  
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.context-menu-box {
  width: 480px;
  background: #181824;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

/* Player container */
body.player-active,
body.player-active #app,
body.player-active .screen,
body.player-active #player-screen,
body.player-active .player-container,
.player-container {
  background: transparent !important;
  background-color: transparent !important;
}

.player-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* OSD Overlay */
.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 15;
}

.player-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Üst Başlık Çubuğu */
.player-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 35px 50px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
}

.player-channel-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.player-logo-thumb {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.player-logo-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.player-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.player-badge-live {
  background: #ef4444;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 16px;
  letter-spacing: 1px;
}

.player-badge-vod {
  background: var(--color-primary);
  color: #000;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 16px;
  letter-spacing: 1px;
}

.player-res-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
}

.player-res-badge.res-4k {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.8);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.player-res-badge.res-fhd {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.8);
  color: #60a5fa;
}

.player-res-badge.res-hd {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.8);
  color: #34d399;
}

.player-res-badge.res-sd {
  background: rgba(156, 163, 175, 0.2);
  border: 1px solid rgba(156, 163, 175, 0.5);
  color: #d1d5db;
}

.player-clock {
  font-size: 26px;
  font-weight: 700;
  color: #e5e7eb;
  font-family: monospace;
}

/* Orta Yükleme Spinner'ı */
.player-center-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 15px;
  pointer-events: none;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alt Kontrol Paneli */
.player-bottom-bar {
  padding: 30px 50px 45px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 65%, transparent 100%);
}

.player-epg-now {
  font-size: 18px;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Zaman Çubuğu (Scrubber) */
.player-progress-container {
  width: 100%;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  outline: none;
}

.player-progress-container.focusable {
  cursor: pointer;
  padding: 8px 0;
  border-radius: 8px;
}

.player-progress-container.focusable:focus,
.player-progress-container.focused {
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  outline: none !important;
  background: transparent !important;
}

.player-progress-container.focusable:focus .player-progress-track,
.player-progress-container.focused .player-progress-track {
  height: 14px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.player-progress-container.focusable:focus .player-progress-fill,
.player-progress-container.focused .player-progress-fill {
  background: #fbbf24;
}

.seek-preview-bubble {
  position: absolute;
  bottom: 42px;
  transform: translateX(-50%);
  background: rgba(18, 18, 26, 0.96);
  border: 2px solid var(--color-primary);
  border-radius: 10px;
  padding: 8px 18px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(245, 158, 11, 0.4);
  pointer-events: none;
  display: none;
  z-index: 30;
  white-space: nowrap;
}

.seek-preview-bubble.visible {
  display: block;
}

.player-progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.player-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
}

.player-time-display {
  font-size: 16px;
  font-family: monospace;
  color: #d1d5db;
  white-space: nowrap;
}

/* Oynatıcı Buton Grubu - Modern Smart TV Glassmorphism */
.player-buttons-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  background: rgba(25, 25, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #f3f4f6;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.player-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 180ms ease;
}

.player-btn:focus,
.player-btn.focused {
  background: linear-gradient(135deg, #fbbf24 0%, var(--color-primary) 100%) !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.7), 0 8px 25px rgba(0, 0, 0, 0.6);
}

.player-btn:focus svg,
.player-btn.focused svg {
  color: #000000;
  transform: scale(1.1);
}

.player-btn.btn-primary-action {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Hızlı Kanal Değiştirme Bildirim Kartı (Channel Switch HUD) */
.player-hud-banner {
  position: absolute;
  top: 45px;
  left: 55px;
  background: rgba(14, 14, 22, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 18px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 260ms cubic-bezier(0.16, 1, 0.3, 1), transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
  pointer-events: none;
}

.player-hud-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

.player-hud-logo {
  width: 54px;
  height: 54px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

.player-hud-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.player-hud-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-hud-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.player-hud-name {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-hud-epg {
  font-size: 16px;
  color: #cbd5e1;
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EPG Panel */
.epg-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 580px;
  height: 100%;
  background: rgba(12, 12, 18, 0.98);
  
  border-left: 1px solid var(--color-border);
  padding: 40px 35px;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  z-index: 25;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.8);
  display: none !important;
}

.epg-panel.visible {
  display: block !important;
  transform: translateX(0);
}

/* Yan Ayar Paneli (Side Panel Drawer: Audio, Subtitle, Aspect) */
.player-side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 520px;
  height: 100%;
  background: rgba(12, 12, 18, 0.98);
  
  border-left: 1px solid var(--color-border);
  padding: 40px 30px;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  z-index: 35;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.9);
  display: none !important;
  flex-direction: column;
}

.player-side-panel.visible {
  display: flex !important;
  transform: translateX(0);
}

/* Altyazı Ekranda Gösterim Kutusu (Hardware & Software Subtitle Overlay) */
.player-subtitle-overlay {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 29;
  pointer-events: none;
  max-width: 85%;
  line-height: 1.05;
  text-shadow: 0px 1px 3px rgba(0,0,0,0.8), 0px -1px 3px rgba(0,0,0,0.8), 1px 0px 3px rgba(0,0,0,0.8), -1px 0px 3px rgba(0,0,0,0.8); /* Better readability */
  white-space: pre-wrap;
  transition: bottom 220ms ease, opacity 150ms ease;
}

.player-overlay.visible ~ .player-subtitle-overlay {
  bottom: 240px !important;
}

.player-subtitle-overlay:empty {
  display: none;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-border);
}

.side-panel-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-panel-section-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-primary);
  margin: 18px 0 10px;
}

.side-panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  text-align: left;
}

.side-panel-item:focus {
  background: var(--color-primary);
  color: #000;
  border-color: #fff;
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.side-panel-item.active {
  border-left: 5px solid var(--color-primary);
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-primary);
}

.side-panel-item.active:focus {
  color: #000;
}

/* Inline renkli alt metinler (Oynatılıyor / İzlendi) odakta zemin ile aynı renge düşmesin */
.side-panel-item:focus span {
  color: #000 !important;
}

.epg-item {
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  margin-bottom: 12px;
  transition: var(--transition);
}

.epg-item:focus {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--color-primary);
  transform: scale(1.02);
}

.epg-item.active {
  border-left: 4px solid var(--color-primary);
  background: rgba(245, 158, 11, 0.08);
}

.epg-time {
  font-size: 16px;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.epg-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.epg-desc {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.25;
  text-shadow: 0px 1px 3px rgba(0,0,0,0.8), 0px -1px 3px rgba(0,0,0,0.8), 1px 0px 3px rgba(0,0,0,0.8), -1px 0px 3px rgba(0,0,0,0.8); /* Better readability */
}

/* Çıkış Onay Modalı (Exit App Modal) */
.exit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  background: rgba(10, 10, 15, 0.96);
  
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.exit-modal-box {
  width: 580px;
  background: #14141d;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

/* Terms & Legal Screen (TV) */
.terms-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1a24 0%, #0a0a0f 100%);
}

.terms-box {
  width: 1050px;
  max-height: 920px;
  padding: 45px 55px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  flex-direction: column;
}

.terms-title {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.terms-heading {
  font-size: 22px;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 24px;
  font-weight: 600;
}

.terms-scroll {
  flex: 1;
  max-height: 520px;
  overflow-y: auto;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 30px;
  line-height: 1.8;
  font-size: 16px;
  color: #d1d5db;
}

.terms-scroll h3 {
  color: var(--color-primary);
  font-size: 18px;
  margin: 18px 0 8px;
}

.terms-scroll h3:first-child {
  margin-top: 0;
}

.terms-scroll p {
  margin-bottom: 14px;
  color: #e2e8f0;
}

.terms-end {
  text-align: center;
  padding: 24px 0 10px;
  font-weight: bold;
  color: var(--color-primary);
  font-size: 18px;
}

.terms-hint {
  text-align: center;
  font-size: 16px;
  color: #f59e0b;
  margin: 18px 0 12px;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.terms-accept {
  width: 100%;
  margin-top: 6px;
}

.terms-accept:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background: #374151 !important;
  color: #9ca3af !important;
}

.terms-mac {
  margin-top: 14px;
  text-align: center;
  font-size: 16px;
  color: #cbd5e1;
  font-family: monospace;
}

/* Episode Card Focus Text Colors */
.ep-item-card.focusable:focus {
  transform: none !important;
  box-shadow: 0 0 0 3px #ffffff !important;
  border-color: #ffffff !important;
  outline: none !important;
  background: var(--color-primary) !important;
  z-index: 5;
  position: relative;
}
.ep-item-card.focusable:focus * {
  color: #000000 !important;
}

/* Dashboard Tile Focus */
.dash-tile:focus {
  border-color: var(--color-primary) !important;
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--color-primary);
  outline: none;
  background: rgba(20, 20, 25, 0.95) !important;
}

.dash-tile:hover {
  border-color: var(--color-primary);
  transform: scale(1.03);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screensaver overlay animation */
#screensaver-overlay {
  animation: fadeIn 0.4s ease;
}
/* Dashboard Styles */
.dashboard-view {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #18202d 0%, #0d1117 100%);
  color: #fff;
  padding: 60px 80px;
  box-sizing: border-box;
}
.dash-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
}
.dash-brand {
  display: flex;
  align-items: center;
}
.dash-brand-name {
  font-size: 38px;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: 2px;
}
.dash-clock-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.dash-clock {
  font-size: 48px;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 2px;
  color: #f3f4f6;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.dash-date {
  font-size: 16px;
  color: #9ca3af;
  margin-top: 4px;
}
.dash-actions {
  display: flex;
  gap: 15px;
}
.dash-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dash-action-btn:focus {
  background: var(--color-primary);
  color: #000;
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
  outline: none;
  transform: scale(1.05);
}

.dash-tiles {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
  flex: 1;
}
.dash-tile {
  background: rgba(20, 20, 25, 0.6);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 320px;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;

}
.dash-tile-icon {
  font-size: 72px;
  width: 72px;
  height: 72px;
  margin-bottom: 25px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.dash-brand-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
}
.dash-tile-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
}
.dash-tile-count {
  font-size: 14px;
  color: #9ca3af;
  background: rgba(0,0,0,0.3);
  padding: 6px 14px;
  border-radius: 20px;
}

.dash-bottom-bar {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}
.dash-playlist-label {
  font-size: 16px;
  color: #9ca3af;
}
.dash-playlist-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}



/* Fast fallback without layout thrashing inline JS */
.channel-card img.error-img {
  display: none !important;
}
.channel-card img.error-img + div,
.channel-card img.error-img + span {
  display: flex !important;
}

