/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0D9B66;
  --bg-color: #0d0d12;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --accent-red: #E50914;
  --accent-gold: #FFD700;
  
  --br-lg: 16px;
  --br-md: 12px;
  --br-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at top right, rgba(13, 155, 102, 0.05), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(13, 155, 102, 0.05), transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-outfit {
  font-family: 'Outfit', sans-serif;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  background: rgba(13, 13, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--surface-border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-left .logo {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.5px;
}

/* Nav Links - Desktop */
.nav-desktop-links {
  display: none; /* hidden on mobile */
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.3s;
}

.nav-link:hover {
  color: white;
}

.nav-link.active {
  color: var(--primary);
}

.nav-right {
  display: flex;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Tabs */
.tabs-container {
  padding: 10px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--surface-border);
}

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

.tab {
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.tab.active {
  color: var(--text-primary);
  font-weight: 700;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(5, 14, 10, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  gap: 4px;
  transition: color 0.3s ease;
}

.bottom-nav-item i {
  font-size: 20px;
}

.bottom-nav-item span {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

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

/* Drawer Overflow Background */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* App Drawer */
.app-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-color);
  z-index: 2001;
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}
.app-drawer.open {
  transform: translateX(280px);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--surface-border);
}
.drawer-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.drawer-links {
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
.drawer-link {
  padding: 15px 25px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: background 0.2s;
}
.drawer-link:hover {
  background: rgba(255,255,255,0.05);
}
.drawer-link.active {
  color: var(--primary);
  background: rgba(13, 155, 102, 0.1);
  border-right: 3px solid var(--primary);
}
.drawer-link i {
  font-size: 22px;
  color: var(--text-secondary);
}
.drawer-link.active i {
  color: var(--primary);
}

/* === Desktop / PC Responsive Menus === */
@media(min-width: 768px) {
  .bottom-nav {
    display: none; /* Hide bottom nav on tablet+ */
  }
  .container {
    padding-bottom: 20px; /* Remove bottom nav spacing */
  }
}

@media(min-width: 1024px) {
  /* Lock drawer to the left */
  .app-drawer {
    left: 0;
    box-shadow: none;
    border-right: 1px solid var(--surface-border);
    transform: none !important; /* Prevent JS translations */
  }
  /* Hide Drawer Overlay completely */
  .drawer-overlay {
    display: none !important;
  }
  /* Hide Hamburger and Close Drawer buttons */
  #hamburger-btn,
  #catalog-hamburger-btn,
  #close-drawer-btn {
    display: none !important;
  }
  /* Push views to the right to make room for fixed sidebar */
  #main-view, #catalog-view {
    margin-left: 280px;
  }
  #detail-view, .bottom-sheet-overlay, #filter-modal-overlay {
    left: 280px !important;
    width: calc(100% - 280px) !important;
  }

  /* Transform Bottom Sheet into a Centered Modal on PC */
  .bottom-sheet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.95) !important;
    width: 500px !important;
    max-width: 90% !important;
    border-radius: 24px !important;
    max-height: 85vh;
    overflow-y: auto;
    margin: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) !important;
    padding: 24px !important;
  }
  .bottom-sheet-overlay.active .bottom-sheet {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1;
    pointer-events: auto;
  }
  .bottom-sheet-drag {
    display: none !important;
  }
}

/* Main Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 80px; /* Space for bottom nav */
}

/* Section Title */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  margin-top: 24px;
}

.section-title .bar {
  width: 4px;
  height: 20px;
  border-radius: 4px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 700;
}

/* Grid Layouts */
.updates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media(min-width: 768px) {
  .updates-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media(min-width: 600px) {
  .movies-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

@media(min-width: 1024px) {
  .movies-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
  }
}

@media(min-width: 1024px) {
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Updates Card (Horizontal/Square) */
.update-card {
  position: relative;
  border-radius: var(--br-lg);
  overflow: hidden;
  aspect-ratio: 1.45;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.update-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.update-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.1); /* To hide blur edges */
}

.update-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
}

.update-card-content {
  position: relative;
  padding: 12px;
  display: flex;
  gap: 12px;
  height: 100%;
}

