@font-face {
  font-family: 'Peyda';
  src: url('fonts/woff2/PeydaWebFaNum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda';
  src: url('fonts/woff2/PeydaWebFaNum-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda';
  src: url('fonts/woff2/PeydaWebFaNum-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda';
  src: url('fonts/woff2/PeydaWebFaNum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda';
  src: url('fonts/woff2/PeydaWebFaNum-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-app: #080b12;
  --bg-card: rgba(22, 29, 47, 0.7);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --primary: #00d2ff;
  --primary-glow: rgba(0, 210, 255, 0.3);
  --accent-purple: #a855f7;
  --accent-gold: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 24px;
  --transition: all 0.22s ease-in-out;
  --font-family: 'Peyda', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 80px;
}

body[dir="rtl"] { direction: rtl; }
body[dir="ltr"] { direction: ltr; }

/* Top Header (Hidden to maximize viewport space for content) */
.app-header {
  display: none !important;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 24px;
}

.brand-title h1 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-title span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

/* Category Nav Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  font-family: inherit;
}

.tab-pill.active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25), rgba(168, 85, 247, 0.25));
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* Header Actions (Search Toggle + Theme Switch) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.search-toggle-btn:hover, .search-toggle-btn:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.06);
}

.search-toggle-btn.active {
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Search Bar (Collapsible / Toggleable) */
.search-container {
  padding: 10px 14px 12px;
  animation: searchSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 9px 16px 9px 38px;
  color: var(--text-main);
  font-size: 0.86rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-input-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}

.search-clear-btn {
  position: absolute;
  left: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  cursor: pointer;
  padding: 0;
}

/* VIP Banner */
.vip-banner {
  margin: 0 16px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vip-content h3 {
  font-size: 0.95rem;
  color: var(--accent-gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vip-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.vip-btn {
  background: linear-gradient(135deg, var(--accent-gold), #ea580c);
  color: #000;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.media-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.media-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #111726;
  display: block;
}

.media-poster-wrap .media-poster,
.media-poster {
  width: 100%;
  height: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: #111726;
  display: block;
}

.media-poster-date-badge {
  display: none !important;
}

.media-info {
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.media-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.media-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.67rem;
  color: var(--text-muted);
}

.media-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 1.5px 5px;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--accent-gold);
  line-height: 1.25;
  z-index: 4;
  letter-spacing: -0.2px;
}

.media-badge.badge-ongoing {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.media-badge.badge-ended {
  background: rgba(71, 85, 105, 0.92);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.media-badge.badge-coming-soon {
  background: rgba(245, 158, 11, 0.95);
  color: #000;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Modal Sheet for Details */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
}

.sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sheet-content {
  width: 100%;
  background: #101626;
  border-top: 1px solid var(--border-glass);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(80px + env(safe-area-inset-bottom, 24px));
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}


.sheet-overlay.active .sheet-content {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.sheet-poster-img {
  width: 68px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sheet-poster-img:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 210, 255, 0.35);
}

.sheet-header-text {
  flex: 1;
  min-width: 0;
}

.sheet-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.download-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.download-link-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.download-link-item:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.download-btn {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

/* Audio Player for Music */
.audio-player-bar {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Movie Franchise Collection styling */
.collection-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 8px;
  scrollbar-width: thin;
}

.collection-part-card {
  min-width: 105px;
  max-width: 105px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  text-align: center;
}

.collection-part-card:hover, .collection-part-card.active {
  border-color: var(--primary);
  background: rgba(0, 210, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.25);
}

.collection-part-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.collection-part-info {
  padding: 6px 4px;
}

.collection-part-order {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.collection-part-title {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  display: block;
}

.collection-part-year {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Mini App Series Episodes & Season Tabs
   ========================================================================== */
.mini-season-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.mini-season-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.mini-season-pill.active {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #0b0f19;
  border-color: var(--primary);
  font-weight: 700;
}

.mini-episodes-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 70px;
}

.mini-episode-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 7px;
  transition: var(--transition);
}

.mini-episode-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.mini-episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  border-radius: 6px;
  transition: var(--transition);
}

.mini-episode-header:hover {
  opacity: 0.92;
}

.mini-ep-thumb {
  width: 40px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-ep-thumb:hover, .mini-ep-thumb:active {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 210, 255, 0.3);
}

.mini-ep-thumb-fallback {
  width: 40px;
  height: 54px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Lightbox Photo Modal */
.photo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.photo-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.photo-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: photoModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes photoModalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.photo-modal-content img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 210, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.photo-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.photo-modal-close:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.1);
}

.photo-modal-caption {
  margin-top: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  text-align: center;
  direction: rtl;
}

.mini-ep-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  display: inline-block;
}

.mini-ep-count-badge {
  font-size: 0.72rem;
  color: var(--primary);
  background: rgba(0, 210, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.mini-ep-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 5px;
}

.mini-ep-body {
  transition: all 0.2s ease;
}

/* Quality download list in separate clean rows */
.mini-ep-links-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}

.mini-quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-quality-row:hover, .mini-quality-row:active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.14), rgba(99, 102, 241, 0.14));
  border-color: rgba(0, 210, 255, 0.35);
  transform: translateY(-1px);
}

.mini-q-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-q-tag {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.84rem;
}

.mini-q-size {
  color: var(--text-muted);
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
}

.mini-q-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #00d2ff, #3a7bd5);
  color: #000;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.mini-quality-row:hover .mini-q-download-btn {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.4);
}

.mini-q-icon {
  font-size: 0.82rem;
}

/* Horizontal Scrolling Rows */
.section-row-container {
  margin-bottom: 22px;
}

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

.section-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-row-title h2 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin: 0;
}

.section-row-title .count-badge {
  display: none !important;
}

.section-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  font-family: inherit;
}

.section-view-all-btn:hover, .section-view-all-btn:active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.section-scroll-row {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 4px 12px 10px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.section-scroll-row::-webkit-scrollbar {
  display: none;
}

.section-scroll-row .media-card {
  flex: 0 0 114px;
  width: 114px;
  scroll-snap-align: start;
}

/* View All Section Header */
.view-all-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.view-all-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.view-all-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-all-badge {
  font-size: 0.68rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  flex-shrink: 0;
}

.back-to-home-btn:hover, .back-to-home-btn:active {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  border-color: #7dd3fc;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.6);
  transform: translateY(-1px);
}

.back-arrow {
  font-size: 0.85rem;
}

/* ==========================================================================
   In-App Toast Notification
   ========================================================================== */
.app-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  opacity: 0;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  font-family: inherit;
  direction: rtl;
  text-align: right;
}

.app-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.app-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(10, 32, 24, 0.96);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
}

