:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --accent-white: #fff;
  --accent-color: #a855f7;
  --accent-hover: #c084fc;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --card-bg: #16161c;
  --card-border: rgba(255, 255, 255, 0.08);
  --focus-border: #f43f5e;
  --sidebar-width: 300px;
  --glass-bg: rgba(18, 18, 22, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* ==========================================================================
   APP CONTAINER & SHARED HEADER
   ========================================================================== */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.06), transparent 45%),
              radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent 45%),
              var(--bg-primary);
  overflow: hidden;
  position: relative;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
  flex-shrink: 0;
  height: 50px;
}

.brand-section,
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-container,
.logo-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: transparent;
}

.logo-container img,
.logo-box img,
img.custom-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  display: block;
}

.brand-title-wrapper,
.brand-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title,
.brand-title-main {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-subtitle,
.brand-badge-sub {
  font-size: 0.75rem;
  color: var(--accent-hover, #c084fc);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-middle {
  flex: 1;
  max-width: 600px;
  margin: 0 16px;
  overflow: hidden;
}

.header-announcement {
  font-size: 0.88rem;
  color: #e2e8f0;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-display {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: monospace;
}

.back-menu-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-menu-btn:hover, .back-menu-btn.remote-focused {
  background: var(--focus-border);
  border-color: var(--focus-border);
  color: #fff;
  transform: scale(1.04);
}

/* ==========================================================================
   VIEW PANES SWITCHER
   ========================================================================== */
.view-pane {
  display: none !important;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 50px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 28px 40px 28px;
  box-sizing: border-box;
}

#view-dashboard.view-pane {
  padding-top: 20px;
}

.view-pane.active-view {
  display: flex !important;
}

/* ==========================================================================
   1. DASHBOARD VIEW & 3D HERO COVERFLOW
   ========================================================================== */
.dashboard-hero-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 4px auto 26px auto;
  height: 320px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slide {
  position: absolute;
  width: 780px;
  max-width: 90%;
  height: 295px;
  background: linear-gradient(135deg, #1b1b22 0%, #101015 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65);
  transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.hero-slide.active-slide {
  transform: translate3d(0, 0, 0) scale(1);
  z-index: 5;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(168, 85, 247, 0.25);
}

.hero-slide.active-slide.hero-slide-focused {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 2.5px #f43f5e, 0 22px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(244, 63, 94, 0.5) !important;
}

.hero-slide.prev-slide {
  transform: translate3d(-35%, 0, -120px) scale(0.85);
  z-index: 3;
  opacity: 0.6;
  pointer-events: auto;
  filter: brightness(0.7);
}

.hero-slide.next-slide {
  transform: translate3d(35%, 0, -120px) scale(0.85);
  z-index: 3;
  opacity: 0.6;
  pointer-events: auto;
  filter: brightness(0.7);
}

.hero-slide.hidden-slide {
  transform: translate3d(0, 0, -250px) scale(0.7);
  opacity: 0;
  z-index: 1;
}

.hero-preview-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.prev-slide .hero-content,
.prev-slide .hero-slide-right,
.next-slide .hero-content,
.next-slide .hero-slide-right,
.hidden-slide .hero-content,
.hidden-slide .hero-slide-right {
  display: none !important;
}

.prev-slide .hero-preview-overlay {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 24px;
  gap: 14px;
  background: rgba(14, 14, 18, 0.88);
}

.next-slide .hero-preview-overlay {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 24px;
  gap: 14px;
  background: rgba(14, 14, 18, 0.88);
}

.next-slide .hero-preview-info {
  align-items: flex-end;
  text-align: right;
}

.next-slide .hero-preview-poster-thumb {
  order: 2;
}

.hero-preview-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(15px);
  opacity: 0.35;
}

.hero-preview-poster-thumb {
  width: 80px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.hero-preview-poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-preview-info {
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 170px;
}
.hero-preview-tag {
  background: rgba(168, 85, 247, 0.3);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}
.hero-preview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hero-content {
  flex: 1.1;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 3;
}

.hero-tag {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.25;
}

.hero-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.hero-meta .rating {
  color: #fbbf24;
  font-weight: 700;
}

.hero-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #d1d5db;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.btn-primary:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  transform: scale(1.05);
}
.btn-primary.remote-focused,
.slider-play-action-btn.remote-focused {
  background: #f43f5e !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2.5px #ffffff, 0 0 20px rgba(244, 63, 94, 0.95) !important;
  transform: scale(1.08) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}
.btn-secondary.remote-focused,
.slider-details-action-btn.remote-focused {
  background: #f43f5e !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2.5px #ffffff, 0 0 20px rgba(244, 63, 94, 0.95) !important;
  transform: scale(1.08) !important;
}

.hero-slide-right {
  flex: 0.9;
  position: relative;
  overflow: hidden;
}
.hero-slide-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(to right, transparent, black 25%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 25%);
}

.hero-carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}
.hero-nav-btn-left { left: -10px; }
.hero-nav-btn-right { right: -10px; }
.hero-carousel-nav-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-50%) scale(1.1);
}

