/* Color System & Theme Variables */
:root {
  --bg-primary: #141414;
  --bg-surface: #1f1f1f;
  --bg-card: #272727;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --accent-color: #e50914;
  --accent-hover: #f40612;
  --border-color: #333333;
  --nav-bg: rgba(20, 20, 20, 0.98);
}

[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-card: #e5e5ea;
  --text-primary: #1c1c1e;
  --text-secondary: #636366;
  --accent-color: #e50914;
  --accent-hover: #b80710;
  --border-color: #d1d1d6;
  --nav-bg: rgba(255, 255, 255, 0.98);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* 2-Row Navbar */
.navbar {
  display: flex;
  flex-direction: column;
  background-color: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
  width: 100%;
}

.bottom-row {
  border-top: 1px solid var(--border-color);
  padding: 0.4rem 1.5rem;
  background-color: rgba(128, 128, 128, 0.05);
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-brand {
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--accent-color);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(128, 128, 128, 0.2);
}

/* Dropdown Menu & Categories */
.menu-dropdown-container {
  position: relative;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 250px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1100;
}

.menu-dropdown.show {
  display: block;
}

.menu-item-link, .menu-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background-color 0.2s;
  cursor: pointer;
}

.menu-item-link:hover, .menu-item-row:hover {
  background-color: rgba(128, 128, 128, 0.15);
}

.menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

.category-trigger {
  font-weight: 600;
}

.menu-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px 12px 12px 12px;
}

.menu-category-grid a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.menu-category-grid a:hover {
  background-color: rgba(128, 128, 128, 0.2);
}

/* 18+ Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: .3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px; 
  width: 14px;
  left: 3px; 
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* Search Box */
.search-box-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px 8px 2px 14px;
}

.search-box-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 150px;
  transition: width 0.2s ease;
}

.search-box-wrapper input:focus {
  width: 200px;
}

.nav-icon-btn, .theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  color: inherit;
}

