/* SeoMovies - iOS Chroma / Liquid Glass Theme (transparent) */
:root {
  --accent: #007aff;
  --accent-hover: #5ac8fa;
  --bg-primary: #0a0a0c;
  --bg-secondary: rgba(28, 28, 30, 0.6);
  --bg-tertiary: rgba(44, 44, 48, 0.5);
  --glass-bg: rgba(40, 40, 45, 0.45);
  --glass-bg-light: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-tertiary: rgba(255, 255, 255, 0.55);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --blur: 40px;
  --blur-light: 60px;
  --chroma-filter: blur(var(--blur)) saturate(180%);
  --transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  --scale-hover: scale(1.03);
  --scale-active: scale(0.97);
  --scrollbar-track: rgba(28, 28, 32, 0.15);
  --scrollbar-thumb: rgba(140, 140, 148, 0.45);
  --scrollbar-thumb-hover: rgba(180, 180, 190, 0.65);
}

/* iOS Chrome / Liquid Glass scrollbar */
html,
body,
.modal-content,
.modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

/* Hide scrollbar arrow buttons - iOS style has no arrows */
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
.modal-content::-webkit-scrollbar-button,
.modal-scroll::-webkit-scrollbar-button {
  display: none;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.modal-scroll::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  margin: 4px 0;
  border-radius: 3px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.modal-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
  min-height: 40px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.modal-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--bg-primary) 0%, #121216 50%, var(--bg-primary) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 4%;
  padding-top: max(20px, env(safe-area-inset-top));
  transition: background 0.3s ease;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-right: 8px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-sm);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.navbar.scrolled {
  background: rgba(20, 20, 24, 0.5);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}

.nav-content {
  display: flex;
  align-items: center;
  max-width: 1920px;
  margin: 0 auto;
}

.logo {
  margin-right: 40px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent-hover);
  transition: var(--transition);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-box {
  display: flex;
  align-items: center;
}

.search-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}

.search-btn:hover {
  transform: scale(1.1);
}

.search-btn svg {
  width: 22px;
  height: 22px;
}

.search-input-wrapper {
  display: none;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  margin-left: 12px;
  animation: searchExpand 0.35s ease forwards;
  box-shadow: var(--glass-highlight);
}

.search-input-wrapper.active {
  display: flex;
}

@keyframes searchExpand {
  from { width: 0; opacity: 0; }
  to { width: 260px; opacity: 1; }
}

.search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  padding: 0;
  opacity: 0.8;
}

.search-close:hover {
  opacity: 1;
}

.profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.profile-btn img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-btn:hover img {
  box-shadow: 0 0 0 2px var(--accent);
}

.profile-menu {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 0;
  min-width: 180px;
  display: none;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
}

.profile-dropdown.active {
  display: block;
}

.profile-dropdown #profileSignInContainer,
.profile-dropdown #profileSignOutBtn {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.profile-dropdown #profileSignOutBtn:hover {
  background: var(--glass-bg-light);
}

