@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-red: #E50914;
  --primary-red-hover: #b80710;
  --bg-black: #0c0c0c;
  --bg-card: #181818;
  --glass-bg: rgba(20, 20, 20, 0.65);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  --text-white: #ffffff;
  --text-grey: #a3a3a3;
  --text-dim: #737373;
  --rating-gold: #ffc107;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-red) rgba(255, 255, 255, 0.05);
}

body {
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-family);
  overflow-x: clip;
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red-hover);
}

/* Visually-hidden but accessible to screen readers and crawlers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

/* App Layout & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.25rem 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

header.scrolled {
  background: rgba(12, 12, 12, 0.98);
  padding: 0.8rem 4%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  color: var(--primary-red);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  text-transform: uppercase;
  background: linear-gradient(to right, #FF1E27, var(--primary-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  touch-action: manipulation;
}

.logo i {
  -webkit-text-fill-color: var(--primary-red);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-grey);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  padding: 0.25rem 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-red);
  transition: var(--transition-smooth);
  transform: translateX(-50%);
}

.nav-link.active::after, .nav-link:hover::after {
  width: 100%;
}

.search-nav-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.search-box-wrapper input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  width: 220px;
  transition: var(--transition-smooth);
}

.search-box-wrapper input:focus {
  width: 320px;
  border-color: var(--primary-red);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.2);
}

.search-box-wrapper i {
  position: absolute;
  left: 0.9rem;
  color: var(--text-grey);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Home Page Content Layout */
main {
  padding-bottom: 5rem;
}

