* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: #f5f5f5;
  color: #333;
  padding-bottom: 120px; /* Space for sticky player */
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem 2rem;
}

/* Header */
.header {
  background: white;
  padding: 15px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.header-link:hover {
  opacity: 0.8;
}

.logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
}

.header-text h1 {
  font-size: 24px;
  margin-bottom: 0;
  color: #333;
}

.header-auth-buttons {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.login-link {
  padding: 10px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.login-link:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.login-link-active {
  background: #3730a3;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.login-link-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: white;
  border-radius: 2px 2px 0 0;
}

.login-link-active:hover {
  background: #312e81;
}

/* Page Header (Admin Pages) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  margin: 0;
}

.page-nav {
  display: flex;
  gap: 10px;
}

/* Search and Filters */
.controls {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.filter-select {
  padding: 12px 35px 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card.playing {
  border: 2px solid #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-description {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  background: #f0f0f0;
  color: #666;
}

.tag.video {
  background: #e3f2fd;
  color: #1976d2;
}

.tag.audio {
  background: #f3e5f5;
  color: #7b1fa2;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 13px;
  color: #666;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.play-button {
  width: 100%;
  padding: 12px;
  background: #000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.play-button:hover {
  background: #333;
}

.download-button {
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  margin-top: 8px;
}

.download-button:hover {
  background: #5568d3;
}

.play-button.playing {
  background: #667eea;
}

.play-button .icon {
  font-size: 16px;
}

/* Sticky Player - Compact Redesign */
.player {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 4rem);
  max-width: calc(1400px - 4rem);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 12px 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #333;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 1000;
}

.player.active {
  transform: translateX(-50%) translateY(0);
}

.player-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

/* Close button - top right overlay */
.close-player {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  color: #718096;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  z-index: 10;
}

.close-player:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #4a5568;
}

/* Header row: Title only (no speed control) */
.player-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 24px; /* Space for close button */
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-subtitle {
  font-size: 12px;
  color: #718096;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Speed control in controls row */
.speed-control {
  display: flex;
  align-items: center;
}

.player-button.speed-button {
  width: auto;
  min-width: 52px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
}

.player-button.speed-button:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* Progress bar - full width */
.player-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin-bottom: 6px;
  transition: height 0.2s;
}

.progress-bar:hover {
  height: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  width: 0%;
  position: relative;
  box-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
  transition: width 0.1s linear;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.progress-bar:hover .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #718096;
  font-variant-numeric: tabular-nums;
}

/* Controls row */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  min-height: 60px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Volume on left, speed on right, share on left (mobile only) */
.volume-control {
  position: absolute;
  left: 0;
}

.speed-control {
  position: absolute;
  right: 0;
}

.share-control {
  position: absolute;
  left: 0;
  display: none; /* Hidden on desktop */
}

.share-button.sharing {
  animation: sharePulse 0.3s ease;
}

@keyframes sharePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    background: rgba(102, 126, 234, 0.1);
  }
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  10%, 90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

.player-button {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #4a5568;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 16px;
}

.player-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #2d3748;
  transform: scale(1.05);
}

.player-button:active {
  transform: scale(0.95);
}

.player-button.play-pause {
  width: 52px;
  height: 52px;
  background: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  font-size: 20px;
}

.player-button.play-pause:hover {
  background: #5a67d8;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.player-button.play-pause:active {
  transform: scale(0.95);
}

/* Skip button sizing */
.player-button.skip-button {
  width: 44px;
  height: 44px;
}

/* Skip button animation */
.player-button.skip-button.skipping {
  animation: skipPulse 0.3s ease;
}

@keyframes skipPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    background: rgba(102, 126, 234, 0.1);
  }
}

/* Volume control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.volume-slider {
  width: 60px;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}

.volume-slider:hover {
  height: 6px;
}

.volume-fill {
  height: 100%;
  background: #718096;
  border-radius: 2px;
  width: 100%;
}

.close-player {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: #718096;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-left: 8px;
  transition: all 0.2s;
}

.close-player:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #4a5568;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

/* Load More Button */
.load-more-container {
  text-align: center;
  margin: 40px 0;
  padding: 20px;
}