.profile-signin-link {
  display: block;
  padding: 12px 20px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.profile-signin-link:hover {
  background: var(--glass-bg-light);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding-top: max(70px, calc(env(safe-area-inset-top) + 54px));
}

.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-nav-drawer {
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border-right: 1px solid var(--glass-border);
  padding: 20px 0;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  max-width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: mobileNavSlide 0.3s ease;
}

@keyframes mobileNavSlide {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.mobile-nav-link {
  padding: 16px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--text-primary);
  background: var(--glass-bg-light);
}

/* Hero Section */
.hero {
  position: relative;
  height: 56.25vw;
  min-height: 400px;
  max-height: 90vh;
  overflow-x: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(77deg, rgba(10,10,12,0.5) 0%, transparent 60%),
              linear-gradient(to top, var(--bg-primary) 0%, transparent 45%);
}

.hero-content {
  position: absolute;
  bottom: 25%;
  left: 4%;
  max-width: 40%;
  z-index: 2;
}

.hero-title {
  font-size: clamp(28px, 4vw, 60px);
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  animation: slideUp 0.6s ease 0.2s both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-description {
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.4;
  margin-bottom: 24px;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  animation: slideUp 0.6s ease 0.3s both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero.hero-switching .hero-title,
.hero.hero-switching .hero-description {
  opacity: 0;
  transform: translateY(-8px);
}

.hero-backdrop {
  transition: opacity 0.3s ease;
}

.hero.hero-switching .hero-backdrop {
  opacity: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-actions {
  display: flex;
  gap: 12px;
  animation: slideUp 0.6s ease 0.4s both;
}

.hero-nav {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 3;
  animation: heroNavFadeIn 0.6s ease 0.5s both;
}

@keyframes heroNavFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-nav-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  box-shadow: none;
  filter: none;
}

.hero-nav-btn:hover {
  color: var(--accent);
  transform: scale(1.35);
}

.hero-nav-btn svg {
  width: 28px;
  height: 28px;
  filter: none;
}

.hero-dots {
  display: flex;
  gap: 14px;
  align-items: center;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.hero-dot.active {
  background: white;
  width: 12px;
  height: 12px;
  transform: scale(1.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn svg {
  width: 24px;
  height: 24px;
}

.btn-play {
  background: var(--accent);
  color: white;
}

.btn-play:hover {
  background: var(--accent-hover);
  transform: var(--scale-hover);
}

.btn-play:active {
  transform: var(--scale-active);
}

.btn-info,
.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}

.btn-info:hover,
.btn-secondary:hover {
  background: rgba(60, 60, 65, 0.6);
  border-color: var(--glass-border-strong);
  transform: var(--scale-hover);
}

.btn-secondary.in-list {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14.7vw;
  background: linear-gradient(to top, var(--bg-primary), transparent);
  pointer-events: none;
}

/* Content Rows */
.content-rows {
  padding: 0 4% 80px;
  margin-top: -8vw;
  position: relative;
  z-index: 3;
  overflow: visible;
}

.row {
  margin-bottom: 48px;
}

.row-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.row-container {
  position: relative;
}

.row-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 80px 60px;
  margin: -80px -60px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.row-container {
  overflow: visible;
}

.content-rows {
  overflow: visible;
}

.row {
  overflow: visible;
}

.row-slider::-webkit-scrollbar {
  display: none;
}

.row-empty {
  padding: 80px 60px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.row-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
  box-shadow: none;
  filter: none;
  text-shadow: none;
  outline: none;
}

.row-nav:focus {
  outline: none;
}

.row-nav-left {
  left: 8px;
  background: transparent;
}

.row-nav-right {
  right: 8px;
  background: transparent;
}

.row:hover .row-nav {
  opacity: 1;
}

.row-nav:hover {
  color: var(--accent);
  transform: translateY(-50%) scale(1.5) translateY(-10px);
}

.row-nav svg {
  width: 28px;
  height: 28px;
  filter: none;
  -webkit-filter: none;
  box-shadow: none;
}

/* Movie Cards - portrait (tall) like Netflix */
.movie-card {
  flex: 0 0 auto;
  width: 160px;
  cursor: pointer;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  border-radius: var(--radius-md);
}

.movie-card:hover {
  transform: scale(1.08) translateY(-6px);
  z-index: 5;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.2),
    0 12px 24px rgba(0,0,0,0.25);
}

.movie-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.movie-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 -80px 60px -30px rgba(10,10,12,0.8);
  pointer-events: none;
}

/* Netflix-style ranking overlay (Trending Now) */
.movie-card-ranked {
  overflow: hidden;
}

.movie-card-rank {
  position: absolute;
  left: 4px;
  bottom: 0;
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 0.85;
  color: rgba(255, 255, 255, 0.95);
  -webkit-text-stroke: 2.5px rgba(0, 0, 0, 0.95);
  paint-order: stroke fill;
  font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

/* S badge for non-trending rows (top-left) */
.movie-card-s {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

/* Movie Hover Card - Netflix-style popup */
.movie-hover-card {
  position: fixed;
  width: 320px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #141414;
  box-shadow:
    0 8px 16px rgba(0,0,0,0.4),
    0 24px 48px rgba(0,0,0,0.5),
    0 40px 80px rgba(0,0,0,0.6);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.95) translateY(8px);
}

.movie-hover-card.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.movie-hover-card-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  position: relative;
  box-shadow: inset 0 -80px 50px -20px rgba(10,10,12,0.95);
}

.movie-hover-card-s {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  z-index: 2;
}

.movie-hover-card-title {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  font-size: 20px;
  z-index: 2;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  line-height: 1.1;
}

.movie-hover-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #141414;
}

.movie-hover-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(42,42,42,0.9);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.movie-hover-btn:hover {
  background: rgba(80,80,80,0.9);
  border-color: rgba(255,255,255,0.9);
  transform: scale(1.1);
}

.movie-hover-btn svg {
  width: 20px;
  height: 20px;
}

.movie-hover-play {
  background: #fff !important;
  border-color: #fff !important;
  width: 44px;
  height: 44px;
}

.movie-hover-play svg {
  color: #000;
}

.movie-hover-play:hover {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(255,255,255,0.9) !important;
}

.movie-hover-card-meta {
  padding: 0 14px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #141414;
}

.movie-hover-card-meta .meta-tag {
  padding: 3px 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  font-weight: 600;
}

.movie-hover-card-meta .meta-hd {
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 2px;
  font-size: 11px;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  z-index: 99;
  display: none;
  flex-direction: column;
}

.search-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.search-results {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 70vh;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  margin: 4px 0;
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
  min-height: 40px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.search-result-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--glass-bg-light);
}

.search-result-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.search-result-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.search-result-info span {
  font-size: 12px;
  color: var(--text-tertiary);
}

.search-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  cursor: pointer;
}

