/* MovieBox Web Styling System */
:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Defaults (Cyberpunk Neon) */
  --bg-dark: #07090e;
  --bg-surface: #0f131d;
  --bg-card: rgba(22, 28, 42, 0.7);
  --bg-card-hover: rgba(30, 39, 58, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 243, 255, 0.3);

  --accent-cyan: #00f3ff;
  --accent-pink: #ff0055;
  --accent-yellow: #ffb703;
  --accent-green: #00e676;
  --accent-purple: #9d4edd;

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-glow: 0 0 25px rgba(0, 243, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Switcher Overrides */
[data-theme="oled"] {
  --bg-dark: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: #121212;
  --bg-card-hover: #1e1e1e;
  --accent-cyan: #3b82f6;
  --accent-pink: #ef4444;
  --border-glow: rgba(59, 130, 246, 0.3);
}

[data-theme="midnight"] {
  --bg-dark: #0b1329;
  --bg-surface: #111c38;
  --bg-card: rgba(23, 37, 71, 0.7);
  --bg-card-hover: rgba(35, 55, 102, 0.95);
  --accent-cyan: #38bdf8;
  --accent-pink: #ec4899;
  --border-glow: rgba(56, 189, 248, 0.3);
}

[data-theme="dracula"] {
  --bg-dark: #1e1f29;
  --bg-surface: #282a36;
  --bg-card: rgba(68, 71, 90, 0.7);
  --bg-card-hover: rgba(98, 101, 126, 0.95);
  --accent-cyan: #8be9fd;
  --accent-pink: #ff79c6;
  --border-glow: rgba(255, 121, 198, 0.3);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-family: var(--font-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-accent {
  color: var(--accent-cyan);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  cursor: pointer;
}

.logo-icon {
  color: var(--accent-cyan);
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.logo-accent {
  color: var(--accent-pink);
  margin-left: 2px;
  font-size: 0.9rem;
  padding: 2px 6px;
  background: rgba(255, 0, 85, 0.15);
  border: 1px solid rgba(255, 0, 85, 0.4);
  border-radius: 4px;
  vertical-align: middle;
}

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

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.2rem 0.6rem 2.5rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 280px;
  transition: var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  width: 360px;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.1);
  transform: translateY(-2px);
}

/* App Main Container */
.app-main {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Server Status Dashboard Card */
.server-status-card {
  background: rgba(15, 19, 29, 0.85);
  border: 1px solid rgba(0, 243, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}

.server-info-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.server-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* View Sections */

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-section.active {
  display: block;
}

/* Resolution & Stream Table Styling */
.resolution-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-top: 1.5rem;
}

.res-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.res-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.res-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

.res-table tr:hover {
  background: rgba(0, 243, 255, 0.05);
}

.res-item-title {
  font-weight: 700;
  font-family: var(--font-primary);
  font-size: 1rem;
  color: #fff;
}

.res-badge-4k {
  background: rgba(255, 183, 3, 0.2);
  color: var(--accent-yellow);
  border: 1px solid var(--accent-yellow);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
}

.res-badge-1080p {
  background: rgba(0, 243, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
}

.res-badge-720p {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-banner {
  position: relative;
  height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-end;
  padding: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-glow);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transition: background-image 0.5s ease-in-out;
  filter: brightness(0.85);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-dark) 0%, rgba(7, 9, 14, 0.7) 40%, rgba(7, 9, 14, 0.1) 100%),
              linear-gradient(90deg, var(--bg-dark) 0%, rgba(7, 9, 14, 0.6) 50%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-tags {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-accent {
  background: rgba(0, 243, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.badge-rating {
  background: rgba(255, 183, 3, 0.2);
  color: var(--accent-yellow);
  border: 1px solid var(--accent-yellow);
}

.badge-year {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-title {
  font-size: 2.8rem;
  line-height: 1.1;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

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

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

.btn-lg {
  padding: 0.85rem 1.8rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 243, 255, 0.5);
  filter: brightness(1.1);
}

.btn-vlc {
  background: linear-gradient(135deg, #ff7a00, #ff5500);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 122, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-vlc:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 122, 0, 0.6);
  filter: brightness(1.15);
}

.btn-vlc-sm {
  background: rgba(255, 122, 0, 0.2);
  color: #ff7a00;
  border: 1px solid #ff7a00;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-vlc-sm:hover {
  background: #ff7a00;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 122, 0, 0.5);
}

.player-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(8px);
}

.player-select option {
  background: #0f131d;
  color: #fff;
}


.btn-secondary {

  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

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

.btn-danger {
  background: rgba(255, 0, 85, 0.2);
  color: var(--accent-pink);
  border: 1px solid var(--accent-pink);
}

.btn-danger:hover {
  background: var(--accent-pink);
  color: #fff;
}

.btn-icon {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-color);
}

.btn-icon:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  background: var(--bg-surface);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.select-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.select-input:focus {
  border-color: var(--accent-cyan);
}

.genre-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.pill.active {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Catalog Sections & Media Grid */
.catalog-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-header h1, .section-header h2 {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.view-all-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.view-all-btn:hover {
  text-decoration: underline;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.5rem;
}

/* Media Card Component */
.media-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  cursor: pointer;
}

.media-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  background: var(--bg-card-hover);
}

.poster-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.poster-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.play-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px var(--accent-cyan);
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.card-rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(6px);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 183, 3, 0.3);
}

.card-quality-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 243, 255, 0.85);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-primary);
}

.card-info {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

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

/* Progress bar for watch history */
.progress-bar-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Live TV Layout */
.livetv-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.tv-category-sidebar {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  height: fit-content;
}

.tv-category-sidebar h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.tv-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tv-cat-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-fast);
}

.tv-cat-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.tv-cat-btn.active {
  background: rgba(0, 243, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.tv-search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.tv-search-box input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.2rem 0.75rem 2.8rem;
  color: #fff;
  font-size: 0.95rem;
}

.tv-search-box i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.tv-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.channel-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.channel-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-cyan);
  overflow: hidden;
  flex-shrink: 0;
}

.channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-details h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.channel-details span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

.glass-card {
  position: relative;
  background: rgba(15, 19, 29, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), var(--shadow-glow);
  z-index: 2;
  animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-sm { max-width: 500px; padding: 2rem; }
.modal-md { max-width: 650px; padding: 2rem; }

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
  transform: rotate(90deg);
}

/* Modal Media Details */
.modal-hero {
  position: relative;
  padding: 2.5rem;
  overflow: hidden;
}

.modal-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(25px) opacity(0.3);
}

