/* ============================================================
   StreamVault — style.css
   Dark theme inspired by Cruip Open React Template
   ============================================================ */

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #030712;
  color: #f3f4f6;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.min-h-screen { min-height: 100vh; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.mt-3 { margin-top: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-gray-400 { color: #9ca3af; }
.inline-flex { display: inline-flex; }
.gap-2 { gap: 0.5rem; }

/* ---------- Navbar ---------- */
#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.625rem 1rem;
  background: transparent;
}

.navbar-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  padding: 0 0.75rem;
  border-radius: 1rem;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(55, 65, 81, 0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: -0.02em;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

/* ---------- Search Hero ---------- */
.search-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0 3rem;
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.search-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f9fafb;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.search-subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.search-form {
  width: 100%;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.7);
  border-radius: 0.875rem;
  padding: 0.375rem 0.375rem 0.375rem 1rem;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.search-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 2px 12px rgba(0,0,0,0.3);
}

.search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f3f4f6;
  font-size: 1rem;
  padding: 0.5rem 0;
  min-width: 0;
}

.search-input::placeholder { color: #4b5563; }

.search-btn {
  background: linear-gradient(to bottom, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.97); }

/* ---------- Results ---------- */
.results-section {
  width: 100%;
  max-width: 1152px;
  padding-bottom: 4rem;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}

.results-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) {
  .results-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }
  .card-body {
    padding: 0.5rem 0.625rem 0.625rem;
  }
  .card-title {
    font-size: 0.8125rem;
  }
  .card-year {
    font-size: 0.6875rem;
  }
}

/* ---------- Card ---------- */
.card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 0.875rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.card-poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  background: #111827;
  overflow: hidden;
}

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

.card:hover .card-poster { transform: scale(1.04); }

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  padding: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.4;
}

.card-type-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  backdrop-filter: blur(4px);
}

.badge-movie {
  background: rgba(99, 102, 241, 0.85);
  color: #e0e7ff;
}

.badge-tv {
  background: rgba(16, 185, 129, 0.85);
  color: #d1fae5;
}

.card-body {
  padding: 0.625rem 0.75rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-year {
  font-size: 0.75rem;
  color: #6b7280;
}

/* ---------- Load More ---------- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.load-more-btn {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.6);
  color: #d1d5db;
  padding: 0.625rem 2rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.load-more-btn:hover {
  border-color: #6366f1;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.08);
}

/* ---------- State Messages ---------- */
.state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  color: #6b7280;
  font-size: 0.9375rem;
}

.state-icon {
  width: 64px;
  height: 64px;
  opacity: 0.4;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #0f172a;
  border: 1px solid rgba(55, 65, 81, 0.7);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: slideUp 0.2s ease;
}

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

.modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 10;
  background: rgba(55, 65, 81, 0.6);
  border: none;
  color: #9ca3af;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #f3f4f6;
}