/* Hero Section */
.hero {
  position: relative;
  width: 100%;
  height: 85vh;
  display: flex;
  align-items: center;
  padding: 0 6%;
  background-size: cover;
  background-position: center 20%;
  margin-bottom: 2rem;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(12, 12, 12, 0.9) 20%, rgba(12, 12, 12, 0.3) 60%, rgba(12, 12, 12, 0) 100%),
              linear-gradient(to top, rgba(12, 12, 12, 1) 0%, rgba(12, 12, 12, 0.4) 30%, rgba(12, 12, 12, 0) 70%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

.hero-tag {
  color: var(--primary-red);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #d1d1d1;
}

.hero-rating {
  color: var(--rating-gold);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary {
  background-color: var(--primary-red);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: var(--primary-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

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

.btn-secondary:active {
  transform: scale(0.98);
}

/* Category Filter Bar */
.filter-bar {
  padding: 0 4%;
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

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

.filter-group label {
  font-size: 0.85rem;
  color: var(--text-grey);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Native OS dropdown popup always renders on a light background —
    force dark text so options are readable regardless of theme. */
.filter-select option {
  background: #1a1a1a;
  color: #f0f0f0;
}

.filter-select:focus, .filter-select:hover {
  border-color: var(--primary-red);
  background: rgba(255, 255, 255, 0.05);
}

/* Section Title & Horizontal Slider */
.section-container {
  padding: 0 4%;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background-color: var(--primary-red);
  border-radius: 2px;
}

.slider-wrapper {
  position: relative;
}

.media-slider {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem 1.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.media-slider::-webkit-scrollbar {
  height: 4px;
}

.media-slider::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.media-slider:hover::-webkit-scrollbar-thumb {
  background: var(--primary-red);
}

/* Media Card Item */
.media-card {
  position: relative;
  flex: 0 0 calc(100% / 6.5);
  min-width: 170px;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.media-card:active {
  transform: scale(0.98);
}

@media (max-width: 1024px) {
  .media-card {
    flex: 0 0 calc(100% / 4.5);
  }
}
@media (max-width: 768px) {
  .media-card {
    flex: 0 0 calc(100% / 3.2);
  }
}
@media (max-width: 480px) {
  .media-card {
    flex: 0 0 calc(100% / 2.2);
  }
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.media-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 10px 25px rgba(229, 9, 20, 0.3);
  z-index: 10;
}

.media-card:hover img,
.media-card:active img {
  filter: brightness(0.4);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: 2;
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.card-rating {
  color: var(--rating-gold);
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.card-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  border: 1px solid var(--text-dim);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}

/* Modals System (Details, Torrents, Player) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 1rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
}

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

.modal-content {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  animation: modalScaleUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overscroll-behavior: contain;
}

/* Scrollable Modals Configuration */
#details-modal,
#torrents-modal {
  align-items: flex-start;
  padding-top: 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#details-modal .modal-content,
#torrents-modal .modal-content {
  max-height: none;
  margin: 0 auto;
  overflow: visible;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#details-modal .btn,
#torrents-modal .btn,
.torrent-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

/* Body lock applied while any modal is open */
body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
  transform: scale(1.1);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

/* Details Modal Specifics */
.details-backdrop {
  height: 380px;
  width: 100%;
  position: relative;
  background-size: cover;
  background-position: center 20%;
}

.details-backdrop::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, var(--bg-card) 0%, rgba(24, 24, 24, 0.4) 70%, rgba(24, 24, 24, 0) 100%),
              linear-gradient(to right, rgba(24, 24, 24, 0.8) 10%, rgba(24, 24, 24, 0) 50%);
}

.details-body {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 2rem;
  background: var(--bg-card);
}

@media (max-width: 768px) {
  .details-body {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .details-poster-col {
    display: none;
  }
}

.details-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
}

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

.details-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.details-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-grey);
}

.details-genre-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.details-cast {
  font-size: 0.9rem;
  color: var(--text-white);
}

.details-cast span {
  color: var(--text-grey);
}

/* TV Show Seasons & Episodes Selection */
.tv-series-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.tv-selector-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tv-selector-row select {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-white);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tv-selector-row select option {
  background: #1a1a1a;
  color: #f0f0f0;
}

.episode-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.5rem;
}

.episode-card {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  gap: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.6rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.episode-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.episode-card:active {
  transform: scale(0.98);
}

.episode-still {
  width: 100px;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-black);
}

.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.episode-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.episode-number {
  font-size: 0.75rem;
  color: var(--primary-red);
  font-weight: 700;
  text-transform: uppercase;
}

.episode-desc {
  font-size: 0.8rem;
  color: var(--text-grey);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Torrents Results Modal Specifics */
.torrents-modal-content {
  background: var(--bg-card);
  padding: 2.2rem;
  color: var(--text-white);
  border: 1px solid var(--glass-border);
}

.torrents-header {
  margin-bottom: 1.5rem;
}

.torrents-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.torrents-header p {
  color: var(--text-grey);
  font-size: 0.9rem;
}

.torrents-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.torrent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: var(--transition-smooth);
  gap: 1.5rem;
  flex-wrap: wrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.torrent-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.torrent-item:active {
  transform: translateX(2px) scale(0.99);
}

.torrent-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.torrent-name-display {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
}

.torrent-name-display.expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-all;
}

.torrent-subdetails {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-grey);
  flex-wrap: wrap;
}

.torrent-seeds {
  color: #2ecc71;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.torrent-source {
  text-transform: uppercase;
  color: var(--primary-red);
}

.torrent-actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.torrent-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-white);
  padding: 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  user-select: none;
  -webkit-user-select: none;
}

.torrent-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
}

.torrent-btn:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.torrent-btn-primary {
  background: var(--primary-red);
  border-color: var(--primary-red);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

.torrent-btn-primary:hover {
  background: var(--primary-red-hover);
  box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

.torrent-btn-primary:active {
  transform: scale(0.95);
}

/* Video Player Modal Specifics */
.player-modal-content {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: #000;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 0;
}

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

video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 2rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  -webkit-user-select: none;
  user-select: none;
}

.player-timeline-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-time-display {
  font-size: 0.8rem;
  color: var(--text-white);
  min-width: 40px;
  text-align: center;
}

.player-timeline {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

.player-timeline:hover {
  height: 8px;
}

.player-timeline-progress {
  height: 100%;
  background: var(--primary-red);
  border-radius: 3px;
  position: relative;
  width: 0%;
}

.player-timeline-handle {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--primary-red);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.player-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-left-actions,
.player-right-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.player-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.player-icon-btn:active {
  transform: scale(0.9);
}

.player-stats-toast {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-stats-title {
  font-weight: 700;
  color: var(--primary-red);
}

.player-stats-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-grey);
}

/* Webtor Modal */
.webtor-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  max-width: 500px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2rem;
}