.modal-content {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
}

.modal-scroll {
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 3;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-tertiary);
}

.modal-hero {
  position: relative;
  height: 420px;
  min-height: 360px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

/* Blur layer: lower area only, fading up and vanishing */
.modal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 40%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 40%, black 100%);
  pointer-events: none;
}

.modal-hero-s {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  font-family: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}

/* Netflix-style title overlay: gradient blends into theme, title + tags at bottom */
.modal-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 24px 28px;
  background: linear-gradient(
    to top,
    rgba(18, 18, 20, 0.98) 0%,
    rgba(18, 18, 20, 0.85) 20%,
    rgba(18, 18, 20, 0.4) 45%,
    transparent 70%
  );
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  pointer-events: none;
}

.modal-hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 12px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.modal-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-hero-tag {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-body {
  padding: 24px;
}

.modal-description {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.9);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.modal-stream {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

/* Custom player - your own UI */
.custom-player-wrapper {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.custom-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.custom-player-container video {
  width: 100%;
  height: 100%;
  display: block;
}

.custom-player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(18, 18, 20, 0.95);
  border-top: 1px solid var(--glass-border);
}

.custom-player-btn {
  padding: 6px 12px;
  font-size: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.custom-player-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--glass-border-strong);
}

.custom-player-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.custom-player-volume {
  width: 80px;
  height: 6px;
  accent-color: var(--accent);
}

.custom-player-quality-wrap {
  position: relative;
  margin-left: auto;
}

.custom-player-quality-wrap .custom-select-dropdown {
  right: 0;
  left: auto;
  min-width: 100px;
}

.custom-player-quality-wrap.open .custom-select-dropdown {
  display: block;
}

.custom-player-season-ep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass-bg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}

.custom-player-season-ep label {
  font-size: 13px;
  color: var(--text-secondary);
}

.custom-player-season-ep select {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
}

.stream-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.stream-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stream-tip {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.stream-tip strong {
  color: var(--text-secondary);
}

.modal-stream h3 {
  font-size: 18px;
  margin: 0;
}

.stream-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.season-episode-select {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-dub-select,
.language-select,
.cc-select,
.provider-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-dub-select label,
.language-select label,
.cc-select label,
.provider-select label {
  font-size: 13px;
  color: var(--text-secondary);
}

.sub-dub-toggle {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--glass-highlight);
}

.sub-dub-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.sub-dub-btn:hover {
  color: var(--text-primary);
  background: var(--glass-bg-light);
}

.sub-dub-btn.active {
  background: var(--accent);
  color: white;
}

.provider-toggle {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--glass-highlight);
  flex-wrap: wrap;
  gap: 0;
}

.provider-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.provider-btn:hover {
  color: var(--text-primary);
  background: var(--glass-bg-light);
}

.provider-btn.active {
  background: var(--accent);
  color: white;
}

.season-episode-select label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Custom dropdown - glass theme */
.custom-select {
  position: relative;
  min-width: 120px;
}