.modal-content {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (max-width: 520px) {
  .modal-content { flex-direction: column; }
}

.modal-poster-wrap {
  flex-shrink: 0;
  width: 140px;
}

@media (max-width: 520px) {
  .modal-poster-wrap { width: 100%; max-width: 160px; }
}

.modal-poster {
  width: 100%;
  border-radius: 0.625rem;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.modal-poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  border: 1px solid rgba(55, 65, 81, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
}

.modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-width: 0;
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
}

.modal-year {
  font-size: 0.875rem;
  color: #6b7280;
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
  line-height: 1.25;
}

.modal-overview {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* TV Controls */
.tv-controls { }

.tv-inputs {
  display: flex;
  gap: 0.75rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.input-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.num-input {
  width: 80px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.6);
  border-radius: 0.5rem;
  color: #f3f4f6;
  padding: 0.4rem 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.num-input:focus { border-color: #6366f1; }

/* Server Select */
.server-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.server-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-select {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.6);
  border-radius: 0.5rem;
  color: #f3f4f6;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s;
  cursor: pointer;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.server-select:focus { border-color: #6366f1; }

/* Warning Banner */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: #fcd34d;
  line-height: 1.5;
}

.warning-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-banner strong { color: #fbbf24; }

/* Modal Actions */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(to bottom, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  padding: 0.625rem 1.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-secondary {
  background: rgba(55, 65, 81, 0.5);
  border: 1px solid rgba(75, 85, 99, 0.5);
  color: #9ca3af;
  border-radius: 0.625rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: rgba(75, 85, 99, 0.5);
  color: #d1d5db;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(31, 41, 55, 0.8);
  padding: 1.25rem 1rem;
}

.footer-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: -0.01em;
}

.footer-copy {
  font-size: 0.8125rem;
  color: #4b5563;
}

.footer-copy a {
  color: #6b7280;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.footer-copy a:hover { color: #9ca3af; }

/* ---------- About Page ---------- */
.about-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f9fafb;
  margin-bottom: 0.5rem;
}

.about-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f3f4f6;
  letter-spacing: -0.01em;
}

.about-card p {
  font-size: 0.9375rem;
  color: #9ca3af;
  line-height: 1.7;
}

.about-link {
  color: #818cf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.about-link:hover { color: #a5b4fc; }

.tmdb-badge {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: rgba(3, 7, 18, 0.5);
  border: 1px solid rgba(55, 65, 81, 0.4);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

.tmdb-logo {
  height: 20px;
  width: auto;
  flex-shrink: 0;
  filter: brightness(0.8);
}

.server-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #9ca3af;
}

.server-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.server-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
}

.server-name {
  font-weight: 600;
  color: #c7d2fe;
}

.about-back {
  margin-top: 0.5rem;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #030712; }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #374151; }
/* ============================================================
   StreamApp — styles.css ADDITIONS
   Player overlay & iframe container
   ============================================================ */

/* ---------- Player Overlay ---------- */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  animation: fadeIn 0.15s ease;
}

.player-box {
  background: #0a0f1e;
  border: 1px solid rgba(55, 65, 81, 0.7);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 1100px;
  max-height: 96vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: slideUp 0.2s ease;
}

/* ---------- Player Header ---------- */
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.4);
  gap: 0.75rem;
  flex-shrink: 0;
}

.player-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.player-thumb {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid rgba(55, 65, 81, 0.5);
  flex-shrink: 0;
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.player-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.player-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-close-btn {
  position: static;
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- 16:9 iframe container ---------- */
.iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  flex-shrink: 0;
}

.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.iframe-spinner {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.7);
  pointer-events: none;
}

/* ---------- Player Controls Bar ---------- */
.player-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  border-top: 1px solid rgba(55, 65, 81, 0.4);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.player-tv-controls {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.player-source-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 180px;
}

.player-source-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-source-select {
  max-width: 320px;
}

.player-newtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
}

@media (max-width: 600px) {
  .player-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .player-source-select { max-width: 100%; }
  .player-newtab-btn { justify-content: center; }
  .player-header { flex-wrap: wrap; }
}
/* ============================================================
   StreamApp — styles.css ADDITIONS
   Media page, episode grid, season tabs, uBlock banner
   ============================================================ */

/* ---------- View Media ---------- */
.view-media {
  width: 100%;
  max-width: 1152px;
  padding-bottom: 3rem;
}

/* ---------- Back Link ---------- */
.media-back-row {
  padding: 1rem 0 0.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  transition: color 0.15s;
  text-decoration: none;
}

.back-link:hover { color: #c7d2fe; }

/* ---------- uBlock Banner ---------- */
.ublock-banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: #fcd34d;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.ublock-link {
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.ublock-link:hover { color: #fde68a; }

.ublock-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: #fcd34d;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.ublock-dismiss:hover { opacity: 1; }

/* ---------- Media Header ---------- */
.media-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.media-poster {
  width: 160px;
  flex-shrink: 0;
  border-radius: 0.75rem;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.media-poster-ph {
  width: 160px;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  border: 1px solid rgba(55, 65, 81, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
}

.media-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding-top: 0.25rem;
}

.media-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
  line-height: 1.2;
}

.media-overview {
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-rating {
  font-size: 0.8125rem;
  color: #fbbf24;
  font-weight: 600;
}

.media-genres {
  font-size: 0.8125rem;
  color: #6b7280;
}

@media (max-width: 580px) {
  .media-header { flex-direction: column; align-items: flex-start; }
  .media-poster { width: 120px; }
  .media-poster-ph { width: 120px; }
  .media-title { font-size: 1.375rem; }
}

/* ---------- Source Row ---------- */
.source-row {
  display: flex;
  align-items: flex-end;
  gap: 0.875rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.source-row-group {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.newtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Player Section ---------- */
.player-section {
  margin-bottom: 1.5rem;
}

.iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(55, 65, 81, 0.4);
}

.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.iframe-spinner {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.7);
  pointer-events: none;
}

/* ---------- Season Tabs ---------- */
.season-tabs-wrap {
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.season-tabs-wrap::-webkit-scrollbar { display: none; }

.season-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.season-tab {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.5);
  color: #9ca3af;
  padding: 0.5rem 1.125rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.season-tab:hover {
  color: #f3f4f6;
  border-color: rgba(99, 102, 241, 0.4);
}

.season-tab-active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #a5b4fc;
}

/* ---------- Episode Grid ---------- */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.875rem;
}

@media (max-width: 400px) {
  .episode-grid { grid-template-columns: 1fr; }
}

.ep-card {
  display: flex;
  gap: 0.875rem;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(55, 65, 81, 0.4);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  padding: 0.625rem;
}

.ep-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.ep-card-active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ep-thumb-wrap {
  position: relative;
  width: 140px;
  flex-shrink: 0;
  aspect-ratio: 16/9;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #111827;
}

.ep-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.ep-number {
  position: absolute;
  bottom: 0.3rem;
  left: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(0,0,0,0.75);
  color: #e5e7eb;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  letter-spacing: 0.03em;
}

.ep-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.125rem 0;
}

.ep-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-desc {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .ep-thumb-wrap { width: 100px; }
}

/* ---------- TV Section ---------- */
.tv-section {
  margin-top: 0.5rem;
}
/* ============================================================
   About Page — additions
   ============================================================ */

/* Two-column layout for Data & Playback cards */
.about-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 520px) {
  .about-two-col { grid-template-columns: 1fr; }
}

/* Source name pills */
.about-source-pill {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 0.5rem;
  padding: 0.25rem 0.625rem;
  letter-spacing: 0.01em;
}

/* Technical card key/value grid */
.about-tech-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.about-tech-row {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.about-tech-key {
  font-weight: 600;
  color: #6b7280;
  min-width: 70px;
  flex-shrink: 0;
}
.about-tech-val {
  color: #9ca3af;
}
/* Fix for mobile "zoomed in" / edge-to-edge issue */
@media (max-width: 600px) {
  /* 1. Ensure the main container doesn't allow horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* 2. Force the hero to stay within the screen with a 1rem gap on each side */
  .search-hero {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  /* 3. Ensure the search bar itself doesn't overflow */
  .search-input-wrap {
    width: 100%;
    margin: 0 auto;
  }

  /* 4. Fix the results grid cutting off */
  .results-section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .results-grid {
    gap: 0.75rem; /* Slightly tighter gap for small screens */
  }
}
/* ============================================================
   StreamApp — Discover, Browse & Genre additions
   Append to the END of css/styles.css
   ============================================================ */

/* ---------- Hero discover link ---------- */
.hero-sub {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}
.hero-discover-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.hero-discover-link:hover { color: #a5b4fc; }

/* ---------- Discover View ---------- */
.view-discover {
  width: 100%;
  max-width: 1152px;
  padding-bottom: 3rem;
}

.discover-header-row {
  padding: 2rem 0 0.75rem;
}

.discover-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
}

/* ---------- Genre Chips ---------- */
.genre-chips-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}
.genre-chips-wrap::-webkit-scrollbar { display: none; }

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

.genre-chip {
  display: inline-block;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.5);
  color: #9ca3af;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.genre-chip:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

/* ---------- Discover Section ---------- */
.discover-section {
  margin-bottom: 2.5rem;
}

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

.discover-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #f3f4f6;
  letter-spacing: -0.01em;
}

.discover-view-all {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6366f1;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.discover-view-all:hover { color: #a5b4fc; }

/* ---------- Horizontal Scroll Row ---------- */
.discover-row-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -0.25rem;
  padding: 0.25rem 0.25rem 0.5rem;
}
.discover-row-wrap::-webkit-scrollbar { display: none; }

.discover-row {
  display: flex;
  gap: 0.75rem;
}

/* ---------- Discover Card ---------- */
.disc-card {
  flex-shrink: 0;
  width: 130px;
  cursor: pointer;
  transition: transform 0.2s;
}
.disc-card:hover { transform: translateY(-3px); }

.disc-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 0.625rem;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(55, 65, 81, 0.4);
  margin-bottom: 0.4rem;
}
.disc-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.disc-card:hover .disc-card-poster img { transform: scale(1.04); }

.disc-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e5e7eb;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.disc-card-year {
  font-size: 0.6875rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

/* ---------- Browse View ---------- */
.view-browse {
  width: 100%;
  max-width: 1152px;
  padding-bottom: 3rem;
}

.browse-back-row {
  padding: 1.5rem 0 0.5rem;
}

.browse-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
  margin-bottom: 1.25rem;
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 600px) {
  .discover-title  { font-size: 1.25rem; }
  .disc-card       { width: 110px; }
  .genre-chips     { flex-wrap: wrap; }
  .discover-section-title { font-size: 0.9375rem; }
  .browse-title    { font-size: 1.125rem; }
}
/* ============================================================
   Continue Watching — Taller & More Compact Cards
   ============================================================ */
.cw-section {
  width: 100%;
  max-width: 900px;
  margin: 0.5rem auto 2rem;
  padding: 0 1rem;
}

.cw-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cw-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.cw-row-wrap {
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for cleaner look */
  -ms-overflow-style: none;
  padding-bottom: 12px;
  margin: 0 -1rem; /* Bleed to edges on mobile */
  padding: 0 1rem 12px;
}

.cw-row-wrap::-webkit-scrollbar {
  display: none;
}

.cw-row {
  display: flex;
  gap: 1rem;
}

/* Card: Taller (120px) and narrower (220px) */
.cw-card {
  flex-shrink: 0;
  width: 220px; 
  cursor: pointer;
  position: relative;
}

.cw-card-inner {
  display: flex;
  position: relative;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid #334155;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  height: 120px; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.cw-card:hover .cw-card-inner {
  border-color: #6366f1;
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.5);
  background: #243146;
}

