/* Modern Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

:root {
  /* Image-based Nexify palette */
  --bg-primary: #04121d;
  --bg-secondary: #071725;
  --bg-tertiary: #0d2f3d;
  --bg-card: rgba(7, 23, 37, 0.88);
  --bg-card-strong: rgba(13, 47, 61, 0.7);

  --text-primary: #f6ffff;
  --text-secondary: #b6cad2;
  --text-muted: #778e97;

  --accent: #37f8ff;
  --accent-contrast: #04121d;

  --bg-primary-rgb: 4, 18, 29;
  --bg-secondary-rgb: 7, 23, 37;
  --bg-tertiary-rgb: 13, 47, 61;
  --text-primary-rgb: 246, 255, 255;
  --accent-rgb: 55, 248, 255;
  --muted-rgb: 119, 142, 151;

  --surface-soft: rgba(246, 255, 255, 0.05);
  --surface-mid: rgba(246, 255, 255, 0.08);
  --surface-strong: rgba(246, 255, 255, 0.18);
  --accent-soft: rgba(55, 248, 255, 0.12);
  --accent-glow: rgba(55, 248, 255, 0.24);

  --border: rgba(119, 142, 151, 0.22);
  --border-light: rgba(55, 248, 255, 0.22);

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.42);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(55, 248, 255, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1001;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.mobile-menu-toggle:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-card-strong), var(--bg-card));
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 0;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 32px 24px;
  /*border-bottom: 1px solid var(--border);*/
  /*background: var(--bg-secondary);*/
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.logo i {
  font-size: 32px;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-soft);
}

.logo-text {
  transition: opacity 0.25s ease, width 0.25s ease;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.sidebar-toggle i {
  font-size: 20px;
}

.sidebar-toggle:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}

.nav-menu {
  list-style: none;
  padding: 20px 16px;
}

.nav-item {
  margin-bottom: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 12px;
  letter-spacing: -0.01em;
}

.nav-link i {
  font-size: 22px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.nav-link span {
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-soft);
  transform: translateX(4px);
}

.nav-link:hover i {
  transform: scale(1.1);
}

.nav-link.active {
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Main Content */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 92px;
}

.sidebar.collapsed .sidebar-header {
  padding: 24px 16px;
}

.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
}

.sidebar.collapsed .logo {
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-menu {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding-left: 14px;
  padding-right: 14px;
  gap: 0;
}

.sidebar.collapsed .nav-link span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-link:hover {
  transform: none;
}

.sidebar.collapsed .nav-link:hover i {
  transform: scale(1.08);
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar.collapsed + .main-content {
  margin-left: 92px;
}

/* Top Navigation */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  box-shadow: var(--shadow-sm);
}

.search-container {
  position: relative;
  max-width: 600px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.3s ease;
}

.search-input:focus + .search-icon {
  color: var(--accent);
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 52px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-mid);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: rgba(var(--bg-secondary-rgb), 0.98);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  max-height: 450px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
}

.search-results.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--surface-soft);
  position: relative;
}

.search-result-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.search-result-item:hover::before {
  transform: scaleY(1);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--surface-mid);
  padding-left: 24px;
}

.search-result-img {
  width: 55px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.search-result-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.search-result-info p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Content */
.content {
  padding: 40px;
  min-height: calc(100vh - 80px);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 48px;
  color: var(--text-secondary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hero Section with Background Poster */
/* Hero Section with Background Poster */
.hero-section {
  position: relative;
  height: 75vh;
  min-height: 550px;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 48px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
}

.hero-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--bg-primary-rgb), 0.95) 0%,
    rgba(var(--bg-secondary-rgb), 0.72) 50%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 56px;
  gap: 40px;
}

.hero-poster {
  width: 300px;
  height: 450px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-poster:hover {
  transform: translateY(-8px) scale(1.02);
}

.hero-info {
  flex: 1;
  max-width: 750px;
  padding-bottom: 20px;
}

.hero-title {
  font-size: 64px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-primary);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  font-size: 16px;
  flex-wrap: wrap;
}