.custom-select-trigger {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 10px 36px 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%23ffffff'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.custom-select-trigger:hover {
  border-color: var(--glass-border-strong);
  background-color: var(--bg-tertiary);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  z-index: 300;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 180, 190, 0.9) var(--glass-bg);
  isolation: isolate;
}

.custom-select-dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  margin: 4px 2px;
  border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 190, 0.9);
  border-radius: 3px;
  min-height: 40px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(210, 210, 220, 0.95);
}

.custom-select.open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: var(--glass-bg-light);
}

.custom-select-option.selected {
  background: rgba(0, 122, 255, 0.25);
  color: var(--accent);
}

.btn-stream-source {
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glass-highlight);
}

.btn-stream-source:hover {
  background: var(--bg-tertiary);
  border-color: var(--glass-border-strong);
}

.modal-stream iframe {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: var(--radius-md);
}

/* Footer */
.footer {
  padding: 24px 4%;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-poster {
  width: 240px;
  height: 135px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }
  
  .nav-links {
    display: none;
  }
  
  .logo {
    margin-right: 0;
    font-size: 26px;
  }
  
  .navbar {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  
  .nav-actions {
    gap: 12px;
  }
  
  .search-input-wrapper.active {
    position: fixed;
    left: 16px;
    right: 16px;
    top: max(14px, env(safe-area-inset-top));
    width: calc(100% - 32px) !important;
    max-width: none;
    z-index: 110;
    animation: searchExpandMobile 0.25s ease forwards;
  }
  
  @keyframes searchExpandMobile {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .search-overlay {
    top: max(70px, calc(env(safe-area-inset-top) + 54px));
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: none;
  }
  
  .search-results {
    max-height: 60vh;
  }
  
  .hero {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  
  .hero-content {
    max-width: 85%;
    left: max(6%, env(safe-area-inset-left));
  }
  
  .hero-title {
    font-size: clamp(22px, 5.5vw, 32px);
    line-height: 1.2;
  }
  
  .hero-description {
    font-size: 14px;
    -webkit-line-clamp: 2;
    margin-bottom: 16px;
  }
  
  .hero-actions {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
  }
  
  .hero-actions .btn {
    padding: 12px 20px;
    font-size: 14px;
    min-height: 44px;
  }
  
  .hero-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    gap: 12px;
    justify-content: center;
  }
  
  .hero-nav-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .hero-nav-btn svg {
    width: 24px;
    height: 24px;
  }
  
  .hero-dots {
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
  }
  
  .hero-dot {
    width: 8px;
    height: 8px;
  }
  
  .hero-dot.active {
    width: 10px;
    height: 10px;
  }
  
  .movie-card {
    width: 140px;
  }
  
  .movie-card-rank {
    font-size: clamp(2.2rem, 10vw, 4rem);
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.95);
  }
  
  .row-nav {
    display: none;
  }
  
  .row-title {
    font-size: 18px;
  }
  
  .content-rows {
    padding: 24px 4% 48px;
    padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px));
  }
  
  .profile-dropdown {
    right: 0;
    min-width: 200px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 85vh;
    margin: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  
  .modal-scroll {
    max-height: 85vh;
  }
  
  .modal-close {
    top: max(16px, env(safe-area-inset-top));
  }
}

@media (max-width: 480px) {
  .movie-card {
    width: 120px;
  }
  
  .movie-card-rank {
    font-size: clamp(1.8rem, 8vw, 3rem);
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.95);
  }
  
  .hero-content {
    max-width: 92%;
  }
  
  .hero-nav {
    gap: 8px;
    max-width: calc(100% - 24px);
  }
  
  .hero-nav-btn {
    width: 36px;
    height: 36px;
  }
  
  .hero-nav-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Prevent horizontal overflow on mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  
  .app {
    overflow-x: hidden;
  }
}

/* Site notification - bottom left */
.site-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 360px;
  padding: 14px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--chroma-filter);
  -webkit-backdrop-filter: var(--chroma-filter);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
  z-index: 9998;
  pointer-events: auto;
  animation: notificationFadeIn 0.5s ease;
}
@keyframes notificationFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 480px) {
  .site-notification {
    left: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
    font-size: 13px;
    padding: 12px 16px;
  }
}
