/* Netflix-style CSS for FlixNest */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #141414;
  color: #ffffff;
  overflow-x: hidden;
}

/* Mobile-first enhancements */
@media (max-width: 768px) {
  .netflix-header {
    position: fixed;
    background: rgba(10, 10, 10, 0.9);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
  .header-content {
    flex-direction: column;
    gap: 12px;
  }
  .main-nav {
    width: 100%;
    justify-content: space-around;
  }
  .nav-item {
    min-height: 44px;
    flex: 1;
    text-align: center;
  }
  .player-modal, .detail-modal {
    padding: 0;
  }
  .player-container, .detail-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }
  .player-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .player-content video {
    height: 40vh;
    min-height: 250px;
  }
}

/* Header Styles */
.netflix-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  transition: background-color 0.4s ease;
  padding: 0;
  contain: layout style paint;
}

.netflix-header.scrolled {
  background: #141414;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4%;
  max-width: 1920px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: #e50914;
  margin-right: 40px;
  letter-spacing: -1px;
}

.main-nav {
  display: flex;
  gap: 20px;
}

.nav-item {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.3s ease;
  position: relative;
}

.nav-item:hover, .nav-item.active {
  color: #ffffff;
  font-weight: 600;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e50914;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-container {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  border-radius: 4px;
  padding: 8px 12px;
  min-width: 250px;
  position: relative; /* Add relative positioning */
}

.search-container input {
  padding-right: 30px; /* Add padding to prevent text from overlapping the icon */
  background: none;
  border: none;
  color: #ffffff;
  font-size: 14px;
  flex: 1;
  outline: none;
}

.search-container input::placeholder {
  color: #999;
}

.search-container button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  position: absolute; /* Position the button absolutely */
  right: 12px; /* Align to the right */
  top: 50%; /* Center vertically */
  transform: translateY(-50%); /* Adjust for perfect vertical alignment */
}

/* Compact header icons on mobile: keep Search, Cast, Settings in one line */
@media (max-width: 768px) {
  .header-right { align-items: center; gap: 10px; }
  .search-container { background: none; padding: 0; min-width: auto; }
  .search-container input { display: none; }
  .search-container button { position: static; font-size: 20px; padding: 8px; transform: none; }
}

.settings-btn, .cast-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  display: inline-flex; /* Use flexbox for alignment */
  align-items: center; /* Center content vertically */
  justify-content: center; /* Center content horizontally */
}

.settings-btn:hover, .cast-btn:hover {
  background: rgba(255,255,255,0.1);
}

.cast-btn.cast-active {
  color: #19d4b8;
  background: rgba(25,212,184,0.18);
  box-shadow: 0 0 0 1px rgba(25,212,184,0.5);
}
.cast-btn.cast-active:hover {
  background: rgba(25,212,184,0.28);
}

/* Settings Panel */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-panel.hidden {
  display: none;
}

.settings-content {
  background: #1f1f1f;
  border-radius: 8px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-content h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #ffffff;
}

.settings-section {
  margin-bottom: 25px;
}

.settings-section h3 {
  margin-bottom: 10px;
  font-size: 16px;
  color: #ffffff;
}

.settings-section p {
  margin-bottom: 10px;
  color: #b3b3b3;
  font-size: 14px;
}

.settings-section textarea, .settings-section input {
  width: 100%;
  padding: 10px;
  background: #333333;
  border: 1px solid #555555;
  border-radius: 4px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
}

.settings-section textarea {
  resize: vertical;
  min-height: 100px;
}