.hero-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.hero-meta span {
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-tagline {
  font-size: 18px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-weight: 400;
}

.hero-overview {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--surface-mid);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Section */
.section {
  margin-bottom: 60px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.section-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 11px 22px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
 /* background: var(--accent);*/
  opacity: 0;
  transition: opacity 0.4s ease;
}

.filter-btn:hover {
  background: var(--surface-mid);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.filter-btn.active::before {
  opacity: 1;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg-tertiary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-poster {
  transform: scale(1.05);
}

.card-info {
  padding: 18px;
  background: var(--bg-card);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 600;
}

.card-rating i {
  font-size: 14px;
}

.live-channels-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.live-empty-state {
  grid-column: 1 / -1;
  padding: 64px 24px;
  border: 1px dashed var(--border-light);
  border-radius: 18px;
  background: rgba(var(--bg-secondary-rgb), 0.6);
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
}

.live-card {
  overflow: hidden;
}

.live-channel-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 18%, rgba(var(--accent-rgb), 0.22), transparent 32%),
    radial-gradient(circle at 82% 85%, hsla(var(--live-accent), 70%, 60%, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(var(--bg-tertiary-rgb), 0.88), rgba(var(--bg-secondary-rgb), 0.98));
}

.live-channel-cover::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  border: 1px solid rgba(var(--text-primary-rgb), 0.06);
  background: linear-gradient(145deg, rgba(var(--text-primary-rgb), 0.04), rgba(var(--accent-rgb), 0.02));
}

.live-channel-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(var(--bg-primary-rgb), 0.72);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-channel-logo,
.live-channel-fallback {
  position: relative;
  z-index: 2;
}

.live-channel-logo {
  width: 100%;
  max-width: 160px;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.35));
}

.live-channel-fallback {
  width: 118px;
  height: 118px;
  border-radius: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.live-card-info {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.live-card-title {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  min-height: 44px;
}

.live-card-meta {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.live-player-shell {
  background: #000;
}

.live-player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(var(--bg-secondary-rgb), 0.94), rgba(var(--bg-primary-rgb), 0.92));
  border-bottom: 1px solid rgba(var(--text-primary-rgb), 0.08);
}

.live-player-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.live-player-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.live-player-shell video {
  width: 100%;
  height: min(74vh, 820px);
  background: #000;
  display: block;
}

.live-player-error {
  padding: 16px 20px 20px;
  color: #ff8f8f;
  font-size: 13px;
  text-align: center;
}

/* Horizontal Scroll */
.horizontal-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 18px 18px 24px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(var(--bg-secondary-rgb), 0.9), rgba(var(--bg-primary-rgb), 0.96)),
    radial-gradient(circle at top right, var(--accent-soft), transparent 32%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(var(--text-primary-rgb), 0.05), var(--shadow-sm);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.75) rgba(var(--bg-primary-rgb), 0.55);
  position: relative;
}

.horizontal-scroll::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 26%, transparent 72%, rgba(var(--accent-rgb), 0.05));
  pointer-events: none;
  opacity: 0.9;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 10px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: rgba(var(--bg-primary-rgb), 0.58);
  border-radius: 999px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-rgb), 0.55));
  border-radius: 999px;
  border: 2px solid rgba(var(--bg-primary-rgb), 0.65);
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), 0.7));
}

.horizontal-card {
  flex: 0 0 320px;
  background: linear-gradient(180deg, rgba(var(--bg-tertiary-rgb), 0.62), rgba(var(--bg-secondary-rgb), 0.96));
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(var(--text-primary-rgb), 0.05);
}

.horizontal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.18), transparent 30%, transparent 72%, rgba(var(--accent-rgb), 0.08));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.horizontal-card::after {
  content: '';
  position: absolute;
  inset: auto 14px 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.95), transparent);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 2;
}

.horizontal-card:hover {
  transform: translateY(-10px) scale(1.015);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

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

.horizontal-card:hover::after {
  opacity: 1;
  transform: translateY(-6px);
}

.horizontal-card-poster {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.88);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-card:hover .horizontal-card-poster {
  filter: saturate(1.08) brightness(1);
  transform: scale(1.05);
}

.horizontal-card-info {
  padding: 22px 22px 20px;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(var(--text-primary-rgb), 0.06);
  background: linear-gradient(180deg, rgba(var(--bg-tertiary-rgb), 0.16), transparent);
}

.horizontal-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.horizontal-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.horizontal-card-meta i {
  color: var(--accent);
}

/* Details Page */
.details-page {
  position: relative;
  min-height: 100vh;
}

.details-background {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.75) blur(24px);
  opacity: 0.16;
  z-index: -1;
}

.details-container {
  position: relative;
  z-index: 1;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.details-hero {
  display: flex;
  gap: 50px;
  margin-bottom: 60px;
}

.details-poster {
  width: 350px;
  height: 525px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border);
  filter: saturate(0.96);
}

.details-info {
  flex: 1;
}

.details-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -2px;
  line-height: 1.1;
}

.details-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 16px;
  flex-wrap: wrap;
}

.details-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.details-overview {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 800px;
}