.app-toast.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(38, 16, 20, 0.96);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.25);
}

.app-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(36, 28, 12, 0.96);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-msg {
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Category Filter Chips for Series */
.series-type-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.series-type-chips::-webkit-scrollbar {
  display: none;
}
.type-chip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.type-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.type-chip.active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(168, 85, 247, 0.25));
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* ==========================================================================
   Bottom Navigation Bar & Safe Area
   ========================================================================== */
body {
  padding-bottom: 78px !important;
}

/* Hide VIP Promo Banner per user request */
.vip-banner {
  display: none !important;
}

.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 1000;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.55);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0 6px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item .nav-icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item .nav-tab-label {
  letter-spacing: -0.2px;
  transition: color 0.2s;
}

.bottom-nav-item .nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #080b12;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-item.active .nav-icon-wrap {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 18px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--primary);
}

/* ==========================================================================
   Heart / Favorite Action Buttons
   ========================================================================== */
.card-fav-btn {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-fav-btn:hover, .card-fav-btn:active {
  transform: scale(1.18);
}

.card-fav-btn.is-fav {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

/* Compact Modal Action Row (Favorites + Rating strictly side by side in one row) */
.sheet-compact-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 10px 0 14px 0 !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

.modal-fav-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-radius: 8px !important;
  background: rgba(244, 63, 94, 0.12) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  color: #fda4af !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.modal-fav-btn:hover {
  background: rgba(244, 63, 94, 0.22) !important;
}

.modal-fav-btn.is-fav {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: #f43f5e !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3) !important;
}

/* ==========================================================================
   Categories View Layout
   ========================================================================== */
.categories-container {
  padding: 12px 14px 95px;
}

.categories-header {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.categories-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-card {
  background: linear-gradient(145deg, rgba(22, 29, 47, 0.88), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 13px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.22s;
}

.category-card:hover, .category-card:active {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 14px var(--primary-glow);
}

.category-card:hover::before {
  opacity: 1;
}

.cat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

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

.cat-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 210, 255, 0.14);
  color: var(--primary);
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.cat-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0 4px;
}

.category-card:hover .cat-arrow, .category-card:active .cat-arrow {
  transform: translateX(-3px);
  color: var(--primary);
}

/* ==========================================================================
   Favorites View Layout & Empty State
   ========================================================================== */
.favorites-container {
  padding: 12px 14px 95px;
}

.favorites-header {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.favorites-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fav-empty-box {
  text-align: center;
  padding: 60px 20px 40px;
  background: rgba(22, 29, 47, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  margin-top: 10px;
}

.fav-empty-icon {
  font-size: 3.2rem;
  margin-bottom: 14px;
  display: inline-block;
  animation: pulse-heart 2s infinite ease-in-out;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}

.fav-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.fav-empty-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 290px;
  margin: 0 auto 20px;
}

.fav-empty-btn {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #080b12;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: var(--transition);
}

.fav-empty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

/* 3-Column Grid for Categorized Favorites */
.fav-section {
  margin-bottom: 22px;
}

.fav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.fav-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.fav-section-count {
  font-size: 0.7rem;
  color: var(--primary);
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.25);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.fav-three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.fav-three-col-grid .media-card {
  border-radius: 10px;
}

.fav-three-col-grid .media-info {
  padding: 7px 6px 8px;
  gap: 2px;
}

.fav-three-col-grid .media-title {
  font-size: 0.76rem;
  font-weight: 600;
}

.fav-three-col-grid .media-meta {
  font-size: 0.64rem;
}

.fav-three-col-grid .card-fav-btn {
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  top: 5px;
  left: 5px;
}

.fav-three-col-grid .media-badge {
  font-size: 0.52rem;
  padding: 1px 4px;
  top: 5px;
  right: 5px;
}

.fav-three-col-grid .media-date-tag {
  font-size: 0.56rem;
  padding: 0 3px;
}

/* Subtle date badge for recent episode date */
.media-date-tag {
  font-size: 0.62rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Profile View Layout
   ========================================================================== */
.profile-container {
  padding: 12px 14px 95px;
}

.profile-card {
  background: linear-gradient(145deg, rgba(22, 29, 47, 0.9), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.profile-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-username {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
  direction: ltr;
  text-align: right;
}

.profile-badge {
  display: none !important;
}

.profile-stats-row {
  display: none !important;
}

.profile-menu-list {
  background: rgba(22, 29, 47, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  background: none;
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.2s;
  text-align: inherit;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:hover, .profile-menu-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.menu-item-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.menu-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item-val-pill {
  font-size: 0.72rem;
  color: var(--primary);
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.profile-menu-item.profile-menu-item-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 700;
  border-bottom: none;
}

.profile-menu-item.profile-menu-item-danger:hover,
.profile-menu-item.profile-menu-item-danger:active {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.profile-menu-item.profile-menu-item-danger .menu-item-arrow {
  color: #f87171;
}

/* ==========================================================================
   Series & Episode Rating & Voting System
   ========================================================================== */
.series-rating-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 6px;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.2;
}

.satisfaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
}

.sat-percent {
  font-weight: 700;
  font-size: 0.72rem;
  color: #10b981;
}

.sat-label {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.series-vote-btns {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-vote {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
}

.btn-vote:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-vote.btn-like.voted {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #10b981;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-vote.btn-dislike.voted {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #f43f5e;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

/* Episode Level Vote Buttons */
.ep-vote-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
}

.ep-btn-vote {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.18s ease;
}

.ep-btn-vote:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ep-btn-vote.voted.ep-btn-like {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
}

.ep-btn-vote.voted.ep-btn-dislike {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
  font-weight: 700;
}

/* ==========================================================================
   Modern Switch Toggle for Dark / Light Theme
   ========================================================================== */
.theme-toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 2px;
}

.switch-track {
  position: relative;
  width: 58px;
  height: 30px;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.switch-icon {
  font-size: 13px;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.switch-track .switch-moon {
  opacity: 1;
}

.switch-track .switch-sun {
  opacity: 0.35;
}

.switch-thumb {
  position: absolute;
  top: 2.5px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #0284c7);
  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
}

/* Light Theme Switch state */
[data-theme="light"] .switch-track {
  background: #e2e8f0;
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .switch-track .switch-moon {
  opacity: 0.35;
}

[data-theme="light"] .switch-track .switch-sun {
  opacity: 1;
}

[data-theme="light"] .switch-thumb {
  transform: translateX(27px);
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   Complete Light Theme Overrides
   ========================================================================== */
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-glass: rgba(0, 0, 0, 0.08);
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.25);
  --text-main: #0f172a;
  --text-muted: #64748b;
}

[data-theme="light"],
[data-theme="light"] body {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .brand-title h1 {
  color: #0f172a !important;
}

[data-theme="light"] .brand-title span {
  color: #0284c7 !important;
}

[data-theme="light"] .search-toggle-btn {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .search-toggle-btn.active {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .search-clear-btn {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}

[data-theme="light"] .search-input-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .search-input-box input {
  color: #0f172a !important;
}

[data-theme="light"] .search-input-box input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .section-row-title h2 {
  color: #0f172a !important;
}

[data-theme="light"] .section-view-all-btn {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.2) !important;
  color: #0284c7 !important;
}

[data-theme="light"] .media-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .media-title {
  color: #0f172a !important;
}

[data-theme="light"] .media-meta {
  color: #64748b !important;
}

[data-theme="light"] .app-bottom-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .bottom-nav-item {
  color: #64748b !important;
}

[data-theme="light"] .bottom-nav-item.active {
  color: #0284c7 !important;
}

[data-theme="light"] .sheet-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #sheetTitle {
  color: #0f172a !important;
}

[data-theme="light"] #sheetMeta {
  color: #64748b !important;
}

[data-theme="light"] #sheetDesc {
  color: #334155 !important;
}

[data-theme="light"] .sheet-close {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #334155 !important;
}

[data-theme="light"] .mini-episode-card {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .mini-episode-header {
  background: #f1f5f9 !important;
}

[data-theme="light"] .mini-episode-header strong {
  color: #0f172a !important;
}

[data-theme="light"] .mini-quality-row {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}

[data-theme="light"] .mini-q-tag {
  color: #0284c7 !important;
}

[data-theme="light"] .mini-q-size {
  color: #64748b !important;
}

[data-theme="light"] .profile-card,
[data-theme="light"] .stat-box,
[data-theme="light"] .profile-menu-item {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}

[data-theme="light"] .fav-section {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .category-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .cat-title {
  color: #0f172a !important;
}

[data-theme="light"] .cat-subtitle {
  color: #64748b !important;
}

[data-theme="light"] .series-rating-wrap {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .btn-vote {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #334155 !important;
}

/* ========================================================
   HERO ONGOING BANNER SLIDER (STRICT FIXED HEIGHT)
   ======================================================== */
.hero-banner-slider-container {
  padding: 0 12px;
  margin-top: 8px;
  margin-bottom: 14px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.hero-slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
  border-radius: 14px;
  width: 100%;
  height: 155px;
}

.hero-slider-track::-webkit-scrollbar {
  display: none;
}

.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 155px;
  max-height: 155px;
  min-height: 155px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  user-select: none;
  background: #0f172a;
  box-sizing: border-box;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.02);
  transition: transform 0.4s ease;
  display: block;
}

.hero-slide:hover .hero-slide-bg {
  transform: scale(1.05);
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(10, 14, 26, 0.95) 0%,
    rgba(10, 14, 26, 0.6) 38%,
    rgba(0, 0, 0, 0.1) 70%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
  box-sizing: border-box;
  z-index: 2;
}

.hero-slide-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.hero-slide-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  text-align: right;
}

.hero-slide-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-slide-subtitle {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hero-slide-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: 2px;
}

.hero-slide-action-btn:hover, .hero-slide-action-btn:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5);
}

.hero-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 4px;
}

.hero-slider-dots::-webkit-scrollbar {
  display: none;
}

.hero-slider-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.hero-slider-dot.active {
  width: 16px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* ==========================================================================
   ENHANCED COMPONENTS: SEARCH TAB, 3-COL GRID, CATEGORIES & PROFILE
   ========================================================================== */

/* 1. Home 12-Genre Bar (Hidden per user request) */
.genre-bar-container {
  display: none !important;
}

/* 3-Column Compact Grid for Search and Drama View-All */
.three-col-grid,
.search-tab-results-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}

.three-col-grid .media-card,
.search-tab-results-grid .media-card {
  border-radius: 10px;
}

.three-col-grid .media-info,
.search-tab-results-grid .media-info {
  padding: 6px 5px 7px;
  gap: 2px;
}

.three-col-grid .media-title,
.search-tab-results-grid .media-title {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
}

.three-col-grid .media-meta,
.search-tab-results-grid .media-meta {
  font-size: 0.62rem;
}

.three-col-grid .card-fav-btn,
.search-tab-results-grid .card-fav-btn {
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  top: 4px;
  left: 4px;
}

.three-col-grid .media-badge,
.search-tab-results-grid .media-badge {
  font-size: 0.5rem;
  padding: 1px 4px;
  top: 4px;
  right: 4px;
}

.three-col-grid .media-poster-date-badge,
.search-tab-results-grid .media-poster-date-badge {
  font-size: 0.52rem;
  padding: 1px 3px;
  bottom: 4px;
  right: 4px;
}

.genre-bar-scroll {
  display: none;
}

/* 2. Search Tab View */
.search-tab-view {
  padding: 12px 14px 80px;
}

.search-tab-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(22, 29, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: all 0.2s;
}

.search-tab-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.search-tab-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 13px 10px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}

.search-tab-icon {
  font-size: 1.15rem;
  color: var(--primary);
}

.search-tab-clear-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.quick-genres-section {
  margin-top: 16px;
}

.quick-genres-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.quick-genres-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.quick-genres-scroll::-webkit-scrollbar {
  display: none;
}

.quick-genre-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.quick-genre-chip:active {
  transform: scale(0.95);
  background: rgba(56, 189, 248, 0.18);
}

.recent-searches-section {
  margin-top: 20px;
}

.recent-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.recent-searches-clear-all {
  background: none;
  border: none;
  color: #f87171;
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
}

.recent-searches-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.recent-search-chip:active {
  background: rgba(255, 255, 255, 0.14);
}

.recent-chip-del {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-left: 2px;
  cursor: pointer;
}

.recent-chip-del:hover {
  color: #f87171;
}

.search-results-section {
  margin-top: 20px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.search-results-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.search-results-count {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

.categories-header {
  display: none !important;
}

/* 3. Categories View: 12 Genres Grid (3 Cards Per Row) */
.cat-genres-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.cat-genre-card {
  background: rgba(22, 29, 47, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.cat-genre-card:active {
  transform: scale(0.96);
  background: rgba(30, 41, 67, 0.95);
  border-color: rgba(56, 189, 248, 0.35);
}

.cat-genre-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.cat-genre-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cat-genre-count {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* 4. Profile Tab Enhancements */
.profile-vip-card {
  display: none !important;
}

.profile-theme-row {
  background: rgba(22, 29, 47, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-theme-row:active {
  background: rgba(30, 41, 67, 0.85);
}

.theme-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-row-icon {
  font-size: 1.15rem;
}

.theme-row-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}

.theme-row-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 5. Detail Sheet Backdrop & Badges */
.sheet-poster-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background-size: cover;
  background-position: center top;
  filter: blur(32px) brightness(0.35);
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.sheet-content {
  position: relative;
  overflow-y: auto;
  max-height: 85vh;
}

.sheet-header, .sheet-compact-actions, #sheetDesc, #sheetCrewBox, .download-links-list, #collectionSection {
  position: relative;
  z-index: 1;
}

.sheet-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.sheet-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.sheet-badge.rating {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.sheet-badge.status {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}