.cw-poster-col {
  flex-shrink: 0;
  width: 80px; /* Wider poster for the taller height */
  height: 120px;
  overflow: hidden;
  background: #0f172a;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.cw-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

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

.cw-text-col {
  flex: 1;
  min-width: 0; /* Critical for ellipsis to work */
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.cw-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  width: fit-content;
  margin-bottom: 0.2rem;
  background: #334155;
  color: #cbd5e1;
}

/* Title with Ellipsis (...) */
.cw-text-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
  line-height: 1.2;
  width: 100%;
}

.cw-text-sub {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
}

.cw-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.2s;
}

.cw-card:hover .cw-overlay {
  opacity: 1;
}

.cw-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.95);
  color: #f87171;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}

.cw-remove-btn:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.15);
}

@media (max-width: 600px) {
  .cw-card { width: 200px; }
  .cw-card-inner { height: 100px; }
  .cw-poster-col { width: 66px; height: 100px; }
  .cw-text-col { padding: 0.75rem; }
  .cw-text-title { font-size: 0.875rem; }
  .cw-text-sub { font-size: 0.75rem; }
}
/* ============================================================
   Episode Grid — constrained thumbnails with name + description
   ============================================================ */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.875rem;
}

@media (max-width: 400px) {
  .episode-grid { grid-template-columns: 1fr; }
}

.ep-card {
  display: flex;
  gap: 0.875rem;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(55, 65, 81, 0.4);
  border-radius: 0.875rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  padding: 0.65rem;
}

.ep-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.ep-card-active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ep-thumb-wrap {
  position: relative;
  width: 145px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #111827;
}

.ep-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-thumb-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.ep-number {
  position: absolute;
  bottom: 0.25rem;
  left: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(0,0,0,0.75);
  color: #e5e7eb;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  letter-spacing: 0.03em;
}

.ep-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.2rem 0;
}

.ep-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-desc {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .ep-thumb-wrap { width: 105px; }
  .ep-desc { -webkit-line-clamp: 2; }
}
/* ============================================================
   Mobile Media Header — side-by-side layout
   ============================================================ */
.media-poster-col {
  flex-shrink: 0;
}

.media-meta {
  display: flex;
  flex-direction: column;
}

.media-meta-top {
  flex: 1;
  min-height: 0;
}

.media-meta-bottom {
  margin-top: auto;
}

.media-overview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 580px) {
  .media-header {
    flex-direction: row !important;
    align-items: stretch;
    gap: 0.75rem;
  }

  .media-poster-col {
    width: 120px;
  }

  .media-poster,
  .media-poster-ph {
    width: