/* ===== Anime Card ===== */
.anime-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.anime-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(83, 52, 131, 0.25);
}

.anime-card__poster {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--bg-tertiary);
}

.anime-card__body {
  padding: 0.65rem 0.75rem;
}

.anime-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anime-card__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.anime-card__status {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.anime-card__status--airing {
  background: var(--success);
  color: #000;
}

.anime-card__status--completed {
  background: var(--accent-secondary);
  color: #fff;
}

.anime-card__status--upcoming {
  background: var(--warning);
  color: #000;
}

/* ===== Genre Badge ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--accent-primary);
  color: #fff;
}

.badge--outline {
  background: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

/* ===== Video Player ===== */
.player {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 1.5rem; /* Center the player itself */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.player__wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.player__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  background: var(--bg-tertiary);
}

.player__wrapper #yt-player-container,
.player__wrapper #yt-player-container > div,
.player__wrapper #yt-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
}

/* ===== YouTube Playlist Card ===== */
.youtube-playlist-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.youtube-playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(83, 52, 131, 0.25);
}

.youtube-playlist-card__thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-tertiary);
}

.youtube-playlist-card__body {
  padding: 0.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.youtube-playlist-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.youtube-playlist-card__channel {
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 0.3rem;
}

.youtube-playlist-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.youtube-playlist-card__video-count {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.youtube-playlist-card__play-icon {
  font-size: 0.7rem;
}

/* ===== Episode List ===== */
.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.5rem;
}

.episode-list::-webkit-scrollbar {
  width: 5px;
}

.episode-list::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.episode-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.episode-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.episode-item.active {
  background: rgba(233, 69, 96, 0.1);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.episode-item__thumb {
  width: 80px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.episode-item__info {
  flex: 1;
  min-width: 0;
}

.episode-item__title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-item__date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.episode-item__number {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-primary);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ===== Comments Section ===== */
.comments-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comment-form {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.comment-form button {
  align-self: flex-end;
  padding: 0.6rem 1.5rem;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.comment-form button:hover {
  opacity: 0.9;
}

.comment-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.comment-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.comment-item__content {
  flex: 1;
}

.comment-item__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.comment-item__user {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.comment-item__date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-item__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* ===== Detail Layout ===== */
.detail {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 0;
  align-items: start;
}

@media (max-width: 992px) {
  .detail {
    display: flex;
    flex-direction: column;
    max-width: 800px;
  }
  
  .detail__main {
    display: contents;
  }
  
  .player {
    order: 1;
    width: 100%;
  }
  
  .detail__sidebar {
    order: 2;
    position: static;
    max-height: none;
    width: 100%;
    margin: 1rem 0;
  }
  
  .detail__info {
    order: 3;
    width: 100%;
  }
  
  .anime-quote-container {
    order: 4;
    width: 100%;
  }
  
  .comments-section {
    order: 5;
    width: 100%;
  }
  
  .episode-list {
    max-height: 500px; /* Give it some scrollable space on mobile but not infinite */
  }
}

.detail__main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* Prevents flex items from overflowing */
}

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

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  padding-right: 0.5rem;
  flex: 1;
  max-height: 800px;
}

/* Custom Scrollbar for Episode List */
.episode-list::-webkit-scrollbar {
  width: 6px;
}

.episode-list::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 10px;
}

.episode-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.episode-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.detail__info {
  display: flex;
  gap: 1.5rem;
}

.detail__poster {
  width: 200px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.detail__text {
  flex: 1;
}

.detail__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail__meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.detail__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.detail__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== Search Page ===== */
.search-hero {
  padding: 2rem 0;
  text-align: center;
}

.search-hero__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.search-bar {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent-primary);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.4rem 1.2rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}

.search-bar button:hover {
  background: #ff6b81;
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.search-filters select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.search-filters select:focus {
  border-color: var(--accent-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
}

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

.btn--primary:hover {
  background: #ff6b81;
}

.btn--secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent-primary);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #c0392b;
}

.btn--success {
  background: var(--success);
  color: #000;
}

.btn--small {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
}

/* ===== Form Inputs ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal__close:hover {
  color: var(--text-primary);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.toast--success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.toast--error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== Responsive Detail ===== */
@media (min-width: 900px) {
  .detail {
    grid-template-columns: 2fr 1fr;
  }
}

@media (max-width: 640px) {
  .detail__info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail__poster {
    width: 160px;
  }

  .detail__genres {
    justify-content: center;
  }

  .episode-item__thumb {
    width: 72px;
  }
}

/* ===== Search Sections ===== */
.search-section {
  margin-bottom: 2rem;
}

/* ===== Info Card (Jikan/MAL results) ===== */
.info-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: border-color var(--transition);
}

.info-card:hover {
  border-color: var(--accent-glow);
}

.info-card__poster-col {
  flex-shrink: 0;
  position: relative;
  width: 120px;
}

.info-card__poster {
  width: 120px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
}

.info-card__score {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius);
}

.info-card__details {
  flex: 1;
  min-width: 0;
}

.info-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.info-card__title-eng {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.6rem;
}

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

.info-card__stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card__stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-card__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.info-card__synopsis {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .info-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .info-card__poster-col {
    width: 100px;
  }

  .info-card__poster {
    width: 100px;
  }

  .info-card__stats {
    justify-content: center;
  }

  .info-card__genres {
    justify-content: center;
  }
}

/* ===== Search Improvements ===== */

/* Search Results Sections */
.search-section {
  margin-bottom: 3rem;
}

.search-section .section__header {
  margin-bottom: 1.5rem;
}

.search-section .section__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.search-section .section__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Loading States */
.loading-container {
  text-align: center;
  padding: 3rem 1rem;
}

.loading-text {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Error States */
.error-banner {
  background: var(--bg-secondary);
  border: 1px solid #ff4757;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

.error-banner h3 {
  color: #ff4757;
  margin-bottom: 0.5rem;
}

.error-banner p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.error-banner .btn {
  margin-top: 1rem;
}

/* Empty State Improvements */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.empty-state ul {
  text-align: left;
  max-width: 300px;
  margin: 1rem auto 0;
  padding-left: 1.5rem;
}

.empty-state li {
  margin-bottom: 0.5rem;
}

/* ===== Auth Pages ===== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer .link {
  color: var(--accent-primary);
  font-weight: 500;
}

.auth-footer .link:hover {
  color: #ff6b81;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Password Strength Meter */
.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.strength-bar[data-level="weak"] {
  background: linear-gradient(90deg, #e74c3c 30%, var(--border) 30%);
}

.strength-bar[data-level="fair"] {
  background: linear-gradient(90deg, #f39c12 50%, var(--border) 50%);
}

.strength-bar[data-level="good"] {
  background: linear-gradient(90deg, #f1c40f 70%, var(--border) 70%);
}

.strength-bar[data-level="strong"] {
  background: linear-gradient(90deg, var(--success) 100%, var(--border) 100%);
}

.strength-label {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  min-height: 1em;
}

.strength-label[data-level="weak"] {
  color: #e74c3c;
}

.strength-label[data-level="fair"] {
  color: #f39c12;
}

.strength-label[data-level="good"] {
  color: #f1c40f;
}

.strength-label[data-level="strong"] {
  color: var(--success);
}

/* Alerts */
.alert {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.alert--error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

.alert--success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Player Error Handling ===== */
.player-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 300px;
}

.player-error h3 {
  color: #ff4757;
  margin-bottom: 1rem;
}

.player-error p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.player-error .btn {
  margin: 0.5rem;
}

/* ===== Progress Badge for Continue Watching ===== */
.progress-badge {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-red)) !important;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(197, 0, 156, 0.4);
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

/* Clear History button */
#clear-continue {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

#clear-continue:hover {
  opacity: 1;
  color: var(--neon-red);
}

/* Error Actions */
.error-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.error-actions .btn {
  margin: 0;
}

/* Video Player Styles */
.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.video-player {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Playlist Controls ===== */
.playlist-controls {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.current-episode-info {
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 200px;
}

.current-episode-info strong {
  color: var(--accent-primary);
  margin-right: 0.5rem;
}

.btn--small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.player-container-with-controls {
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .playlist-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .current-episode-info {
    text-align: center;
  }

  .nav-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
  }
}