/* ============================================================
   Z-Movies — Live TV Styles
   ============================================================ */

/* ---- App Layout ---- */
.livetv-app {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-h);
  background: var(--bg);
}

/* ---- Sidebar ---- */
.ltv-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform 0.25s ease;
}

.ltv-sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.ltv-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.ltv-logo-dot {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(239,68,68,0.8);
  animation: ltv-pulse 1.5s infinite;
}

@keyframes ltv-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.8); }
  50% { box-shadow: 0 0 16px rgba(239,68,68,1), 0 0 24px rgba(239,68,68,0.4); }
}

.ltv-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ltv-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}

.ltv-nav-btn:hover {
  background: var(--bg-3);
  color: var(--text);
}

.ltv-nav-btn.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.ltv-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.ltv-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.ltv-back-btn:hover { color: var(--text-2); background: var(--bg-3); }

/* ---- Main ---- */
.ltv-main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
}

/* ---- Topbar ---- */
.ltv-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,13,18,0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}

.ltv-sidebar-toggle {
  display: none;
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.ltv-search-wrap {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text-3);
}

.ltv-search-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.ltv-search-wrap input::placeholder { color: var(--text-3); }

.ltv-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-left: auto;
}

.ltv-live-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: ltv-pulse 1.5s infinite;
}

.ltv-live-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239,68,68,0.85);
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ---- Views ---- */
.ltv-view { display: none; flex: 1; }
.ltv-view.active { display: block; }

.ltv-view-header {
  padding: 32px 28px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ltv-view-header h1 {
  font-size: 24px;
  font-weight: 700;
}

/* ---- Hero ---- */
.ltv-hero {
  position: relative;
  height: 340px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.ltv-hero-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
}

.ltv-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,13,18,0.95) 30%, rgba(10,13,18,0.4) 100%),
              linear-gradient(to top, rgba(10,13,18,1) 0%, transparent 50%);
}

.ltv-hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 36px;
  max-width: 560px;
}

.ltv-hero-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: #ef4444;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.ltv-hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.ltv-hero-epg {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 20px;
}

.ltv-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ltv-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.ltv-btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }

.ltv-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
  font-family: inherit;
}

.ltv-btn-ghost:hover { background: rgba(255,255,255,0.18); }

/* ---- Sections ---- */
.ltv-section {
  padding: 28px 28px 8px;
}

.ltv-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ltv-section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ---- Channel Row (horizontal scroll) ---- */
.ltv-channel-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}

.ltv-channel-card {
  flex-shrink: 0;
  width: 140px;
  cursor: pointer;
  transition: transform var(--transition);
}

.ltv-channel-card:hover { transform: scale(1.04); }

.ltv-card-thumb {
  position: relative;
  width: 140px;
  height: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.ltv-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.ltv-card-initial {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-3);
}

.ltv-card-play {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity var(--transition);
}

.ltv-channel-card:hover .ltv-card-play { opacity: 1; }

.ltv-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ltv-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ltv-card-cat {
  font-size: 11px;
  color: var(--text-3);
}

/* ---- Channel Grid (large cards) ---- */
.ltv-channels-grid {
  padding: 8px 28px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.ltv-channel-card-lg {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.ltv-channel-card-lg:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.ltv-card-lg-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ltv-card-lg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.ltv-card-initial-lg {
  font-size: 48px;
  font-weight: 900;
  color: var(--bg-4);
}

.ltv-card-lg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity var(--transition);
}

.ltv-channel-card-lg:hover .ltv-card-lg-overlay { opacity: 1; }

.ltv-card-lg-play {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ltv-card-lg-fav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all var(--transition);
}

.ltv-card-lg-fav:hover, .ltv-card-lg-fav.active {
  background: rgba(239,68,68,0.3);
  border-color: #ef4444;
  color: #ef4444;
}

.ltv-card-lg-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ltv-card-lg-name {
  font-size: 14px;
  font-weight: 700;
}

.ltv-card-lg-epg {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Categories ---- */
.ltv-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ltv-category-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.ltv-category-btn:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.ltv-category-btn span { font-size: 14px; font-weight: 600; }
.ltv-category-btn small { font-size: 11px; color: var(--text-3); }

/* ---- Filter row ---- */
.ltv-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ltv-filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.ltv-filter-btn.active, .ltv-filter-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Guide ---- */
.ltv-guide-now {
  font-size: 14px;
  color: var(--text-2);
}

.ltv-guide-table {
  padding: 0 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-x: auto;
}

.ltv-guide-row {
  display: flex;
  gap: 0;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
}

.ltv-guide-channel {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}

.ltv-guide-channel img {
  width: 36px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.ltv-guide-progs {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.ltv-guide-prog {
  flex-shrink: 0;
  min-width: 160px;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  cursor: default;
}

.ltv-guide-prog.current {
  background: rgba(45,212,191,0.06);
  border-left: 2px solid var(--accent);
}

.ltv-guide-time {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
}

.ltv-guide-prog-title {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ltv-guide-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg-4);
}

.ltv-guide-progress div {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
}

/* ---- Loading / Empty ---- */
.ltv-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  padding: 40px 20px;
  font-size: 14px;
}

.ltv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-3);
  text-align: center;
  grid-column: 1 / -1;
}