.update-card-poster {
  height: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--br-sm);
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.update-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.badge-new {
  background: var(--accent-red);
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 4px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.update-title {
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.update-meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.update-translation {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  align-self: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media(min-width: 768px) {
  .badge-new { font-size: 9px; }
  .update-title { font-size: 15px; }
  .update-meta { font-size: 11px; }
  .update-translation { font-size: 10px; }
}

/* ==== Flag Filter Bar ==== */
.flag-filter-list {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.flag-filter-list::-webkit-scrollbar { display: none; }

.flag-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.flag-chip:hover { background: rgba(255,255,255,0.1); color: white; }
.flag-chip.active {
  background: rgba(13,155,102,0.12);
  border-color: var(--primary);
  color: var(--text-primary);
  font-weight: 600;
}
.flag-chip-emoji { font-size: 18px; line-height: 1; }

/* ==== Load More Button ==== */
.load-more-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 24px auto;
  padding: 14px;
  background: rgba(13,155,102,0.1);
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.load-more-btn:hover { background: rgba(13,155,102,0.2); }

/* ==== Top inline loader ==== */
.top-loader {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

/* Rank badge on top-100 cards */
.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 2;
}


/* Base Movie/Series Card */
.movie-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  min-width: 0; /* Critical: prevents nowrap text from breaking grid tracks */
}

.movie-card:hover {
  transform: translateY(-4px);
}

.movie-poster-wrap {
  position: relative;
  aspect-ratio: 0.65;
  border-radius: var(--br-md);
  overflow: hidden;
  background: var(--surface);
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster {
  transform: scale(1.05);
}

.movie-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.movie-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== Detail View Overlay (Flutter Mirror) ==== */
#detail-view {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg-color);
  z-index: 1000;
  overflow-y: auto;
  display: none;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100vh); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.detail-top-nav {
  position: fixed;
  top: 20px; left: 20px;
  z-index: 1010;
}

.detail-header {
  position: relative;
  width: 100%;
}

/* Hero Container */
.detail-hero {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 550px;
  overflow: hidden;
  z-index: 1;
}

.detail-backdrop-wrap {
  position: absolute;
  inset: 0;
}

.detail-backdrop {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(15px);
  transform: scale(1.1);
  opacity: 0.6;
}

.detail-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,13,18,0.2) 0%, rgba(13,13,18,0.8) 50%, var(--bg-color) 100%);
}

/* Layout Container for Poster + Content */
.detail-layout-container {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  align-items: center;
}

.player-active .detail-layout-container {
  padding-top: 20px !important; 
}

/* Floating Poster */
.detail-floating-poster-wrap {
  position: relative;
  width: 60%;
  max-width: 250px;
  aspect-ratio: 2/3;
  border-radius: 15px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.6);
  flex-shrink: 0;
  margin-bottom: 24px;
}

.player-active .detail-floating-poster-wrap {
  display: none;
}

.detail-floating-poster {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 15px;
}

.detail-play-btn-circle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  background: rgba(13, 155, 102, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s;
}

.detail-play-btn-circle:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(13, 155, 102, 1);
}

.detail-play-btn-circle i {
  font-size: 34px; color: white; margin-left: 4px;
}

/* Player iframe container completely replaces everything visually */
.player-container {
  position: relative; /* Stays in flow for mobile but we use absolute for desktop if needed */
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 70vh;
  background: black;
  margin-top: 60px; 
  z-index: 20;
}

/* Player Loading Overlay */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 5;
  gap: 16px;
}

.player-loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.player-loading-text {
  color: rgba(255,255,255,0.7);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0;
}

.player-container iframe {
  width: 100%; height: 100%; border: none;
}

/* Content Area */
.detail-content {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
  text-align: center;
}

.detail-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px;
}

.detail-description {
  font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.7);
}