.load-more-info {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.load-more-button {
  padding: 12px 40px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.load-more-button:hover:not(:disabled) {
  background: #5568d3;
}

.load-more-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Speed Control */
.speed-control {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.player-button.speed-button {
  width: auto;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
}

.player-button.speed-button:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* Speed Menu Modal */
.speed-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speed-menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.speed-menu-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 0;
  min-width: 280px;
  max-width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.speed-menu-header {
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.speed-menu-options {
  padding: 10px 0;
}

.speed-option {
  width: 100%;
  padding: 16px 24px;
  background: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
  gap: 15px;
}

.speed-option:hover {
  background: #f5f5f5;
}

.speed-option.active {
  background: #f0f4ff;
}

.speed-option.active .speed-check {
  opacity: 1;
}

.speed-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  min-width: 50px;
}

.speed-label {
  flex: 1;
  font-size: 14px;
  color: #666;
  text-align: left;
}

.speed-check {
  font-size: 18px;
  color: #667eea;
  opacity: 0;
  transition: opacity 0.2s;
}

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

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

/* Share Menu Modal */
.share-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.share-menu-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 0;
  min-width: 320px;
  max-width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.share-menu-header {
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.share-menu-options {
  padding: 10px 0;
}

.share-option {
  width: 100%;
  padding: 18px 24px;
  background: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
}

.share-option:hover {
  background: #f5f5f5;
}

.share-option-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.share-option-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.share-option-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.share-option-label {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.share-option-desc {
  font-size: 13px;
  color: #666;
}

.share-check {
  font-size: 20px;
  color: #cbd5e0;
}

/* Responsive */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  /* Compact player responsive */
  .player {
    padding: 10px 16px;
    width: calc(100% - 4rem);
  }

  .player-content {
    gap: 6px;
  }

  .player-header {
    padding-right: 28px;
  }

  .player-title {
    font-size: 14px;
  }

  .player-subtitle {
    font-size: 11px;
  }

  .player-button.play-pause {
    width: 48px;
    height: 48px;
  }

  .player-button {
    width: 32px;
    height: 32px;
  }

  .volume-control {
    display: none; /* Hide volume on mobile */
  }

  .share-control {
    display: block; /* Show share on mobile */
  }

  .speed-control {
    right: 0; /* Keep on right edge */
  }

  .player-controls-row {
    justify-content: center;
    min-height: 60px; /* Ensure space for absolute positioned items */
  }

  /* Hide prev/next on mobile, keep skip buttons */
  .prev-next-btn {
    display: none;
  }

  .load-more-button {
    width: 100%;
    max-width: 300px;
  }

  /* Hierarchical Layout Responsive */
  .nav-bar {
    gap: 10px;
  }

  .breadcrumb {
    justify-content: flex-start;
    flex-wrap: wrap;
  }


  .list-view {
    padding: 0;
  }
}

/* ========================================
   Hierarchical Layout Styles
   ======================================== */

/* Navigation Bar */
.nav-bar {
  position: sticky;
  top: 0;
  background: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  z-index: 500;
  transition: box-shadow 0.3s ease;
}

.nav-bar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 12px 12px;
}

/* Back Button */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: #718096;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 5px;
}

.back-btn:hover {
  background: #f7fafc;
  color: #2d3748;
  border-radius: 6px;
}

.back-icon {
  font-size: 18px;
}

/* Breadcrumb */
.breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #718096;
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-link {
  color: #667eea;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}

.breadcrumb-link:hover {
  color: #5568d3;
  background: #f7fafc;
}

.breadcrumb-current {
  color: #2d3748;
  font-weight: 500;
}

.breadcrumb-separator {
  color: #cbd5e0;
  user-select: none;
}

/* List View Container */
.list-view {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* List Items */
.list-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f7fafc;
  cursor: pointer;
  transition: all 0.2s;
  gap: 12px;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: #f7fafc;
}

.list-item:active {
  background: #edf2f7;
}

/* Series/Subseries List Items */
.series-item,
.subseries-item {
  justify-content: space-between;
}

.series-item-main,
.subseries-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.series-icon,
.subseries-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.series-name,
.subseries-name {
  font-size: 16px;
  font-weight: 500;
  color: #2d3748;
}

.series-count,
.subseries-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: #edf2f7;
  color: #4a5568;
  font-size: 13px;
  font-weight: 600;
  border-radius: 14px;
}

.series-chevron,
.subseries-chevron {
  color: #cbd5e0;
  font-size: 18px;
  transition: transform 0.2s;
}

.series-item:hover .series-chevron,
.subseries-item:hover .subseries-chevron {
  transform: translateX(4px);
  color: #a0aec0;
}

/* Resource List Items */
.resource-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.resource-item.playing {
  background: #f0f4ff;
}

.resource-item.playing .resource-play-btn {
  background: #667eea;
  color: white;
}

.resource-play-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: #edf2f7;
  border: none;
  color: #4a5568;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.resource-play-btn:hover {
  background: #667eea;
  color: white;
  transform: scale(1.05);
}

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

.resource-title {
  font-size: 15px;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: #718096;
}

.resource-date,
.resource-duration {
  display: flex;
  align-items: center;
  gap: 5px;
}

.resource-date::before {
  content: '📅';
  font-size: 12px;
}

.resource-duration::before {
  content: '⏱️';
  font-size: 12px;
}

/* Section Headers (for mixed subseries + resources view) */
.list-section-header {
  padding: 12px 20px;
  background: #f7fafc;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Download Button in List View */
.resource-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: #f7fafc;
  color: #4a5568;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s;
  margin-left: 8px;
}

.resource-download-btn:hover {
  background: #667eea;
  color: white;
  transform: scale(1.05);
}

/* Video Element in List View */
.resource-video {
  flex-shrink: 0;
  margin-right: 12px;
}

/* ========================================
   WeChat Browser Prompt Overlay
   ======================================== */

.wechat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  background: white;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.wechat-top-bar {
  width: 100%;
  background: #ff6b00;
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  min-height: 140px;
}

.wechat-step-1 {
  font-size: 22px;
  font-weight: 400;
  margin-top: 40px;
  margin-left: 20px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wechat-dots-icon {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  margin: 0 4px;
  vertical-align: middle;
}

.wechat-dots-icon svg {
  width: 20px;
  height: 20px;
}

.wechat-arrow {
  position: absolute;
  top: 15px;
  right: 25px;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.wechat-content-body {
  width: 100%;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
}

.wechat-step-2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 30px;
  line-height: 1.6;
  text-align: left;
  align-self: flex-start;
  margin-left: 30px;
  max-width: 90%;
}

.wechat-step-2 strong {
  font-weight: 600;
  color: #000;
}

.wechat-screenshot {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .wechat-step-1 {
    font-size: 18px;
    margin-top: 30px;
    margin-left: 10px;
  }
  
  .wechat-step-2 {
    font-size: 18px;
    margin-bottom: 20px;
    margin-left: 20px;
  }
  
  .wechat-menu-simulation {
    gap: 8px;
    padding: 15px;
  }
  
  .wechat-icon-box {
    width: 48px;
    height: 48px;
  }
}

/* ============ MEDIA BUNDLE CARD STYLES ============ */

/* Single part buttons (side by side) */
.media-buttons-single {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.media-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-btn .icon {
  font-size: 16px;
}

.audio-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.audio-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.video-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.video-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

/* Multi-part buttons (labeled rows) */
.media-buttons-multi {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.media-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-label {
  font-size: 14px;
  color: #666;
  min-width: 70px;
}

.part-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.part-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #667eea;
  border-radius: 8px;
  background: white;
  color: #667eea;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.part-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Playing state for buttons */
.media-btn.playing {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  animation: pulse 2s ease-in-out infinite;
}

.media-btn.playing:hover {
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.part-btn.playing {
  background: #667eea;
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.video-part-btn.playing {
  background: #11998e;
  color: white;
  border-color: #11998e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ============ VIDEO PLAYER MODAL ============ */

.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.video-modal.open {
  display: block;
}

.video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.video-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: videoModalSlideIn 0.3s ease;
}

@keyframes videoModalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #222;
  gap: 12px;
}

.video-modal-title-section {
  flex: 1;
  min-width: 0;
}

.video-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-modal-subtitle {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: #aaa;
}

.video-modal-part-indicator {
  background: #667eea;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.video-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-modal-player-area {
  background: #000;
}

.video-modal-video {
  width: 100%;
  max-height: 70vh;
  display: block;
}

/* Video part button styling */
.video-part-btn {
  border-color: #11998e;
  color: #11998e;
}

.video-part-btn:hover {
  background: #11998e;
  color: white;
  box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

/* Download button in grid cards */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.download-btn .icon {
  font-size: 16px;
}

.download-btn:hover {
  background: #4a5568;
  border-color: #4a5568;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

/* Download row for multi-part cards */
.download-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}

.download-row .media-label {
  font-size: 14px;
  color: #666;
  min-width: 70px;
}

.download-part-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #a0aec0;
  border-radius: 8px;
  background: white;
  color: #4a5568;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.download-part-btn:hover {
  background: #4a5568;
  border-color: #4a5568;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

/* Video modal responsive */
@media (max-width: 600px) {
  .video-modal-content {
    width: 100%;
    max-width: none;
    max-height: 100vh;
    border-radius: 0;
  }

  .video-modal-header {
    padding: 12px 16px;
  }

  .video-modal-title {
    font-size: 14px;
  }

  .video-modal-video {
    max-height: 50vh;
  }

  .media-buttons-single {
    flex-direction: column;
  }

  .download-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .download-row {
    flex-wrap: wrap;
  }
}
