:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --cyan: #38bdf8;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 20px;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  flex-wrap: wrap;
  gap: 16px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.logo-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.subtitle code {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* Header Status Pills */
.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--success);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.ip-pill {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.tmdb-pill {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--cyan);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

.dot.ip-dot {
  background-color: var(--accent);
}

.status-pill.offline .dot {
  background-color: var(--danger);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 10px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: var(--accent);
  color: #fff;
}

.badge-outline {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.badge-rating {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.running {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
}

/* ================================================= */
/* OTT WEB VIEW STYLES                              */
/* ================================================= */

/* Hero Banner */
.hero-banner {
  position: relative;
  min-height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.75);
  transition: transform 0.5s ease;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, #0a0d14 0%, rgba(10, 13, 20, 0.85) 45%, rgba(10, 13, 20, 0.3) 100%),
              linear-gradient(90deg, #0a0d14 0%, rgba(10, 13, 20, 0.8) 40%, transparent 80%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-tags {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-overview {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Filter & Search Bar */
.catalog-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(18, 24, 36, 0.6);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.category-main-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.subcategory-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.subcat-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.subcat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.subcat-pill {
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subcat-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.subcat-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  color: #c7d2fe;
  font-weight: 600;
}

.subcat-count {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-muted);
}

.subcat-pill.active .subcat-count {
  background: var(--accent);
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  min-width: 280px;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

/* Media Section & Grid */
.media-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.section-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.media-count-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  min-height: 300px;
}

/* Top Global Shimmer Progress Bar */
.global-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
  background-size: 300% 100%;
  animation: shimmerBar 1.2s infinite linear;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.global-loading-bar.active {
  opacity: 1;
}

@keyframes shimmerBar {
  0% { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

/* Shimmer Wave Animation */
@keyframes shimmerWave {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-wave {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.08) 75%,
    rgba(255, 255, 255, 0.03) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: shimmerWave 1.5s infinite linear !important;
}

/* Skeleton Media Card */
.shimmer-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.shimmer-card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: rgba(255, 255, 255, 0.04);
}

.shimmer-card-meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shimmer-card-title {
  height: 14px;
  width: 80%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.shimmer-card-sub {
  height: 10px;
  width: 50%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

/* Click Feedback Pulse & Loading Glow */
.card-clicked-loading {
  animation: cardClickPulse 1.2s infinite ease-in-out !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 24px var(--accent-glow) !important;
}

@keyframes cardClickPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.96); opacity: 0.85; filter: brightness(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.card-clicked-loading .card-play-overlay {
  opacity: 1 !important;
  background: rgba(15, 23, 42, 0.75) !important;
}

.card-clicked-loading .play-circle {
  transform: scale(1.15) !important;
  background: var(--accent) !important;
  animation: spin 1s infinite linear !important;
}

/* Shimmer Episode Skeleton */
.shimmer-ep-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  margin-bottom: 8px;
}

.shimmer-ep-badge {
  width: 60px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.shimmer-ep-title {
  width: 180px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.shimmer-ep-btn {
  width: 70px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

/* Modal Skeleton Placeholders */
.shimmer-modal-title {
  height: 28px;
  width: 60%;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.shimmer-modal-line {
  height: 14px;
  width: 90%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
}

.shimmer-modal-poster {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.grid-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Media Card */
.media-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--bg-secondary);
  overflow: hidden;
}

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

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

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

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

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

.card-rating-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-type-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(4px);
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.card-meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.card-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Dynamic Configuration Form */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.config-field small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cfg-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.cfg-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-action .cfg-input {
  flex: 1;
}

/* ================================================= */
/* ADMIN VIEW STYLES                                */
/* ================================================= */

.banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius);
  padding: 24px;
  flex-wrap: wrap;
  gap: 20px;
}

.banner-content h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.banner-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.url-box {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 6px 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 12px;
}

.url-box code {
  font-size: 1rem;
  color: var(--cyan);
  font-weight: 600;
}

.banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Split Grid */
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.card-header.flex-wrap {
  flex-wrap: wrap;
}

.subtitle-badge {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.diag-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.diag-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.highlight-ip {
  color: var(--cyan);
  font-weight: 600;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}

.step-num {
  width: 28px;
  height: 28px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--accent);
  color: #a5b4fc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Table */
.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-box input,
.select-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.table-container {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.text-center {
  text-align: center !important;
}

/* Pagination Footer */
.pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-indicator {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0 6px;
}

/* Progress Bar */
.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 100%;
}

.progress-bar-fill.animated {
  animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ================================================= */
/* MODALS                                            */
/* ================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Details Modal Layout */
.modal-hero {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-primary);
}

.modal-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, var(--bg-secondary) 0%, rgba(18, 24, 36, 0.6) 100%);
}

.modal-poster-wrap {
  position: absolute;
  bottom: -30px;
  left: 28px;
  width: 110px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

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

.modal-body {
  padding: 40px 28px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-tags {
  display: flex;
  gap: 8px;
}

.modal-overview {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Series Episodes List & Header */
.series-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-subheading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.season-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.season-tab {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.season-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.season-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.episode-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.episode-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 12px;
}

.episode-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.ep-left-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ep-num-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.ep-title-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-meta-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================================= */
/* HTML5 VIDEO PLAYER MODAL & PLAYLIST               */
/* ================================================= */
.player-modal-overlay {
  padding: 0;
  background: rgba(0, 0, 0, 0.98);
}

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

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.player-title-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-title-texts h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.player-ep-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-up-next-text {
  font-size: 0.85rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.video-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  outline: none;
  background: #000;
}

/* Auto-Play Next Countdown Overlay */
.next-ep-overlay {
  position: absolute;
  bottom: 80px;
  right: 32px;
  z-index: 30;
  animation: slideUp 0.3s ease-out;
}

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

.next-ep-card {
  background: linear-gradient(145deg, rgba(22, 30, 46, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(99, 102, 241, 0.5);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px var(--accent-glow);
  backdrop-filter: blur(16px);
  min-width: 320px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.next-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.next-ep-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.next-ep-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.countdown-badge {
  color: var(--warning);
  font-weight: 800;
  font-size: 1.1rem;
}

.next-ep-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* Video Player Buffering & Error Overlays */
.player-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 15;
  pointer-events: none;
}

.player-loading-overlay .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.player-loading-overlay p {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.player-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  padding: 20px;
}

.player-error-card {
  background: linear-gradient(145deg, rgba(26, 32, 48, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.15);
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  backdrop-filter: blur(20px);
}

.player-error-icon {
  font-size: 2.5rem;
}

.player-error-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.player-error-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.player-error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.player-error-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.stream-mode-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stream-mode-badge:hover {
  background: rgba(99, 102, 241, 0.35);
}

.player-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: rgba(0, 0, 0, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 12px;
  z-index: 20;
}

.player-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.active-toggle {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

.active-toggle.disabled {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 2000;
}

.toast.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* ================================================= */
/* ADMIN SECURE PORTAL & SUBTABS                     */
/* ================================================= */
.admin-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}

.admin-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-shield-icon {
  font-size: 1.8rem;
  background: rgba(99, 102, 241, 0.15);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.admin-subtext {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
}

.admin-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-subnav {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.admin-subtab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-subtab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.admin-subtab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.crawler-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-block {
  width: 100%;
}

.count-pill {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* ================================================= */
/* ADMIN SECURITY AUTH MODAL                         */
/* ================================================= */
.auth-card {
  max-width: 440px;
  padding: 32px;
  background: linear-gradient(145deg, #161e2e, #0f172a);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.2);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-icon-circle {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

.auth-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