/* Desktop Responsive Layout */
@media (min-width: 768px) {
  .detail-layout-container {
    flex-direction: row;
    align-items: flex-start;
    padding-top: 80px; 
    padding-bottom: 100px;
    gap: 40px;
  }
  
  
  
  .detail-floating-poster-wrap {
    width: 320px;
    max-width: 320px;
    margin-bottom: 0;
  }
  
  .detail-content {
    flex: 1;
  }
  
  .detail-title {
    text-align: left;
    font-size: 42px;
  }
  
  .detail-meta-row {
    justify-content: flex-start;
    margin-bottom: 24px;
  }
  
  .detail-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 900px;
  }
  
  .player-container {
    max-width: 1200px;
    margin: 80px auto 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  }
}

/* Series Section */
.section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; margin-bottom: 12px;
}

.translations-list {
  display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; 
}
.translations-list::-webkit-scrollbar { height: 6px; }
.translations-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.translation-chip {
  padding: 8px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.05);
  font-size: 11px; color: rgba(255,255,255,0.54);
  white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
}
.translation-chip.active {
  background: rgba(13, 155, 102, 0.1);
  color: var(--text-primary);
  border-color: var(--primary);
  font-weight: bold;
}

/* Episodes List */
.episodes-list {
  display: flex; overflow-x: auto; gap: 12px; padding-bottom: 15px;
  cursor: grab; /* Enable grab cursor */
}
.episodes-list:active { cursor: grabbing; }
.episodes-list::-webkit-scrollbar { height: 8px; }
.episodes-list::-webkit-scrollbar-thumb { background: rgba(13,155,102,0.5); border-radius: 4px; }
.episodes-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }

.episode-card {
  position: relative;
  width: 110px; min-width: 110px; height: 110px;
  border-radius: 12px; overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.05);
  transition: border-color 0.2s;
}
.episode-card.active { border-color: var(--primary); }

.episode-card img { width: 100%; height: 100%; object-fit: cover; }
.episode-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ep-season { font-family: 'Outfit', sans-serif; font-size: 11px; color: rgba(255,255,255,0.7); }
.ep-number { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: bold; }

/* Watch History (Continue Watching) */
.history-list {
  display: flex; overflow-x: auto; gap: 15px; padding-bottom: 15px; cursor: grab;
}
.history-list:active { cursor: grabbing; }
.history-list::-webkit-scrollbar { height: 8px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(13, 155, 102, 0.5); border-radius: 4px; }
.history-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }

.history-card {
  position: relative; width: 220px; min-width: 220px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px; overflow: hidden; display: flex; cursor: pointer;
  padding: 10px; gap: 12px; transition: transform 0.2s, background 0.2s;
}
.history-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.06); }
.history-poster { width: 50px; height: 75px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.history-info { display: flex; flex-direction: column; justify-content: center; flex: 1; overflow: hidden; }
.history-title { font-family: 'Outfit'; font-size: 13px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.history-ep { font-size: 10px; font-weight: bold; color: #FFD700; background: rgba(255, 215, 0, 0.1); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(255, 215, 0, 0.3); align-self: flex-start; margin-bottom: 6px; }
.history-trans { font-size: 11px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-remove { padding: 5px; color: rgba(255, 255, 255, 0.3); background: transparent; border: none; font-size: 18px; cursor: pointer; align-self: center; transition: color 0.2s; }
.history-remove:hover { color: var(--accent-red); }

/* Bottom Sheet */
.bottom-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 2000; display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  width: 100%; max-width: 600px; margin: 0 auto;
  background: var(--bg-color); border-radius: 20px 20px 0 0;
  padding: 15px 20px 30px;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  border-top: 1px solid var(--surface-border);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.bottom-sheet-overlay.active .bottom-sheet { transform: translateY(0); }

.bottom-sheet-drag {
  width: 40px; height: 4px; background: rgba(255,255,255,0.12);
  border-radius: 2px; margin: 0 auto 20px;
}

.player-option {
  display: flex; align-items: center; padding: 15px; border-radius: 12px;
  background: rgba(255,255,255,0.05); margin-bottom: 10px; cursor: pointer;
  transition: background 0.2s;
}
.player-option:hover { background: rgba(255,255,255,0.1); }
.player-option i { font-size: 24px; color: var(--primary); margin-right: 15px; }
.player-option span { font-size: 16px; font-weight: bold; font-family: 'Outfit', sans-serif; }

#loader {
  display: none;
  text-align: center;
  padding: 40px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

/* Load More */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: rgba(13, 155, 102, 0.1);
  border: 1px solid rgba(13, 155, 102, 0.3);
  color: var(--primary);
  text-align: center;
  border-radius: var(--br-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: rgba(13, 155, 102, 0.2);
}

.loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid rgba(13, 155, 102, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

/* ==== Player Selector Bottom Sheet ==== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  background: #1a1a20;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 20px 20px 0 0;
  padding: 15px 20px 30px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

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

.bottom-sheet-drag {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 15px;
}

.player-option {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.player-option:hover {
  background: rgba(13, 155, 102, 0.15);
}

.player-option i {
  font-size: 24px;
  color: var(--primary);
  margin-right: 15px;
}

.player-option span {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

/* ==== Watch on TV Button ==== */
.tv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  margin: 12px 0 20px;
  background: rgba(13, 155, 102, 0.08);
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.tv-btn:hover {
  background: rgba(13, 155, 102, 0.18);
  transform: translateY(-1px);
}
.tv-btn i { font-size: 22px; }

/* ==== TV Modal ==== */
.tv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.tv-modal-overlay.hidden { display: none; }

.tv-modal {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tv-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--surface-border);
}
.tv-modal-header h3 {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0;
}

.tv-modal-body { padding: 20px; }

.tv-modal-instructions {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
}

.tv-code-input {
  width: 100%;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.tv-code-input:focus { border-color: var(--primary); }

/* Hide number input arrows */
.tv-code-input::-webkit-outer-spin-button,
.tv-code-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.tv-modal-error {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.tv-modal-footer {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}
.btn-secondary {
  flex: 1; padding: 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: rgba(255,255,255,0.6);
  font-family: 'Outfit'; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-primary {
  flex: 1; padding: 13px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-family: 'Outfit'; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: background 0.2s, opacity 0.2s;
}
.btn-primary:hover { background: #0aab72; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==== Catalog View ==== */
/* ==== Catalog View ==== */
#catalog-view {
  display: block;
  min-height: 100vh;
}
#catalog-view.hidden {
  display: none !important;
}

.catalog-page-container {
  padding-top: 10px;
}

.search-wrap-app {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 4px;
  transition: border-color 0.2s;
}
.search-wrap-app:focus-within {
  border-color: var(--primary);
}

.search-wrap-app i.bx-search {
  color: var(--text-secondary);
  font-size: 22px;
  margin-left: 12px;
}

.search-wrap-app input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  outline: none;
  font-family: 'Inter', sans-serif;
  min-width: 0;
}

.filter-icon-btn {
  background: rgba(13, 155, 102, 0.15);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  cursor: pointer;
  margin-right: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.filter-icon-btn:hover {
  background: rgba(13, 155, 102, 0.25);
  transform: translateY(-2px);
}

/* ==== Filter Modal Extras ==== */
.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.filter-modal-header h3 { font-family: 'Outfit'; font-size: 20px; }

.filter-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 15px;
}
.filter-modal-body::-webkit-scrollbar { width: 4px; }
.filter-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.filter-modal-footer {
  flex-shrink: 0;
  margin-top: 10px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.filter-section {
  margin-bottom: 24px;
}
.filter-section label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 15px;
}

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

.chip {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.chip.active {
  background: rgba(13, 155, 102, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.filter-row {
  display: flex;
  gap: 12px;
}
.filter-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px;
  color: white;
  outline: none;
  font-family: 'Inter';
}

/* ==== Status Badges (Mobile Parity) ==== */
.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  color: white;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.status-badge.ongoing { background: #4CAF50; } /* Зеленый */
.status-badge.released { background: var(--primary); } /* Изумрудный */
.status-badge.soon { background: #FF9800; } /* Оранжевый */

/* Movie Card Polishing */
.movie-meta {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: -2px;
}

.movie-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  color: #FFD700;
  display: flex;
  align-items: center;
  gap: 3px;
}
.movie-rating i { font-size: 10px; }