.settings-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.settings-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b3b3b3;
  font-size: 14px;
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Main Content */
.main-content {
  margin-top: 70px;
  min-height: calc(100vh - 70px);
  /* Ensure the page can scroll on small screens */
  overflow: visible;
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, #141414 0%, transparent 50%, #141414 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 4%;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

.hero-info {
  max-width: 500px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-description {
  font-size: 18px;
  line-height: 1.4;
  color: #ffffff;
  margin-bottom: 25px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 15px;
}

/* Buttons */
.btn-play, .btn-info, .btn-primary, .btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* Full-width buttons on mobile for better tap targets */
@media (max-width: 768px) {
  .btn-primary, .btn-secondary, .btn-play, .btn-info {
    width: 100%;
    min-height: 44px;
  }
  .stream-item .btn-secondary, .stream-item .btn-primary { width: 100%; }
}

.btn-play {
  background: #ffffff;
  color: #000000;
}

.btn-play:hover {
  background: rgba(255,255,255,0.8);
}

.btn-info {
  background: rgba(109, 109, 110, 0.7);
  color: #ffffff;
}

.btn-info:hover {
  background: rgba(109, 109, 110, 0.4);
}

.btn-primary {
  background: #e50914;
  color: #ffffff;
}

.btn-primary:hover {
  background: #b20710;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

/* Content Rows */
.content-rows {
  padding: 0 4%;
  max-width: 1920px;
  margin: 0 auto;
}

.content-row {
  margin-bottom: 40px;
}

.content-row.hidden {
  display: none;
}

.row-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #ffffff;
}

.row-content {
  position: relative;
  overflow: hidden;
}

/* Sentinel element used for infinite scroll detection */
.row-sentinel {
  /* Keep default for search list; rows override inline to be in-flow */
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  height: 100%;
  pointer-events: none;
}

/* Horizontal rows are scroll containers; IO root is the scroller */
.row-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  contain: content;
}

.row-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  contain: content;
}

.row-items::-webkit-scrollbar {
  height: 6px;
}

.row-items::-webkit-scrollbar-track {
  background: transparent;
}

.row-items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

.row-items::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.5);
}

/* Content Item */
.content-item {
  min-width: 220px;
  height: 300px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: #333333;
  will-change: transform;
  transform: translateZ(0);
}

@media (hover: hover) {
  .content-item:hover {
    transform: scale(1.05);
    z-index: 10;
  }
}

.content-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 20px 10px 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-item:hover .content-item-info {
  opacity: 1;
}

.content-item-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}

.content-item-meta {
  font-size: 12px;
  color: #b3b3b3;
}

/* Embed container for Videa and others */
.embed-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: 6px;
  grid-column: 1 / 2;
}
.embed-container.hidden { display: none; }
.embed-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Player Modal */
.player-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.player-modal.hidden {
  display: none;
}

.player-container {
  background: #1f1f1f;
  border-radius: 8px;
  width: 100%;
  max-width: 1400px;
  max-height: 96vh;
  /* Allow vertical scroll inside modal content while preventing horizontal overflow */
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism panel */
.glass-panel {
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #333333;
}

/* Keep X + title on the left in a single row */
.player-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0; /* allows text truncation */
}

.player-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap; /* prevent wrapping under */
}