.lang-switch select {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

/* Main Content & Shelves */
main#appContent {
  position: relative;
  z-index: 10; /* Ensures content is clickable above the floating bubbles */
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.home-category-section {
  margin: 2rem 1.5rem;
}

.category-header, .category-page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.more-link {
  font-size: 0.85rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.more-link:hover {
  color: var(--accent-hover);
  transform: translateX(4px);
}

.back-home-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

.back-home-btn:hover {
  color: var(--text-primary);
}

/* Responsive Grid */
.movie-shelf-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

@media (min-width: 1300px) { .movie-shelf-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1024px) and (max-width: 1299px) { .movie-shelf-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) and (max-width: 1023px) { .movie-shelf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) {
  .movie-shelf-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
  .nav-row { padding: 0.6rem 0.8rem; }
  .bottom-row { padding: 0.4rem 0.8rem; }
  .nav-left, .nav-right { gap: 0.75rem; }
  .search-box-wrapper input { width: 100px; }
  .search-box-wrapper input:focus { width: 140px; }
  .movie-shelf-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .category-title { font-size: 1.1rem; }
}

/* Movie Card */
.movie-card {
  background-color: var(--bg-surface);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.poster-wrapper {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--bg-card);
  overflow: hidden;
  position: relative;
}
.media-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.poster-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-meta { padding: 8px; }
.movie-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.movie-sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* Pagination */
.pagination-wrapper { text-align: center; margin: 2.5rem 0; }
.load-more-btn {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.load-more-btn:hover { background-color: var(--accent-color); color: #fff; border-color: var(--accent-color); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
}
.modal-body { padding: 1.5rem; }


/* Movie / series details modal */
.movie-detail-layout {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.movie-detail-poster {
  width: 140px;
  aspect-ratio: 2 / 3;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
}
.movie-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.movie-detail-info { flex: 1; min-width: 200px; }
.movie-detail-title { font-size: 1.3rem; margin-bottom: 0.4rem; padding-right: 1.5rem; }
.movie-detail-meta { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.8rem; }
.movie-detail-description { font-size: 0.9rem; line-height: 1.5; color: var(--text-primary); margin-bottom: 1rem; }
.telegram-watch-btn {
  appearance: none;
  border: 1px solid #2AABEE;
  border-radius: 4px;
  background: #2AABEE;
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}
.telegram-watch-btn:hover { background: #168dcc; border-color: #168dcc; }
.telegram-watch-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.series-picker { margin-top: 1rem; }
.series-picker label, .episode-heading { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; }
.series-season-select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.episode-list { display: grid; gap: 7px; max-height: 240px; overflow-y: auto; margin-bottom: 0.8rem; }
.episode-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px;
  border-radius: 6px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
}
.episode-option:hover, .episode-option.selected { border-color: var(--accent-color); background: rgba(229, 9, 20, 0.12); }
.episode-number { color: var(--text-secondary); min-width: 1.5rem; font-size: 0.85rem; }
.episode-name { flex: 1; overflow-wrap: anywhere; font-size: 0.9rem; }
.episode-arrow { color: var(--text-secondary); font-size: 1.25rem; }
.selected-episode-label { color: var(--text-secondary); font-size: 0.8rem; margin: 0 0 0.8rem; }
@media (max-width: 520px) {
  .modal-content { max-height: 92vh; }
  .modal-body { padding: 1.1rem; }
  .movie-detail-poster { width: 100px; }
  .movie-detail-info { min-width: 160px; }
  .telegram-watch-btn { width: 100%; }
}

/* MovieFlix interaction feedback */
.movieflix-action-toast {
  position: fixed;
  z-index: 99999;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px) scale(.96);
  width: max-content;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(25,25,29,.96);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.38);
  font-size: .9rem;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(14px);
}
.movieflix-action-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.tap-feedback { animation: movieflixTap .42s ease; }
@keyframes movieflixTap {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(42,171,238,.5); }
  45% { transform: scale(.965); box-shadow: 0 0 0 8px rgba(42,171,238,0); }
  100% { transform: scale(1); }
}

/* Premium, responsive details dialog */
.modal-overlay { padding: 16px; backdrop-filter: blur(8px); }
.modal-content {
  width: min(920px, 100%);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
}
.modal-body { padding: clamp(16px, 3vw, 28px); }
.movie-detail-layout { display: grid; grid-template-columns: minmax(150px, 245px) minmax(0, 1fr); align-items: start; gap: clamp(18px, 3vw, 30px); }
.movie-detail-poster {
  width: 100%; aspect-ratio: 2 / 3; border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35); position: relative;
}
.movie-detail-poster img { display: block; }
.movie-detail-info { min-width: 0; }
.movie-detail-title { font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.035em; margin: 2px 0 10px; }
.movie-detail-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; line-height: 1.5; margin-bottom: 14px; }
.movie-detail-description { color: var(--text-secondary); font-size: .96rem; line-height: 1.7; margin-bottom: 20px; overflow-wrap: anywhere; }
.series-picker { padding-top: 16px; border-top: 1px solid var(--border-color); }
.series-picker label, .episode-heading { font-size: .88rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.series-season-select { margin-top: 7px; min-height: 44px; font-size: .95rem; }
.episode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 290px; padding: 2px 4px 8px 0; }
.episode-option { min-width: 0; min-height: 48px; border-radius: 10px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.episode-option:active { transform: scale(.98); }
.episode-number { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: rgba(128,128,128,.14); color: var(--text-primary); }
.episode-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.telegram-watch-btn { min-height: 46px; border-radius: 12px; box-shadow: 0 8px 20px rgba(42,171,238,.18); transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
.telegram-watch-btn:hover { filter: brightness(1.06); box-shadow: 0 10px 25px rgba(42,171,238,.28); }
.selected-episode-label { line-height: 1.5; }
.search-state { grid-column: 1 / -1; text-align: center; color: var(--text-secondary); padding: 2rem 1rem; }
.search-error { color: var(--accent-color); }
@media (max-width: 620px) {
  .modal-overlay { padding: 10px; align-items: center; }
  .modal-content { max-height: 94dvh; border-radius: 16px; }
  .movie-detail-layout { grid-template-columns: 96px minmax(0,1fr); gap: 14px; }
  .movie-detail-poster { width: 96px; border-radius: 10px; }
  .movie-detail-title { font-size: 1.15rem; padding-right: 24px; }
  .movie-detail-description { grid-column: 1 / -1; font-size: .9rem; line-height: 1.6; margin-top: 4px; }
  .movie-detail-info { display: contents; }
  .movie-detail-info > .movie-detail-title,
  .movie-detail-info > .movie-detail-meta { grid-column: 2; }
  .movie-detail-info > .movie-detail-description,
  .movie-detail-info > .series-picker,
  .movie-detail-info > .telegram-watch-btn { grid-column: 1 / -1; }
  .series-picker { margin-top: 0; }
  .episode-list { grid-template-columns: 1fr; max-height: 230px; }
  .modal-body { padding: 16px; }
  .telegram-watch-btn { width: 100%; }
  .search-box-wrapper { min-width: 0; max-width: 62vw; }
  .search-box-wrapper input { width: 100px; min-width: 0; }
  .search-box-wrapper input:focus { width: 38vw; }
}
@media (prefers-reduced-motion: reduce) {
  .tap-feedback, .movieflix-action-toast, .telegram-watch-btn, .episode-option { animation: none !important; transition: none !important; }
}

/* Final fixes: keep the full modal scrollable and make feedback visible */
.modal-content {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  max-height: 92vh;
  max-height: 92dvh;
}
.modal-body { min-height: 0; }
.movie-detail-layout { align-items: start; }
.movie-detail-poster { align-self: start; }
.series-poster-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 5px 9px; border-radius: 7px;
  background: rgba(229, 9, 20, .94); color: #fff;
  font-size: .7rem; line-height: 1; font-weight: 800; letter-spacing: .08em;
  box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.episode-list {
  max-height: min(42vh, 360px) !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 3px 6px 10px 0;
}
.episode-option { min-width: 0; gap: 8px; }
.episode-number {
  min-width: 48px; padding: 0 6px; font-size: .72rem;
  font-weight: 800; letter-spacing: .02em; white-space: nowrap;
}
.episode-name { min-width: 0; }
.movieflix-action-toast {
  position: fixed !important;
  top: max(18px, env(safe-area-inset-top)) !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 2147483647 !important;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(25,25,29,.98);
  border-color: rgba(42,171,238,.55);
  box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 0 1px rgba(42,171,238,.12);
}
.movieflix-action-toast.show { animation: movieflixToastIn .22s ease-out both; }
@keyframes movieflixToastIn {
  from { opacity: 0; transform: translate(-50%, -10px) scale(.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@media (max-width: 620px) {
  .modal-overlay { align-items: center; padding: 8px; }
  .modal-content { max-height: 94vh; max-height: 94dvh; }
  .movie-detail-layout { grid-template-columns: 82px minmax(0,1fr); gap: 12px; }
  .movie-detail-poster { width: 82px; }
  .episode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 38vh !important; }
  .episode-option { padding: 8px 6px; gap: 6px; }
  .episode-number { min-width: 42px; font-size: .67rem; }
}

/* Compact episode picker: four EP buttons per row */
.episode-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  max-height: min(42vh, 360px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.episode-option {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 7px 4px !important;
  gap: 0 !important;
  text-align: center !important;
}
.episode-number {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  padding: 4px 1px !important;
  background: transparent !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
}
.episode-name, .episode-arrow { display: none !important; }
@media (max-width: 620px) {
  .episode-list { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .episode-option { min-height: 40px !important; padding: 5px 2px !important; }
  .episode-number { font-size: .72rem !important; }
}

/* MovieFlix AI metadata additions */
.poster-wrapper { position: relative; }
.movie-rating-badge { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 4px 7px; border-radius: 5px; background: rgba(15, 15, 15, .88); color: #ffd166; font-size: 12px; font-weight: 700; line-height: 1.2; }
.movie-detail-rating { color: #ffd166; font-size: .88rem; font-weight: 700; margin: 0 0 .45rem; }
.movie-detail-cast { color: var(--text-secondary); font-size: .85rem; line-height: 1.4; margin: 0 0 .8rem; }

.poster-wrapper .media-type-badge { left: auto; right: 8px; }
.movie-detail-poster .series-poster-badge { left: auto; right: 10px; }

.movie-detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  min-width: 0;
}
.movie-detail-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--accent-color);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.movie-detail-type-movie { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.movie-detail-badges .movie-detail-rating {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  color: #ffd166;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.4;
}
.movie-detail-rating small {
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 500;
}
.movie-detail-badges .movie-detail-rating-unavailable {
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 500;
}
.movie-detail-cast { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
.movie-detail-meta { min-width: 0; overflow-wrap: anywhere; }
.movie-detail-title { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .modal-overlay { align-items: flex-start; padding: max(8px, env(safe-area-inset-top)) 8px 8px; }
  .modal-content { width: 100%; max-height: 94vh; max-height: 94dvh; margin: 0 auto; }
  .modal-body { padding: 16px; }
  .movie-detail-layout {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 10px 12px;
  }
  .movie-detail-poster { width: 88px; grid-column: 1; grid-row: 1 / span 3; }
  .movie-detail-info { display: contents; }
  .movie-detail-info > .movie-detail-title { grid-column: 2; grid-row: 1; align-self: start; font-size: clamp(1.05rem, 4.5vw, 1.25rem); line-height: 1.22; margin: 0; padding-right: 22px; }
  .movie-detail-info > .movie-detail-meta { grid-column: 2; grid-row: 2; align-self: start; margin: 0; font-size: .76rem; line-height: 1.45; }
  .movie-detail-info > .movie-detail-badges { grid-column: 2; grid-row: 3; align-self: start; margin: 0; gap: 5px; }
  .movie-detail-badges .movie-detail-rating { font-size: .82rem; }
  .movie-detail-rating small { display: none; }
  .movie-detail-info > .movie-detail-cast,
  .movie-detail-info > .movie-detail-description,
  .movie-detail-info > .series-picker,
  .movie-detail-info > .telegram-watch-btn {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .movie-detail-info > .movie-detail-cast { margin: 8px 0 4px; font-size: .86rem; line-height: 1.55; }
  .movie-detail-info > .movie-detail-description { margin: 4px 0 14px; font-size: .9rem; line-height: 1.6; }
  .series-picker { margin-top: 0; }
  .episode-list { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .episode-option { min-height: 40px !important; padding: 5px 2px !important; }
  .episode-number { font-size: .72rem !important; }
  .telegram-watch-btn { width: 100%; }
}

/* ========================================= */
/* TABBED INFO MODALS (HELP & CONTACT)       */
/* ========================================= */
.info-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.2rem;
}
.info-tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.info-tab-btn:hover {
  color: var(--text-primary);
}
.info-tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}
.contact-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, background 0.2s;
}
.contact-link-btn:hover {
  border-color: var(--accent-color);
  background: rgba(229, 9, 20, 0.1);
}
.report-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.report-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* ========================================= */
/* VISUAL EFFECTS (ICONS, STARS, POPS)       */
/* ========================================= */
#visualEffectsBg {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.12; /* Subtle opacity so it doesn't distract from the movies */
}

/* Moving Icon & Number Columns */
.bg-column {
  position: absolute;
  top: 0;
  width: 40px;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.8;
  font-weight: bold;
  font-size: 16px;
  word-break: break-all;
}

.move-up { animation: scrollUp linear infinite; }
.move-down { animation: scrollDown linear infinite; }

/* The text is duplicated in JS, so sliding it by 50% creates a perfect infinite loop */
@keyframes scrollUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
@keyframes scrollDown {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

/* Cursor Touch/Mouse Stars - BIGGER AND LONGER */
.cursor-star {
  position: fixed;
  pointer-events: none;
  color: #FFD700;
  font-size: 26px; /* Increased from 14px to 26px */
  text-shadow: 0 0 12px rgba(255, 215, 0, 1);
  z-index: 99999;
  animation: starFade 1.2s ease-out forwards; /* Increased from 0.6s to 1.2s */
}
@keyframes starFade {
  0% { transform: scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: scale(2.2) rotate(180deg); opacity: 0; }
}

/* Tab Click Bubble Pop */
.click-pop-bubble {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  z-index: 999999;
  transform: translate(-50%, -50%);
  animation: bubblePop 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes bubblePop {
  0% { width: 10px; height: 10px; opacity: 1; }
  100% { width: 100px; height: 100px; opacity: 0; }
}