.details-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(var(--bg-primary-rgb), 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  background: rgba(var(--bg-secondary-rgb), 0.95);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: rgba(var(--bg-primary-rgb), 0.8);
  border: 2px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

.video-player {
  position: relative;
  background: #000;
}

.video-player iframe {
  width: 100%;
  height: 80vh;
  border: none;
  display: block;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 30px;
  }

  .hero-poster {
    width: 250px;
    height: 375px;
  }

  .hero-info {
    padding: 0;
    max-width: 100%;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-meta {
    justify-content: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .details-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .details-poster {
    width: 100%;
    max-width: 350px;
  }

  .details-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 260px;
  }

  .main-content {
    margin-left: 0;
  }

  .topnav {
    padding: 16px 20px;
  }

  .search-input {
    padding: 14px 18px 14px 50px;
    font-size: 16px;
  }

  .content {
    padding: 24px 20px;
  }

  .hero-section {
    height: auto;
    min-height: 500px;
    border-radius: 16px;
    margin-bottom: 40px;
  }

  .hero-content {
    padding: 30px 20px;
    gap: 24px;
  }

  .hero-poster {
    width: 200px;
    height: 300px;
  }

  .hero-title {
    font-size: 36px;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
  }

  .hero-score {
    width: 60px;
    height: 60px;
    font-size: 18px;
  }

  .hero-meta {
    font-size: 14px;
    gap: 16px;
  }

  .hero-tagline {
    font-size: 16px;
  }

  .hero-overview {
    font-size: 15px;
    -webkit-line-clamp: 4;
  }

  .hero-buttons {
    width: 100%;
  }

  .btn {
    flex: 1;
    min-width: auto;
    padding: 14px 24px;
    font-size: 14px;
  }

  .section {
    margin-bottom: 40px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 24px;
  }

  .section-filter {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .section-filter::-webkit-scrollbar {
    height: 3px;
  }

  .filter-btn {
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 13px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .live-channels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-title {
    font-size: 15px;
  }

  .card-meta {
    font-size: 13px;
    gap: 8px;
  }

  .horizontal-scroll {
    gap: 16px;
    padding-bottom: 16px;
  }

  .horizontal-card {
    flex: 0 0 280px;
  }

  .horizontal-card-poster {
    height: 160px;
  }

  .horizontal-card-info {
    padding: 16px;
  }

  .horizontal-card-title {
    font-size: 16px;
  }

  .horizontal-card-meta {
    font-size: 13px;
    gap: 12px;
  }

  .details-title {
    font-size: 32px;
  }

  .details-meta {
    font-size: 14px;
    gap: 16px;
  }

  .details-overview {
    font-size: 15px;
  }

  .details-buttons {
    width: 100%;
  }

  .video-player iframe {
    height: 60vh;
  }

  .modal-content {
    width: 95vw;
    border-radius: 12px;
  }

  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .topnav {
    padding: 14px 16px;
  }

  .search-input {
    padding: 12px 16px 12px 46px;
    font-size: 15px;
  }

  .search-icon {
    left: 16px;
    font-size: 18px;
  }

  .content {
    padding: 20px 16px;
  }

  .hero-section {
    min-height: 450px;
    border-radius: 12px;
  }

  .hero-content {
    padding: 24px 16px;
  }

  .hero-poster {
    width: 180px;
    height: 270px;
  }

  .hero-title {
    font-size: 28px;
    letter-spacing: -1px;
  }

  .hero-score {
    width: 54px;
    height: 54px;
    font-size: 16px;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 13px;
  }

  .hero-tagline {
    font-size: 15px;
  }

  .hero-overview {
    font-size: 14px;
    line-height: 1.7;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    padding: 14px 20px;
    min-height: 48px;
  }

  .section-title {
    font-size: 22px;
  }

  .filter-btn {
    padding: 9px 16px;
    font-size: 12px;
  }

  .cards-grid {
    gap: 16px;
  }

  .live-channels-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card {
    border-radius: 12px;
  }

  .card-poster {
    border-radius: 12px;
  }

  .card-info {
    padding: 14px 10px;
  }

  .card-title {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .card-meta {
    font-size: 12px;
  }

  .card-rating i {
    font-size: 14px;
  }

  .horizontal-scroll {
    gap: 12px;
  }

  .horizontal-card {
    flex: 0 0 260px;
  }

  .horizontal-card-poster {
    height: 150px;
  }

  .horizontal-card-info {
    padding: 14px;
  }

  .horizontal-card-title {
    font-size: 15px;
  }

  .horizontal-card-meta {
    font-size: 12px;
  }

  .details-title {
    font-size: 26px;
  }

  .details-meta {
    font-size: 13px;
  }

  .details-overview {
    font-size: 14px;
  }

  .details-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .back-button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .video-player iframe {
    height: 50vh;
  }

  .search-results {
    max-height: 300px;
  }

  .search-result-item {
    padding: 12px 16px;
    gap: 12px;
  }

  .search-result-img {
    width: 45px;
    height: 68px;
  }

  .search-result-info h4 {
    font-size: 14px;
  }

  .search-result-info p {
    font-size: 12px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }

  .card:active {
    transform: scale(0.98);
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.97);
  }

  .nav-link:hover {
    background: transparent;
  }

  .nav-link:active {
    background: var(--surface-mid);
  }

  .sidebar.collapsed .nav-link:active {
    transform: scale(0.98);
  }

  .filter-btn:hover {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
  }

  .filter-btn:active {
    background: var(--surface-soft);
  }

  .filter-btn.active:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
  }
}