.webtor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.webtor-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.webtor-modal-badges {
  display: flex;
  gap: 0.5rem;
}

.webtor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-grey);
}

.webtor-badge-green {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.2);
}

.webtor-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.webtor-frame-wrapper {
  position: relative;
}

.webtor-status-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.webtor-status-icon {
  font-size: 2rem;
}

.webtor-status-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.webtor-status-sub {
  color: var(--text-grey);
  font-size: 0.9rem;
}

.webtor-progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.webtor-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.webtor-progress-fill {
  height: 100%;
  background: var(--primary-red);
  transition: width 0.3s ease;
}

.webtor-progress-text {
  font-size: 0.8rem;
  color: var(--text-grey);
  min-width: 35px;
}

.webtor-peer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-white);
  font-size: 0.9rem;
}

.webtor-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.webtor-action-btn {
  flex: 1;
  min-width: 120px;
}

.webtor-file-select {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.webtor-file-select label {
  font-size: 0.85rem;
  color: var(--text-grey);
}

.webtor-file-select select {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-white);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: var(--font-family);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.webtor-file-select option {
  background: #1a1a1a;
  color: #f0f0f0;
}

.webtor-loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.webtor-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.webtor-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.webtor-loading-title {
  font-weight: 700;
}

.webtor-loading-sub {
  color: var(--text-grey);
  font-size: 0.9rem;
}

/* Toast Notification System */
.toast-alert {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  z-index: 1000;
  transition: transform 0.3s ease;
  max-width: 90%;
}

.toast-alert.show {
  transform: translateX(-50%) translateY(0);
}

/* Library Section */
.library-section {
  padding: 0 4%;
}

.tabs-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-grey);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 1rem 0;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover, .tab-btn.active {
  color: var(--text-white);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-red);
}

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

.download-card {
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.download-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.download-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-white);
  word-break: break-word;
}

.download-stats-row {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-grey);
  flex-wrap: wrap;
}

.download-progress-bar-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.download-progress-fill {
  height: 100%;
  background: var(--primary-red);
  transition: width 0.3s ease;
}

.download-actions {
  display: flex;
  gap: 0.75rem;
}

/* Search Results Section */
.search-results-section {
  padding: 0 4%;
}

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

/* SEO / Footer Content */
.seo-info {
  padding: 4rem 4%;
  background: linear-gradient(to bottom, rgba(12,12,12,0), rgba(12,12,12,0.5));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 5rem;
}

.seo-info-inner {
  max-width: 900px;
  margin: 0 auto;
}

.seo-info h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.seo-info h2:first-child {
  margin-top: 0;
}