.close-player {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

.player-title {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw; /* avoid pushing actions to next line */
}

/* On small screens, reduce title max width a bit more */
@media (max-width: 768px) {
  .player-title { max-width: 45vw; }
}

.player-content {
  padding: 20px;
  display: grid;
  grid-template-columns: 2fr 1fr; /* large video area + side panel */
  grid-template-rows: 1fr;
  gap: 20px;
  height: calc(96vh - 72px); /* minus header area inside modal */
  align-items: start;
}

/* video container takes left side */
.player-content video {
  width: 100%;
  height: 100%;
  min-height: 400px;
  max-height: 70vh;
  background: #000000;
  border-radius: 6px;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  object-fit: contain; /* keep aspect ratio */
}

/* Theater mode */
.player-container.theater-mode .player-content {
  grid-template-columns: 1fr;
}
.player-container.theater-mode .player-sidebar {
  grid-column: 1 / 2;
}
.player-container.theater-mode video {
  max-height: 78vh;
}

/* Right side container for info and controls */
.player-sidebar {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  /* Allow scroll in sidebar when content overflows */
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}

/* Mobile layout: stack vertically */
@media (max-width: 900px) {
  .player-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .player-content video {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    height: 40vh;
    min-height: 250px;
  }
  .player-sidebar {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    height: auto;
  }
}

.player-info {
  margin: 0 0 20px 0;
  color: #b3b3b3;
  font-size: 14px;
}

/* Hide old wrappers if moved into collapsibles */
.collapse-section .subtitle-controls h4 { display: none; }

.player-controls {
  flex: 1;
  /* Let controls column scroll if content is taller than viewport */
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0; /* enable child scroll areas */
}

.episode-selectors {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.episode-selectors label { font-size: 14px; color: #e5e5e5; }
.episode-selectors select { background: #333; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 6px 10px; }

/* Collapsible sections */
.collapse-section { border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; background: rgba(255,255,255,0.03); margin-bottom: 12px; overflow: hidden; }
.collapse-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; cursor: pointer; user-select: none; }
.collapse-header h4 { font-size: 16px; margin: 0; }
.collapse-actions { display: flex; gap: 8px; }
.collapse-body { max-height: 0; opacity: 0; transition: max-height 0.25s ease, opacity 0.25s ease; padding: 0 12px; }
.collapse-section.open .collapse-body { max-height: 1000px; opacity: 1; padding: 12px; }

/* Season cards */
.season-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.season-card { position: relative; background: #2a2a2a; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid rgba(255,255,255,0.08); transition: transform 0.2s ease, border-color 0.2s ease; }
.season-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }
.season-card img { width: 100%; height: 64px; object-fit: cover; display: block; }
.season-card .season-label { padding: 6px 8px; font-size: 12px; text-align: center; }
.season-card.active { border-color: #e50914; box-shadow: 0 0 0 1px #e50914 inset; }

/* Smaller season thumbnails */
.season-cards-small { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.season-cards-small .season-card img { height: 56px; }
.season-cards-small .season-card { border-radius: 6px; }
.season-cards-small .season-card .season-label { font-size: 10px; padding: 4px 4px; }

/* Episode grid */
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.episode-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; }
.episode-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }
.episode-thumb { width: 100%; height: 78px; background: #000; object-fit: cover; display: block; }
.episode-info { padding: 8px; }
.episode-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.episode-meta { font-size: 11px; color: #b3b3b3; }
.episode-card.active { border-color: #e50914; box-shadow: 0 0 0 1px #e50914 inset; }

/* Player meta */
.player-meta { font-size: 13px; color: #d1d1d1; display: grid; gap: 6px; }
.player-meta .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.player-meta .label { opacity: .7; }

.stream-selection {
  margin-bottom: 16px;
  overflow: auto;
  flex: 1;
  max-height: calc(100vh - 280px);
}

.stream-selection h4 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.streams-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}

@media (hover: hover) {
  .stream-item:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
  }
}

.stream-info {
  flex: 1;
  margin-right: 12px;
}

.stream-badges {
  display: flex;
  gap: 8px;
  margin: 6px 0 2px;
}

.quality-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
}
.quality-4k { background: rgba(147, 51, 234, 0.25); border-color: rgba(167,139,250,0.35); }
.quality-1080p { background: rgba(16, 185, 129, 0.25); border-color: rgba(110, 231, 183, 0.35); }
.quality-720p { background: rgba(59, 130, 246, 0.25); border-color: rgba(147, 197, 253, 0.35); }
.quality-480p { background: rgba(156, 163, 175, 0.25); border-color: rgba(209, 213, 219, 0.35); }

.provider-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}
.provider-torrentio { background: rgba(244, 63, 94, 0.2); border-color: rgba(244, 63, 94, 0.35); }
.provider-magyaraddon { background: rgba(234, 179, 8, 0.2); border-color: rgba(234, 179, 8, 0.35); }
.provider-webstreamr { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.35); }
.provider-solid { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.35); }
.provider-ncore { background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.35); }
.provider-iptv { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.35); }

.streams-group { display: flex; flex-direction: column; gap: 10px; }
.streams-group-title { font-weight: 600; opacity: .9; margin: 8px 0 2px; }

.stream-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
  color: #ffffff;
}

.stream-meta {
  font-size: 12px;
  color: #b3b3b3;
}

.player-actions {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}

.subtitle-controls {
  border-top: 1px solid #333333;
  padding-top: 20px;
}

.subtitle-controls h4 {
  margin-bottom: 10px;
  font-size: 16px;
}

.subtitle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.subtitle-row input, .subtitle-row select {
  padding: 8px;
  background: #333333;
  border: 1px solid #555555;
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
}

.subtitle-row input {
  flex: 1;
  min-width: 150px;
}

.subtitle-info {
  font-size: 12px;
  color: #b3b3b3;
  margin-top: 5px;
}

/* Detail Modal */
.detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.detail-modal.hidden {
  display: none;
}

.detail-container {
  background: #1f1f1f;
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  /* ensure header stays above background */
  position: relative;
  z-index: 5;
}

.detail-header .detail-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  flex: 1;
  text-align: left;
}