.modal-hero-content {
  position: relative;
  display: flex;
  gap: 2rem;
  z-index: 2;
}

.modal-poster-wrap {
  width: 220px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  flex: 1;
}

.modal-info h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.modal-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-seasons-wrapper, .modal-streams-wrapper {
  padding: 2rem;
  border-top: 1px solid var(--border-color);
}

.modal-seasons-wrapper h3, .modal-streams-wrapper h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
}

.season-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 250px;
  overflow-y: auto;
}

.episode-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
}

.episode-item:hover {
  background: rgba(0, 243, 255, 0.1);
  border-left: 3px solid var(--accent-cyan);
}

/* Video Player Modal */
.player-modal {
  padding: 0;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background: #000;
}

.player-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 5;
  background: #000;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

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

.player-back-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

.player-back-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.video-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#video-element {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  outline: none;
}

.video-loading-spinner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-size: 1.2rem;
  color: var(--accent-cyan);
  pointer-events: none;
}

.video-loading-spinner i {
  font-size: 3rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.theme-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-primary);
  font-weight: 600;
}

.theme-card.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.1);
}

.theme-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.cyberpunk-preview { background: linear-gradient(135deg, #00f3ff, #ff0055); }
.oled-preview { background: linear-gradient(135deg, #000000, #3b82f6); }
.midnight-preview { background: linear-gradient(135deg, #0b1329, #38bdf8); }
.dracula-preview { background: linear-gradient(135deg, #282a36, #ff79c6); }

.hidden { display: none !important; }

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.72rem;
  font-family: var(--font-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex: 1;
}

.mobile-nav-btn i {
  font-size: 1.15rem;
  transition: var(--transition-fast);
}

.mobile-nav-btn.active {
  color: var(--accent-cyan);
}

.mobile-nav-btn.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .livetv-layout {
    grid-template-columns: 1fr;
  }
  .modal-hero-content {
    flex-direction: column;
  }
  .modal-poster-wrap {
    width: 160px;
  }
}

@media (max-width: 768px) {
  /* Show Mobile Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Safe bottom padding so content isn't covered by bottom nav */
  body {
    padding-bottom: 74px;
  }

  /* Compact Top Header */
  .app-header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .header-left .nav-links {
    display: none; /* Replaced by bottom nav */
  }

  .logo-text {
    font-size: 1.15rem;
  }

  .header-right {
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
  }

  .search-box {
    flex: 1;
    max-width: 200px;
  }

  .search-box input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.2rem;
    font-size: 0.85rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  /* Server status card */
  .server-status-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
  }

  .server-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .server-actions button {
    flex: 1;
  }

  /* Hero Banner */
  .hero-banner {
    min-height: 340px;
    height: auto;
    padding: 1.5rem 1rem;
    margin: 1rem 0;
  }

  .hero-title {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 0.85rem;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hero-actions .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    flex: 1 1 45%;
  }

  /* Media Grids - 2 to 3 cards per row on mobile */
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 0.75rem;
    padding: 0 0.5rem;
  }

  .card-title {
    font-size: 0.85rem;
  }

  /* Resolution Table Touch Scrolling */
  .resolution-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .res-table {
    min-width: 580px; /* Allow smooth horizontal touch scroll */
  }

  /* Modals on Mobile */
  .modal-dialog {
    width: 95%;
    max-height: 88vh;
    overflow-y: auto;
    margin: 1.5rem auto;
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .modal-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  #modal-poster {
    width: 130px;
    height: auto;
  }

  .modal-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Video Player Modal on Mobile */
  .player-header {
    padding: 0.5rem 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .player-title-info {
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-controls-right {
    gap: 0.4rem;
  }

  #player-pip-btn {
    display: none; /* Hide PiP on small screens */
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.35rem;
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