.ltv-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ltv-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.ltv-spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

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

/* ============================================================
   LIVE TV PLAYER MODAL
   ============================================================ */
.ltv-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ltv-player-wrap {
  width: 100%;
  max-width: 1100px;
  background: #0a0d12;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

.ltv-player-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(15,19,24,0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ltv-player-close {
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.ltv-player-close:hover { background: var(--bg-3); color: var(--text); }

.ltv-player-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.ltv-player-logo {
  width: 48px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.ltv-player-name { font-size: 15px; font-weight: 700; }
.ltv-player-now { font-size: 12px; color: var(--text-2); }

.ltv-player-header-actions {
  display: flex;
  gap: 8px;
}

.ltv-player-fav-btn, .ltv-player-fullscreen-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}

.ltv-player-fav-btn:hover, .ltv-player-fullscreen-btn:hover { color: var(--text); background: var(--bg-4); }
.ltv-player-fav-btn.active { color: #ef4444; border-color: #ef4444; }

/* ---- Video ---- */
.ltv-video-container {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 0;
  aspect-ratio: 16/9;
  max-height: 55vh;
}

.ltv-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ltv-player-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

.ltv-player-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.85);
  color: var(--text-2);
}

/* ---- Controls ---- */
.ltv-player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: rgba(15,19,24,0.97);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.ltv-player-controls-left,
.ltv-player-controls-center,
.ltv-player-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ltv-player-controls-center {
  flex: 1;
  justify-content: center;
}

.ltv-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.ltv-ctrl-btn:hover { color: var(--text); background: var(--bg-4); }
.ltv-ctrl-btn.muted { color: var(--danger); }

.ltv-volume-slider {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ltv-channel-info-center {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.ltv-ctrl-logo {
  width: 32px;
  height: 20px;
  object-fit: contain;
}

.ltv-channel-info-center small { color: var(--text-3); font-size: 11px; }

.ltv-epg-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  max-width: 200px;
}

.ltv-epg-mini-now { font-size: 12px; font-weight: 600; color: var(--text); }
.ltv-epg-mini-next { font-size: 11px; color: var(--text-3); }

/* ---- EPG Sidebar on player ---- */
.ltv-player-epg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: rgba(15,19,24,0.97);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.ltv-player-epg.open { transform: translateX(0); }

.ltv-player-epg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
}

.ltv-epg-close {
  color: var(--text-3);
  transition: color var(--transition);
}
.ltv-epg-close:hover { color: var(--text); }

.ltv-epg-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.ltv-epg-item {
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.ltv-epg-item.current {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.ltv-epg-time { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.ltv-epg-title { font-size: 13px; font-weight: 600; }
.ltv-epg-desc { font-size: 11px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.ltv-epg-now-badge {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
}

.ltv-epg-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 24px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .ltv-sidebar {
    transform: translateX(-100%);
  }
  .ltv-sidebar.open {
    transform: translateX(0);
  }
  .ltv-main { margin-left: 0; }
  .ltv-sidebar-toggle { display: flex; }
  .ltv-player-wrap { border-radius: 0; max-height: 100vh; }
  .ltv-player-overlay { align-items: flex-start; }
  .ltv-channels-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 8px 16px 40px; }
  .ltv-section { padding: 20px 16px 8px; }
  .ltv-view-header { padding: 20px 16px 12px; }
  .ltv-guide-table { padding: 0 16px 40px; }
}

@media (max-width: 600px) {
  .ltv-hero { height: 220px; }
  .ltv-hero-title { font-size: 22px; }
  .ltv-hero-content { padding: 20px 20px; }
  .ltv-player-epg { width: 100%; transform: translateY(100%); top: auto; bottom: 0; right: 0; left: 0; height: 60%; border-left: none; border-top: 1px solid var(--border); }
  .ltv-player-epg.open { transform: translateY(0); }
  .ltv-player-controls { flex-wrap: wrap; gap: 12px; }
  .ltv-player-controls-right { width: 100%; }
}
