* {
  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: 2rem;
}

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

.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;
}

.login-link {
  margin-left: auto;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.login-link:hover {
  background: #5568d3;
}

.login-link-active {
  background: #4c51bf;
  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: #4c51bf;
}

/* 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: 30px;
  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 */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.player.active {
  transform: translateY(0);
}

.player-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.player-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-subtitle {
  font-size: 13px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.player-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.player-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.player-button.play-pause {
  width: 50px;
  height: 50px;
  background: white;
  color: #667eea;
}

.player-button.play-pause:hover {
  background: #f5f5f5;
}

.player-progress {
  flex: 1;
  min-width: 200px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.9;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

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

.close-player {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
  padding: 5px;
  opacity: 0.8;
}

.close-player:hover {
  opacity: 1;
}

/* 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;
}

.speed-button {
  font-size: 13px;
  font-weight: 600;
  min-width: 50px;
}

/* 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;
  }
}

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

  .controls {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .player-content {
    flex-direction: column;
    gap: 15px;
  }

  .player-progress {
    width: 100%;
  }

  .volume-control {
    width: 100%;
    justify-content: center;
  }

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