.seo-info p {
  color: var(--text-grey);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.seo-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.seo-feature h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.seo-feature p {
  font-size: 0.9rem;
}

.seo-faq {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.seo-faq details {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.seo-faq details:hover {
  background: rgba(255, 255, 255, 0.05);
}

.seo-faq summary {
  font-weight: 600;
  color: var(--text-white);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.seo-faq p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.site-footer {
  background: linear-gradient(to bottom, rgba(12,12,12,0), rgba(12,12,12,1));
  padding: 3rem 4%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 5rem;
}

.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.site-footer-brand {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(to right, #FF1E27, var(--primary-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-footer-tag {
  color: var(--text-grey);
  font-size: 0.9rem;
}

.site-footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: var(--primary-red);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.site-footer-links a:hover {
  color: var(--primary-red-hover);
  text-decoration: underline;
}

.site-footer-disclaimer {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 1rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
  header {
    padding: 1rem 3%;
  }
  
  .hero {
    padding: 0 3%;
    height: 70vh;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-buttons {
    gap: 0.5rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.75rem 3%;
  }
  
  nav {
    gap: 1rem;
    font-size: 0.85rem;
  }
  
  .search-box-wrapper input {
    width: 160px;
  }
  
  .search-box-wrapper input:focus {
    width: 240px;
  }
  
  .hero {
    height: 60vh;
    padding: 0 3%;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-overview {
    -webkit-line-clamp: 3;
    font-size: 0.9rem;
  }
  
  .hero-buttons {
    gap: 0.5rem;
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }
  
  .section-container {
    padding: 0 3%;
  }
  
  .filter-bar {
    padding: 0 3%;
  }
  
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .modal-overlay {
    padding: 1rem 0;
    align-items: flex-end;
  }
  
  .modal-content {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
  
  .torrents-modal-content {
    padding: 1.5rem;
  }
  
  .torrent-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .torrent-actions-row {
    width: 100%;
    justify-content: flex-start;
  }
  
  .torrent-btn {
    flex: 1;
    min-width: 100px;
  }
  
  .episode-card {
    grid-template-columns: 80px 1fr;
  }
  
  .episode-card button {
    grid-column: 1 / -1;
    width: 100%;
  }
  
  .details-title {
    font-size: 1.5rem;
  }
  
  .player-controls-overlay {
    padding: 2rem 1rem 1rem;
    gap: 0.75rem;
  }
  
  .player-left-actions {
    gap: 0.5rem;
  }
  
  .player-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  
  .seo-info {
    padding: 2rem 3%;
  }
  
  .seo-info h2 {
    font-size: 1.5rem;
  }
  
  .site-footer {
    padding: 2rem 3%;
  }
  
  .downloads-grid {
    grid-template-columns: 1fr;
  }
  
  .toast-alert {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 2%;
  }
  
  nav {
    gap: 0.75rem;
    font-size: 0.75rem;
  }
  
  .search-nav-container {
    width: 100%;
  }
  
  .search-box-wrapper input {
    width: 100%;
  }
  
  .search-box-wrapper input:focus {
    width: 100%;
  }
  
  .hero {
    height: 50vh;
    padding: 0 2%;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-buttons {
    gap: 0.5rem;
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    gap: 0.4rem;
  }
  
  .section-container {
    padding: 0 2%;
    margin-bottom: 2rem;
  }
  
  .filter-bar {
    padding: 0 2%;
    gap: 0.5rem;
  }
  
  .filter-select {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  .media-card {
    min-width: 120px;
  }
  
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .modal-overlay {
    padding: 0;
  }
  
  .modal-content {
    max-height: 100vh;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
  
  .torrents-modal-content {
    padding: 1.25rem;
    border-radius: 16px 16px 0 0;
  }
  
  .modal-close-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
  }
  
  .torrent-item {
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .torrent-details {
    gap: 0.5rem;
  }
  
  .torrent-actions-row {
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .torrent-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.4rem;
    font-size: 0.7rem;
  }
  
  .episode-card {
    grid-template-columns: 70px 1fr;
    gap: 0.75rem;
    padding: 0.5rem;
  }
  
  .episode-still {
    width: 70px;
  }
  
  .episode-name {
    font-size: 0.8rem;
  }
  
  .details-title {
    font-size: 1.3rem;
  }
  
  .details-body {
    padding: 1rem;
    gap: 1rem;
  }
  
  .player-controls-overlay {
    padding: 1.5rem 0.75rem 0.75rem;
    gap: 0.5rem;
  }
  
  .player-timeline-wrapper {
    gap: 0.5rem;
  }
  
  .player-time-display {
    font-size: 0.7rem;
    min-width: 30px;
  }
  
  .player-left-actions {
    gap: 0.25rem;
  }
  
  .player-icon-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  .player-icon-btn i {
    width: 0.9rem;
    height: 0.9rem;
  }
  
  .webtor-modal-content {
    width: 95vw;
    max-height: 85vh;
    padding: 1.5rem;
  }
  
  .webtor-actions {
    flex-direction: column;
  }
  
  .webtor-action-btn {
    width: 100%;
    min-width: auto;
  }
  
  .seo-info {
    padding: 1.5rem 2%;
  }
  
  .seo-info h2 {
    font-size: 1.2rem;
  }
  
  .seo-features {
    grid-template-columns: 1fr;
  }
  
  .site-footer {
    padding: 1.5rem 2%;
  }
  
  .downloads-grid {
    grid-template-columns: 1fr;
  }
  
  .toast-alert {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Utility Classes */
.animate-spin {
  animation: spin 1s linear infinite;
}

.controls-active .player-controls-overlay {
  opacity: 1;
}

.no-controls .player-controls-overlay {
  opacity: 0;
  pointer-events: none;
}