.close-detail {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  transition: background .2s ease;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

.detail-content {
  position: relative;
  padding: 0 20px 20px;
}

.detail-background {
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  height: 200px;
  background-size: cover;
  background-position: center;
  opacity: 0.6;
  border-radius: 8px 8px 0 0;
  /* allow clicks to pass through and keep it behind */
  pointer-events: none;
  z-index: 0;
}

.detail-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,20,20,0.85) 0%, rgba(20,20,20,0.4) 50%, rgba(20,20,20,1) 100%);
  border-radius: inherit;
}

.detail-info {
  position: relative;
  z-index: 1;
  padding-top: 100px;
}

.detail-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
}

.detail-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
  font-size: 14px;
  color: #b3b3b3;
}

.detail-rating {
  background: #e50914;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.detail-description {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
  color: #ffffff;
}

.detail-buttons {
  margin-bottom: 30px;
}

.detail-additional {
  border-top: 1px solid #333333;
  padding-top: 20px;
}

.detail-genres {
  margin-bottom: 15px;
}

.detail-genres strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #b3b3b3;
}

.genre-tag {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

.detail-cast strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #b3b3b3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 10px 3%;
  }

  .logo {
    font-size: 24px;
    margin-right: 20px;
  }

  .main-nav {
    gap: 15px;
  }

  .nav-item {
    font-size: 13px;
  }

  .search-container {
    min-width: 200px;
  }

  .hero-section {
    height: 60vh;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-description {
    font-size: 16px;
  }

  .content-rows {
    padding: 0 3%;
  }

  .content-item {
    min-width: 160px;
    height: 240px;
  }

  .row-title {
    font-size: 20px;
  }

  .subtitle-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subtitle-row input, .subtitle-row select, .subtitle-row button {
    width: 100%;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Sticky sub-controls inside sidebars */
.sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(20,20,20,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.loading {
  color: #b3b3b3;
  text-align: center;
  padding: 40px;
}

/* Simple spinner under the text */
.loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 8px auto 0 auto;
  animation: spin 0.8s linear infinite;
}

.loading .loading-text { margin-top: 6px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  color: #e50914;
  text-align: center;
  padding: 40px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.content-item {
  animation: slideUp 0.3s ease;
}

/* Small button variant */
.btn-xs { padding: 6px 10px; font-size: 12px; }

/* Skeletons */
.skeleton { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 10px; overflow: hidden; position: relative; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); animation: shimmer 1.2s infinite; transform: translateX(-100%); }
.skeleton-line { height: 12px; background: rgba(255,255,255,0.12); border-radius: 6px; margin: 6px 0; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.collapse-section[data-section="sources"] { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.collapse-section[data-section="sources"] .collapse-body { flex: 1; overflow: auto; max-height: none; }

/* Detail selectors horizontal layout fix */
#detailEpisodeSelectors { display:flex; gap:14px; align-items:flex-start; flex-wrap:wrap; }
#detailEpisodeSelectors .season-wrapper { display:flex; flex-direction:column; gap:6px; min-width:140px; }
#detailEpisodeSelectors .season-wrapper > label { margin:0; }
#detailEpisodeSelectors label { font-size:14px; }
#detailSeasonCards { margin-top:4px; }
#detailSeasonCards.season-cards-small { grid-template-columns:repeat(auto-fill,minmax(60px,1fr)); }
#detailSeasonCards.season-cards-small .season-card img { height:50px; }
#detailSeasonCards.season-cards-small .season-card .season-label { font-size:10px; padding:3px 4px; }
.detail-header .close-detail { z-index:40; pointer-events:auto; }

/* One-line horizontal scroll for season thumbnails */
#detailSeasonCards {
  display: flex !important;
  /* Allow wrapping if not fitting in one line */
  flex-wrap: wrap !important;
  overflow-x: visible;
  overflow-y: visible;
  gap: 6px;
  padding-bottom: 4px;
}
#detailSeasonCards::-webkit-scrollbar { height: 6px; }
#detailSeasonCards::-webkit-scrollbar-track { background: transparent; }
#detailSeasonCards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
#detailSeasonCards::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
#detailSeasonCards .season-card { flex: 0 0 60px; }
#detailSeasonCards.season-cards-small .season-card { flex: 0 0 50px; }