.slider-dots {
  position: absolute;
  bottom: -10px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}
.slider-dot.active {
  width: 24px;
  background: var(--accent-color);
}

/* Section Header */
.section-header-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-icon {
  color: var(--accent-color);
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

/* Portals Bento Box */
.portals-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.portal-card {
  background: linear-gradient(135deg, rgba(26, 26, 34, 0.85) 0%, rgba(18, 18, 24, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  gap: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.2);
}

.portal-card.remote-focused {
  transform: translateY(-6px) scale(1.02) !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 2.5px #f43f5e, 0 16px 36px rgba(244, 63, 94, 0.45) !important;
  background: linear-gradient(135deg, rgba(38, 28, 42, 0.95) 0%, rgba(22, 18, 28, 0.95) 100%) !important;
}

.portal-card.remote-focused .portal-icon-box {
  background: #f43f5e !important;
  color: #ffffff !important;
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.7);
}

.portal-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ftp-portal-card .portal-icon-box {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.portal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.portal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.portal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.portal-badge.live {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.portal-badge.vod {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.portal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.portal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.portal-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  color: #d1d5db;
}

/* Recently Played Scroller */
.recent-carousel-container {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

.recent-scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  width: 100%;
}
.recent-scroller::-webkit-scrollbar {
  display: none;
}

.recent-card {
  position: relative;
  width: 160px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #141419;
}
.recent-card:hover, .recent-card.remote-focused {
  transform: scale(1.05);
  border-color: var(--accent-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
.recent-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}
.recent-badge.recent-ftp {
  background: #3b82f6;
}
.recent-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.recent-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  z-index: 2;
}
.recent-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-scroll-btn {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(20, 20, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}
.scroll-btn-left { left: -14px; }
.scroll-btn-right { right: -14px; }

/* ==========================================================================
   2. LIVE TV VIEW
   ========================================================================== */
.live-tv-sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: rgba(18, 18, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.live-categories-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.live-categories-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.category-pill:hover, .category-pill.remote-focused {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-hover);
  color: #fff;
}
.category-pill.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.stat-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.mobile-channel-text { display: none; }

.channels-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  align-content: start;
  align-items: start;
  width: 100%;
}

.channel-card {
  background: rgba(22, 22, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  height: fit-content;
  transition: all 0.2s ease;
}
.channel-card:hover, .channel-card.remote-focused {
  transform: translateY(-4px);
  background: rgba(30, 30, 40, 0.9);
  border-color: var(--accent-color);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.channel-card.remote-focused {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6) !important;
}

.channel-icon-wrapper {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.channel-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.channel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.favorite-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
}
.favorite-btn:hover, .favorite-btn.active {
  color: #f43f5e;
  border-color: #f43f5e;
  background: rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   3. FTP SERVER (VOD) VIEW
   ========================================================================== */
.ftp-categories-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(18, 18, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.ftp-cats-left, .ftp-cats-center, .ftp-cats-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ftp-category-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ftp-category-btn:hover, .ftp-category-btn.remote-focused {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-hover);
  color: #fff;
}
.ftp-category-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 10px;
  gap: 6px;
}
.search-icon-svg {
  color: var(--text-muted);
}
.search-input-field {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  width: 180px;
}
.search-input-field::placeholder {
  color: var(--text-muted);
}

.ftp-genres-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 20px;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.ftp-genres-bar::-webkit-scrollbar {
  display: none;
}

.ftp-genre-pill {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.ftp-genre-pill:hover, .ftp-genre-pill.remote-focused {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.ftp-genre-pill.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-color);
  color: #fff;
}

.ftp-posters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
  align-content: start;
  align-items: start;
  width: 100%;
}

.poster-card {
  background: #141419;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: fit-content;
  transition: all 0.25s ease;
  position: relative;
}
.poster-card:hover, .poster-card.remote-focused {
  transform: translateY(-6px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 12px rgba(168, 85, 247, 0.25);
}
.poster-card.remote-focused {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.6) !important;
}

.poster-thumb-container {
  width: 100%;
  aspect-ratio: 2 / 3;
  position: relative;
  background: #0c0c0e;
  overflow: hidden;
}
.poster-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.poster-card:hover .poster-thumbnail {
  transform: scale(1.06);
}

.poster-hd-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.poster-type-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(168, 85, 247, 0.85);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.poster-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.poster-card:hover .poster-play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.poster-details-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.poster-title-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-meta-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.poster-meta-text .rating {
  color: #fbbf24;
  font-weight: 700;
}

/* ==========================================================================
   4. DETAIL MODAL & DYNAMIC EPISODES
   ========================================================================== */
.vod-modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.vod-modal-wrapper.active {
  display: flex !important;
  opacity: 1;
}

.modal-container-card {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 26, 34, 0.98) 0%, rgba(14, 14, 18, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  padding: 24px;
  box-sizing: border-box;
  color: #f3f4f6;
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}
.modal-close-icon:hover, .modal-close-icon.remote-focused {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #fff;
  transform: scale(1.08);
}

.modal-content-box {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.modal-poster-box {
  width: 150px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  background: #0d0d12;
}
.modal-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-details-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.modal-category-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.modal-title-header {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
  word-break: break-word;
}

.modal-meta-stats {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.modal-description-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #9ca3af;
  margin-bottom: 16px;
  max-height: 80px;
  overflow-y: auto;
}

.modal-buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.modal-episodes-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.modal-episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.modal-episodes-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f3f4f6;
}

.modal-episodes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px 4px;
  width: 100%;
  scroll-behavior: smooth;
}

.modal-episode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f3f4f6;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  outline: none;
}

.modal-episode-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.modal-episode-btn.remote-focused, .modal-episode-btn:focus-visible {
  background: #f43f5e !important;
  border-color: #f43f5e !important;
  color: #fff !important;
  transform: scale(1.06);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.75) !important;
  z-index: 2;
}

.modal-episode-btn .ep-play-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.85;
}

/* ==========================================================================
   5. VIDEO PLAYER SCREEN & OVERLAYS
   ========================================================================== */
#player-view-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: none;
  z-index: 100;
  overflow: hidden;
}

.blur-bg-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.5;
}

.blur-bg-inner-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.15);
}

#player-video-tag {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border: none;
  z-index: 2;
}

/* Hide native controls */
video::-webkit-media-controls { display: none !important; }

/* Center Logo / Poster Overlay on playback load */
.player-center-logo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.center-logo-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 28px;
  background: rgba(14, 14, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(168, 85, 247, 0.25);
  max-width: 85vw;
  max-height: 80vh;
  text-align: center;
  animation: centerLogoScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes centerLogoScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#player-center-card-logo {
  max-width: 180px;
  max-height: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}

#player-center-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: 110;
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-back-home-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.player-back-home-btn:hover, .player-back-home-btn.remote-focused {
  background: var(--focus-border);
  border-color: var(--focus-border);
}

.player-stream-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.player-status-badge {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 24px 24px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: 110;
}

.controls-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.player-ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(30, 30, 36, 0.85);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.player-ctrl-btn svg {
  width: 22px;
  height: 22px;
}
.player-ctrl-btn:hover {
  background-color: var(--accent-color);
  transform: scale(1.1);
}
.player-ctrl-btn.play-pause-toggle {
  background-color: var(--accent-color);
  width: 48px;
  height: 48px;
}
.player-ctrl-btn.remote-focused {
  border: 3px solid var(--focus-border) !important;
  background-color: #f43f5e !important;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.7);
}

.hidden-ui {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Sidebar Drawer */
.overlay-sidebar {
  position: absolute;
  width: 280px;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(12, 12, 16, 0.94);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 20px 0 45px rgba(0, 0, 0, 0.7);
  z-index: 120;
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.overlay-sidebar.active {
  transform: translate3d(0, 0, 0);
}
.overlay-sidebar.dual-pane {
  width: 420px;
}

@media (max-width: 640px) {
  .overlay-sidebar.dual-pane {
    width: 100vw;
  }
}

.sidebar-category-item {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-category-item:hover, .sidebar-category-item.remote-focused {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.sidebar-category-item.active {
  background-color: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.65);
  color: #fff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
}
.sidebar-category-item.remote-focused {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6) !important;
}

.sidebar-item {
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: all 0.2s ease;
  overflow: hidden;
}
.sidebar-item:hover, .sidebar-item.remote-focused {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.sidebar-item.active {
  background-color: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.6);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}
.sidebar-item.remote-focused {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6) !important;
}

.sidebar-item-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.sidebar-item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-item-thumb {
  width: 44px;
  height: 60px;
  min-width: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #18181f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-item-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-vod-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.22);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Sidebar Episodes View */
.sidebar-episodes-header-card {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-episodes-header-thumb {
  width: 38px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  background: #111;
}
.sidebar-episodes-header-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-episodes-header-info {
  flex: 1;
  min-width: 0;
}
.sidebar-episodes-header-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-episodes-header-sub {
  font-size: 0.72rem;
  color: #c084fc;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  padding: 4px 2px 20px 2px;
}
.sidebar-episode-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 48px;
  user-select: none;
}
.sidebar-episode-chip:hover, .sidebar-episode-chip.remote-focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}
.sidebar-episode-chip.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}
.sidebar-episode-chip.remote-focused {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.7) !important;
}
.sidebar-episode-chip-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.sidebar-episode-chip-status {
  font-size: 0.62rem;
  color: #a855f7;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}
.sidebar-episode-chip.active .sidebar-episode-chip-status {
  color: #d8b4fe;
}

.sidebar-series-quick-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
}
.sidebar-series-quick-banner:hover, .sidebar-series-quick-banner.remote-focused {
  background: rgba(168, 85, 247, 0.28);
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.player-ctrl-btn.series-only {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}
.player-ctrl-btn.series-only:hover, .player-ctrl-btn.series-only.remote-focused {
  background: rgba(168, 85, 247, 0.35);
  border-color: #a855f7;
  color: #fff;
}

.sidebar-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sidebar-back-btn:hover, .sidebar-back-btn.remote-focused {
  background: rgba(168, 85, 247, 0.3);
  border-color: var(--accent-color);
}
.sidebar-back-btn.remote-focused {
  border-color: var(--focus-border) !important;
}

/* Spinner */
#player-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: none;
}
.loading-spinner-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(168, 85, 247, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast */
.toast-popup-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate3d(-50%, 40px, 0);
  background-color: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}
.toast-popup-notification.show-toast {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

/* Offline Overlay */
#offline-overlay-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 10, 14, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}
.offline-alert-box {
  background: #141419;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.offline-alert-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}
.offline-alert-title {
  color: #ef4444;
  font-size: 1.2rem;
  font-weight: 700;
}
.offline-alert-msg {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (min-width: 768px) {
  button#player-action-rotate {
    display: none;
  }
}
@media (max-width: 768px) {
  .app-header {
    padding: 6px 12px;
    height: 45px;
  }
  .header-middle {
    margin: 0 6px;
  }
  .brand-section {
    gap: 5px;
  }
  .brand-title {
    font-size: 1rem;
  }
  .view-pane {
    padding: 10px 5px 30px 5px;
    height: calc(100vh - 52px);
  }
  .dashboard-hero-container {
    height: 250px;
    margin-bottom: 20px;
  }
  .hero-slide {
    height: 180px;
  }
  .prev-slide .hero-preview-overlay {
    padding: 12px 14px;
    gap: 8px;
  }
  .next-slide .hero-preview-overlay {
    padding: 12px 14px;
    gap: 8px;
  }
  .slider-dots {
    bottom: -45px;
  }
  .hero-preview-poster-thumb {
    width: 52px;
    height: 72px;
  }
  .hero-preview-title {
    font-size: 0.85rem;
    max-width: 100px;
  }
  .hero-preview-info {
    max-width: 105px;
    gap: 4px;
  }
  .hero-content {
    padding: 16px 18px;
  }
  .hero-title {
    font-size: 0.9rem;
  }
  .hero-desc {
    display: none;
  }
  .clock-display {
    display: none;
  }
  .portal-card {
    padding: 10px;
    gap: 5px;
  }
  .portals-container {
    grid-template-columns: 1fr;
  }
  .portal-title {
    font-size: 0.9rem;
  }
  .channels-grid-layout {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 10px;
  }
  .channel-icon-wrapper {
    height: 60px;
  }
  .ftp-posters-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px;
  }
  .ftp-categories-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-input-field {
    width: 110px;
  }
  .desktop-channel-text { display: none; }
  .mobile-channel-text { display: inline; }
  .btn {
    padding: 5px 5px;
    gap: 0px;
  }
  .live-tv-sub-bar {
    padding: 5px 8px;
  }
  .category-pill {
    font-size: 0.8rem;
    padding: 5px 4px;
  }
  .stat-badge {
    padding: 5px 4px;
  }
}

@media (max-width: 640px) {
  .modal-container-card {
    padding: 18px 14px;
    max-height: 92vh;
  }
  .modal-content-box {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }
  .modal-poster-box {
    width: 110px;
    height: 155px;
  }
  .modal-details-box {
    align-items: center;
    width: 100%;
  }
  .modal-meta-stats {
    justify-content: center;
  }
  .modal-episodes-list {
    max-height: 150px;
    justify-content: center;
  }
  .modal-episode-btn {
    padding: 6px 11px;
    font-size: 0.8rem;
  }
}
