* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #3b0000, #5a0000, #8a0000);

  color: white;
  overflow-x: hidden;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Erick Spinning Face */
.erick-spin-wrapper {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    position: relative;
}

.erick-spin {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: spin 4s linear infinite;
    object-fit: cover;
    border: 4px solid red; 
}

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


.spinner {
  border: 4px solid rgba(102, 204, 255, 0.2);
  border-top: 4px solid #ff2c2c;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  margin-top: 15px;
  font-size: 16px;
  color: #ff2c2c;
}

/* Error Message */
.error-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ff6b6b;
  color: white;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Header */
header {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  gap: 20px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 40px;
  width: auto;
}

header h1 {
  margin: 0;
  font-size: 28px;
  color: #ff2c2c;
  font-weight: bold;
  transition: all 0.3s ease;
}

header h1:hover {
  text-shadow: 0 0 20px rgba(102, 204, 255, 0.8);
  transform: scale(1.05);
}

#searchBar {
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid #ff2c2c;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  flex: 1;
  min-width: 200px;
  max-width: 350px;
  transition: all 0.3s ease;
}

#searchBar:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(102, 204, 255, 0.5);
}

#searchBar::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid transparent;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: rgba(102, 204, 255, 0.2);
  border-color: #ff2c2c;
}

.nav-btn.active {
  background: #ff2c2c;
  color: #0f2027;
  border-color: #ff2c2c;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Sections */
section {
  padding: 30px 20px;
}

h2 {
  margin: 0 0 15px 0;
  color: #ff2c2c;
  font-size: 22px;
}

.movie-row {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
}

.movie-row::-webkit-scrollbar {
  height: 8px;
}

.movie-row::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.movie-row::-webkit-scrollbar-thumb {
  background: #ff2c2c;
  border-radius: 10px;
}

/* Movie Card */
.movie-card {
  min-width: 130px;
  max-width: 130px;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1c1c;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.movie-card:hover {
  transform: scale(1.08);
  box-shadow: 0px 8px 20px rgba(102, 204, 255, 0.3);
}

.movie-card.selected {
  box-shadow: 0px 0px 20px rgba(102, 204, 255, 0.8);
  border: 2px solid #ff2c2c;
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.card-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.movie-card:hover .card-image-wrapper img {
  transform: scale(1.1);
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: #ff2c2c;
  transition: width 0.3s ease;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.play-btn {
  background: #ff2c2c;
  color: #0f2027;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.play-btn:hover {
  background: #4da8cc;
  transform: scale(1.05);
}

.card-buttons {
  display: flex;
  gap: 10px;
}

.watchlist-btn, .info-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.watchlist-btn:hover {
  background: #ffd700;
  color: #0f2027;
}

.info-btn:hover {
  background: #ff2c2c;
  color: #0f2027;
}

.movie-card p {
  text-align: center;
  padding: 10px 8px;
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder {
  font-style: italic;
  opacity: 0.7;
  padding: 30px;
  text-align: center;
}

/* Player */
#player {
  padding: 20px;
  min-height: 400px;
}

.player-wrapper {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.player-header {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 2px solid #ff2c2c#66ccff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-header h3 {
  margin: 0;
  color: #ff2c2c;
  font-size: 18px;
}

.player-type {
  font-size: 12px;
  background: #ff2c2c;
  color: #0f2027;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
}

iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* Modal */
.modal {
  position: fixed;
  z-index: 9997;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background-color: rgba(15, 32, 39, 0.95);
  margin: 5% auto;
  padding: 30px;
  border: 1px solid #ff2c2c;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-btn {
  color: #ff2c2c;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
  color: #ff6b6b;
}

.details-card {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.details-poster {
  width: 150px;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.details-info {
  flex: 1;
}

.details-info h2 {
  margin: 0 0 15px 0;
  color: #ff2c2c;
  font-size: 24px;
}

.details-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.rating, .release, .runtime {
  background: rgba(102, 204, 255, 0.2);
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  border: 1px solid #ff2c2c;
}

.genres {
  margin: 10px 0;
  font-size: 14px;
}

.overview {
  line-height: 1.6;
  font-size: 14px;
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 12px;
  }

  .header-left {
    width: 100%;
    justify-content: space-between;
  }

  header h1 {
    font-size: 20px;
  }

  #searchBar {
    width: 100%;
    max-width: none;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .nav-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  iframe {
    height: 400px;
  }

  .movie-card {
    min-width: 110px;
    max-width: 110px;
  }

  section {
    padding: 20px 15px;
  }

  h2 {
    font-size: 18px;
  }

  .details-card {
    flex-direction: column;
    align-items: center;
  }

  .details-poster {
    width: 200px;
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
    padding: 20px;
  }
/* source player */



/* responsive tweaks */
@media (max-width: 640px) {
  .source-tab { padding: 6px 10px; font-size: 12px; }
  iframe { height: 420px; }
}




}

/* Tabs reset + pill style (cross-browser) */
.source-tabs-bar, .source-tabs-scroll, .source-tab {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.source-tabs-bar {
  display: block;
  padding: 8px 12px;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,44,44,0.06);
}

.source-tabs-scroll {
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:6px;
  -webkit-overflow-scrolling: touch;
}

.source-tabs-scroll::-webkit-scrollbar { height:8px; }
.source-tabs-scroll::-webkit-scrollbar-thumb { background: rgba(255,44,44,0.2); border-radius:8px; }

.source-tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.source-tab:hover, .source-tab:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  background: rgba(255,255,255,0.07);
  outline: none;
}

.source-tab.active {
  background: linear-gradient(90deg,#ff2c2c,#ff6b6b);
  color: #081117;
  border-color: #ff2c2c;
  box-shadow: 0 8px 28px rgba(255,44,44,0.2);
  transform: translateY(-3px) scale(1.02);
}
#player-season-dropdown {
  margin-bottom: 20px;
}

#player-season-dropdown select {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 2px solid #ff2c2c;
  background: rgba(0,0,0,0.8);
  color: #fff;
  cursor: pointer;
  margin-bottom: 12px;
}
#player-season-dropdown select option {
  background: #1c1c1c;
  color: #fff;
}
/* Episode row wrapper */
.episode-row-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* Scroll buttons */
.scroll-btn {
  background: #222;
  color: #fff;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
}

/* Episode list horizontal scroll */
.episode-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 5px 0;
}

/* Hide scrollbar (optional) */
.episode-list::-webkit-scrollbar {
  height: 6px;
}
.episode-list::-webkit-scrollbar-thumb {
  background: #ff2c2c;
  border-radius: 3px;
}

/* Episode card */
.episode-card {
  flex: 0 0 auto; /* do not shrink, keep width */
  width: 140px;
  background: #222;
  border-radius: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Poster image */
.episode-poster {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

/* Info text */
.episode-info {
  padding: 4px;
}

/* Limit title/desc */
.episode-info strong {
  display: block;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-info p {
  font-size: 0.75rem;
  line-height: 1.2em;
  max-height: 2.4em; /* max 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
}
.playing-episode {
  border: 2px solid #ff2c2c;
  box-shadow: 0 0 8px #ff2c2c;
}
