:root {
  --bg-main: #090b10;
  --bg-card: #121622;
  --bg-card-hover: #191f30;
  --bg-translucent: rgba(18, 22, 34, 0.85);
  --accent: #e50914;
  --accent-glow: rgba(229, 9, 20, 0.35);
  --accent-yellow: #f5c518;
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(229, 9, 20, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  padding-bottom: 75px;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #090b10;
}
::-webkit-scrollbar-thumb {
  background: #252d42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #394564;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(180deg, rgba(9, 11, 16, 0.95) 0%, rgba(9, 11, 16, 0.75) 100%);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.brand-logo {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
}

.logo-accent {
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 280px;
  transition: var(--transition-smooth);
}

.search-box input {
  width: 100%;
  background: #141926;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.65rem 2.8rem 0.65rem 1.1rem;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #1a2030;
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.search-btn:hover {
  color: #fff;
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: flex-end;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center 25%;
  transform: scale(1.02);
  transition: background-image 0.5s ease-in-out;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(9, 11, 16, 0.2) 0%,
    rgba(9, 11, 16, 0.65) 50%,
    rgba(9, 11, 16, 1) 100%
  ),
  linear-gradient(90deg, rgba(9, 11, 16, 0.95) 0%, rgba(9, 11, 16, 0.3) 60%, rgba(9, 11, 16, 0.1) 100%);
}

.hero-content {
  position: relative;
  max-width: 750px;
  z-index: 2;
  margin: 0 auto 0 5%;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.8rem;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.meta-rating {
  color: var(--accent-yellow);
}

.meta-hd {
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.hero-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 1.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-primary:hover {
  background: #ff1925;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(229, 9, 20, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(10px);
}

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

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 2.2rem;
  border-radius: 30px;
}

.btn-outline:hover {
  background: #192033;
  border-color: var(--accent);
}

/* Main Layout */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-container {
  margin-bottom: 3.5rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  gap: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.clear-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.clear-btn:hover {
  color: #fff;
  border-color: var(--accent);
}

/* Providers Grid */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.provider-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.provider-card.active {
  border-color: var(--accent);
  background: #1e2436;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.provider-pill {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
}

.provider-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.provider-name.netflix { color: #e50914; font-family: 'Outfit', sans-serif; font-weight: 900; }
.provider-name.prime { color: #00a8e1; }
.provider-name.disney { color: #113ccf; font-weight: 700; }
.provider-name.max { color: #002be7; font-weight: 900; }
.provider-name.apple { color: #e2e8f0; }
.provider-name.paramount { color: #0064ff; }
.provider-name.crunchyroll { color: #f47521; }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Media Card Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem 1.2rem;
}

.media-carousel {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  padding-bottom: 0.8rem;
  scroll-behavior: smooth;
}

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

.media-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}

.poster-wrap {
  position: relative;
  width: 100%;
  padding-top: 150%; /* 2:3 aspect ratio */
  background: #1a2030;
  overflow: hidden;
}

.poster-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
}

.card-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent-yellow);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-play-hover {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 16, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.card-play-circle {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transform: scale(0.8);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.media-card:hover .card-play-hover {
  opacity: 1;
}

.media-card:hover .card-play-circle {
  transform: scale(1);
}

.card-info {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

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

/* Genre Chips */
.genre-chips {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.genre-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.genre-chip:hover {
  background: #1b2235;
  color: #fff;
}

.genre-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Pagination / Load more */
.pagination-actions {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* Modal Player */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.player-dialog {
  position: relative;
  width: 100%;
  max-width: 1020px;
  background: #111520;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  z-index: 10;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  background: #0d101a;
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

.player-title-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-tag {
  background: rgba(229, 9, 20, 0.15);
  color: #ff3344;
  border: 1px solid rgba(229, 9, 20, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  line-height: 1;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover {
  color: #fff;
  transform: rotate(90deg);
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 standard */
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.server-selector-row {
  padding: 0.85rem 1.4rem;
  background: #0f131f;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
}

.server-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.server-buttons {
  display: flex;
  gap: 0.5rem;
}

.server-btn {
  background: #181f30;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.server-btn:hover {
  background: #232c45;
  color: #fff;
}

.server-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tv-controls {
  padding: 0.85rem 1.4rem;
  background: #131826;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.selector-wrap select {
  background: #1d2438;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.player-details {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  max-height: 140px;
}

.overview-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 0.6rem;
}

.player-subinfo {
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 16, 26, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  height: 64px;
  z-index: 99;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition-smooth);
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--accent);
}

/* Footer */
.app-footer {
  margin-top: 5rem;
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  background: #07090d;
}

.footer-wrap {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  font-size: 1.4rem;
}

.footer-notice {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: #fff;
}

.copyright {
  font-size: 0.8rem;
  color: #64748b;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .search-box {
    width: 200px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 600px) {
  .hero-section {
    min-height: 65vh;
    padding: 5rem 1rem 2.5rem;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .hero-content {
    margin: 0;
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.8rem;
  }
  .providers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .search-box {
    width: 170px;
  }
}
