/* =================================================================
   PODCAST APP MAIN STYLES
   ================================================================= */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd8;
  --secondary: #764ba2;
  --success: #48bb78;
  --success-dark: #3da869;
  --error: #f56565;
  --warning: #ed8936;
  --info: #4299e1;
  --text-dark: #2d3748;
  --text-light: #718096;
  --text-white: #ffffff;
  --bg-light: #f7fafc;
  --bg-dark: #1a202c;
  --border: #e2e8f0;
  --radius: 8px;
  --radius-small: 4px;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --bg-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* =================================================================
   INDEX PAGE STYLES (Public Podcast Interface)
   ================================================================= */

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 3em;
  margin-bottom: 10px;
  animation: fadeInDown 0.8s;
}

.header p {
  font-size: 1.2em;
  opacity: 0.95;
  animation: fadeInUp 0.8s;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Global image size constraints */
img {
  max-width: 100%;
  height: auto;
}

/* Podcast Grid */
.podcasts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .podcasts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 10px;
  }
}

.podcast-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.07);
  transition: all 0.3s ease;
  cursor: pointer;
}

.podcast-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.podcast-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.podcast-info {
  padding: 25px;
}

.podcast-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.podcast-author {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 10px;
  font-size: 0.95em;
}

.podcast-description {
  color: var(--text-light);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.podcast-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.episode-count {
  background: var(--bg-light);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  color: var(--text-light);
}

.podcast-actions {
  display: flex;
  gap: 10px;
}

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

.btn-subscribe:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-subscribe.subscribed {
  background: #28a745;
  color: white;
  cursor: default;
  opacity: 0.9;
}

.btn-subscribe.subscribed:hover {
  background: #28a745;
  transform: none;
}

.btn-rss {
  background: #ff6b6b;
  color: white;
}

.btn-rss:hover {
  background: #ff5252;
}

/* Episode Player Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  overflow-y: auto;
  animation: fadeIn 0.3s;
}

.modal.active {
  display: block;
}

.modal-content {
  background: white;
  max-width: 900px;
  margin: 40px auto;
  border-radius: 16px;
  overflow: hidden;
  animation: slideUp 0.3s;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 30px;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s;
}

.close-modal:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* Image Modal Styles */
.image-modal {
  background: rgba(0, 0, 0, 0.9);
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 5vh auto;
  text-align: center;
  background: none;
  border-radius: 0;
  overflow: visible;
}

.image-modal #modal-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-caption {
  margin-top: 20px;
  color: white;
  font-size: 1.2em;
  font-weight: 500;
}

.image-modal .close-modal {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 24px;
  z-index: 1001;
}

.image-modal .close-modal:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-body {
  padding: 30px;
}

/* Player Controls */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.speed-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.speed-controls label {
  font-weight: 500;
  color: #555;
  margin-right: 5px;
}

.speed-btn {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.speed-btn:hover {
  background: #e5e5e5;
}

.speed-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.player-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-delete {
  background: #ff4757;
  color: white;
}

.btn-delete:hover {
  background: #ff3338;
}

/* Episode List */
.episode-list {
  margin-top: 20px;
}

.episode-item {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.episode-item:hover {
  border-color: var(--primary);
  transform: translateX(5px);
}

.episode-header {
  display: flex;
  align-items: start;
  gap: 20px;
  margin-bottom: 15px;
}

.episode-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.episode-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.episode-info {
  flex: 1;
}

.episode-title {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.episode-link {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.episode-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.episode-date {
  color: var(--text-light);
  font-size: 0.9em;
  margin-bottom: 10px;
}

.episode-description {
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.6;
}

.read-more-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.read-more-link:hover {
  text-decoration: underline;
}

/* Audio Player */
.audio-player-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.audio-player {
  width: 100%;
  margin-bottom: 15px;
}

audio {
  width: 100%;
  height: 54px;
}

audio::-webkit-media-controls-panel {
  background: var(--bg-light);
}

.player-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-download {
  background: #48bb78;
  color: white;
}

.btn-download:hover {
  background: #38a169;
}

.btn-share {
  background: var(--text-light);
  color: white;
}

.btn-share:hover {
  background: var(--text-dark);
}

/* Subscribe Modal */
.subscribe-form {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
}

/* Currently Playing Bar */
.now-playing {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 15px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  display: none;
  z-index: 999;
}

.now-playing.active {
  display: block;
  animation: slideUpFixed 0.3s;
}

@keyframes slideUpFixed {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.now-playing-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.now-playing-image {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.now-playing-text h4 {
  font-size: 0.95em;
  margin-bottom: 3px;
}

.now-playing-text p {
  font-size: 0.85em;
  color: var(--text-light);
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-light);
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.empty-state svg {
  width: 120px;
  height: 120px;
  opacity: 0.3;
  margin-bottom: 20px;
}

/* =================================================================
   ADMIN PAGE STYLES (Administrative Interface)
   ================================================================= */

/* Admin Body Override */
body.admin-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Admin Container */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Admin Header */
.admin-header {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.admin-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  color: #333;
  margin-bottom: 10px;
}

.logout-btn {
  padding: 8px 16px;
  font-size: 14px;
  background: var(--text-light);
}

/* Tab Container */
.tab-container {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-weight: 500;
  color: #333;
}

.tab:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: #667eea;
}

.tab.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

/* Content Panels */
.content-panel {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.content-panel.active {
  display: block;
  animation: fadeIn 0.3s;
}

/* Admin Podcast Grid */
.admin-podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.admin-podcast-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.admin-podcast-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.admin-podcast-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

.admin-podcast-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.admin-podcast-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

/* Admin Episode List */
.admin-episode-list {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.admin-episode {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
}

.admin-episode-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-episode-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  float: left;
  margin-right: 15px;
}

.admin-audio-player {
  width: 100%;
  margin-top: 10px;
}

/* Admin Form Styles */
.admin-form-group {
  margin-bottom: 20px;
}

.admin-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  outline: none;
  border-color: #667eea;
}

.admin-input[type="file"] {
  padding: 8px;
}

.admin-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s;
}

.admin-button:hover {
  transform: translateY(-2px);
}

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

.admin-button-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s;
  margin-left: 10px;
}

.admin-button-secondary:hover {
  transform: translateY(-2px);
  background: #5a6268;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.podcast-status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  margin-bottom: 5px;
}

.podcast-status-badge.active {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.podcast-status-badge.draft {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.episode-count {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.episode-count:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-edit-admin {
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-edit-admin:hover {
  background: #218838;
}

.btn-delete-admin {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-delete-admin:hover {
  background: #c82333;
}

/* RSS Link */
.rss-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: #ff6b6b;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
}

/* Config Section */
.config-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.config-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.code-block {
  background: #2d3748;
  color: #e2e8f0;
  padding: 15px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  margin-top: 10px;
}

.success-message {
  background: #48bb78;
  color: white;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: none;
}

.error-message {
  background: #f56565;
  color: white;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: none;
}

/* Upload Progress */
.upload-progress {
  background: #e0e0e0;
  border-radius: 6px;
  height: 30px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}

.upload-progress-bar {
  background: linear-gradient(135deg, #667eea, #764ba2);
  height: 100%;
  width: 0%;
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

/* Admin Modal */
.admin-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s;
}

.admin-modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-admin-modal {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
}

.close-admin-modal:hover {
  color: #333;
}

/* File Info */
.file-info {
  background: #f0f0f0;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

/* B2 Settings */
.b2-settings {
  background: #fff3cd;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #ffc107;
}

/* =================================================================
   PODCAST APP STYLE GUIDE (COMPONENT LIBRARY)
   ================================================================= */

/* Color Variables (Design System) */
:root {
  /* Primary Colors */
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;

  /* Text Colors */
  --text-dark: #2d3748;
  --text-light: #718096;
  --text-white: #ffffff;

  /* Background Colors */
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --bg-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);

  /* Border & Lines */
  --border: #e2e8f0;
  --border-light: rgba(102, 126, 234, 0.3);

  /* Status Colors */
  --success: #48bb78;
  --success-dark: #38a169;
  --error: #f56565;
  --warning: #ffc107;
  --info: #ff6b6b;
  --info-dark: #ff5252;

  /* Shadow & Effects */
  --shadow-light: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-heavy: 0 12px 24px rgba(0,0,0,0.15);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.3);

  /* Border Radius */
  --radius-small: 6px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-xl: 16px;

  /* Spacing */
  --space-xs: 5px;
  --space-sm: 10px;
  --space-md: 15px;
  --space-lg: 20px;
  --space-xl: 30px;
  --space-2xl: 40px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-size-sm: 0.85em;
  --font-size-base: 1em;
  --font-size-lg: 1.2em;
  --font-size-xl: 1.5em;
  --font-size-2xl: 2em;
  --font-size-3xl: 3em;
  --line-height: 1.6;
}

/* =================================================================
   TYPOGRAPHY STYLES
   ================================================================= */

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-dark { color: var(--text-dark); }
.text-light { color: var(--text-light); }
.text-white { color: var(--text-white); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.font-small { font-size: var(--font-size-sm); }
.font-base { font-size: var(--font-size-base); }
.font-large { font-size: var(--font-size-lg); }
.font-xl { font-size: var(--font-size-xl); }
.font-2xl { font-size: var(--font-size-2xl); }
.font-3xl { font-size: var(--font-size-3xl); }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* =================================================================
   BUTTON STYLES
   ================================================================= */

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: var(--font-size-base);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Button Variants */
.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-gradient {
  background: var(--bg-gradient);
  color: var(--text-white);
}

.btn-gradient:hover {
  transform: translateY(-2px);
}

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

.btn-success:hover {
  background: var(--success-dark);
}

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

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

.btn-info:hover {
  background: var(--info-dark);
}

.btn-secondary {
  background: var(--text-light);
  color: var(--text-white);
}

.btn-secondary:hover {
  background: var(--text-dark);
}

/* Button Sizes */
.btn-small {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
}

.btn-large {
  padding: 12px 24px;
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* =================================================================
   CARD STYLES
   ================================================================= */

.card {
  background: var(--bg-white);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-heavy);
}

.card-body {
  padding: var(--space-xl);
}

.card-header {
  background: var(--bg-gradient);
  color: var(--text-white);
  padding: var(--space-xl);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* =================================================================
   FORM STYLES
   ================================================================= */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 16px;
  transition: border-color 0.3s ease;
  font-family: var(--font-family);
}

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

.form-input[type="file"] {
  padding: 8px;
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* =================================================================
   MODAL STYLES
   ================================================================= */



.modal-header {
  background: var(--bg-gradient);
  color: var(--text-white);
  padding: var(--space-xl);
  position: relative;
}

.modal-body {
  padding: var(--space-xl);
}

.modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--text-white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* =================================================================
   GRID & LAYOUT
   ================================================================= */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  justify-content: space-between;
}

.flex-gap {
  gap: var(--space-sm);
}

/* =================================================================
   PROGRESS & STATUS
   ================================================================= */

.progress {
  background: var(--border);
  border-radius: var(--radius-small);
  height: 30px;
  overflow: hidden;
}

.progress-bar {
  background: var(--bg-gradient);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: var(--font-size-sm);
}

.alert {
  padding: 12px;
  border-radius: var(--radius-small);
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: var(--success);
  color: var(--text-white);
}

.alert-error {
  background: var(--error);
  color: var(--text-white);
}

.alert-warning {
  background: var(--warning);
  color: var(--text-dark);
}

/* =================================================================
   ANIMATIONS
   ================================================================= */

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

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

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

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

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.3s ease; }
.animate-fadeInDown { animation: fadeInDown 0.8s ease; }
.animate-fadeInUp { animation: fadeInUp 0.8s ease; }

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--secondary); }
.bg-light { background: var(--bg-light); }
.bg-white { background: var(--bg-white); }
.bg-gradient { background: var(--bg-gradient); }

.border { border: 1px solid var(--border); }
.border-light { border: 1px solid var(--border-light); }
.border-top { border-top: 1px solid var(--border); }

.rounded { border-radius: var(--radius-small); }
.rounded-lg { border-radius: var(--radius-large); }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: var(--shadow-light); }
.shadow-md { box-shadow: var(--shadow-medium); }
.shadow-lg { box-shadow: var(--shadow-heavy); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none; }
.visible { display: block; }

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 20px;
    max-width: none;
  }

  .btn {
    padding: 10px 16px;
  }

  .card-body {
    padding: var(--space-lg);
  }

  .podcast-card img {
    height: 200px;
  }

  .podcast-info {
    padding: 20px;
  }

  .podcast-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header h1 {
    font-size: 2em;
  }

  .header p {
    font-size: 1em;
  }
}

/* =================================================================
   ADDITIONAL UTILITY CLASSES FOR INLINE STYLES
   ================================================================= */

.text-muted { color: #666; }
.small-text { color: #666; }
.instructions-text { margin-top: 15px; }
.instructions-list { line-height: 1.8; margin-left: 20px; }
.feature-list { line-height: 1.8; color: #555; }
.modal-subtitle { color: #666; margin-bottom: 20px; }
.success-message-inline { margin-top: 15px; }
.no-podcasts-message { color: #666; }
.podcast-meta-text { color: #888; font-size: 14px; }
.subscribe-btn-inline {
  margin-left: 10px;
  padding: 8px 16px;
  background: #28a745;
  font-size: 14px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.clearfix { clear: both; }
.config-highlighted { background: #d4edda; border: 2px solid #28a745; }
.no-episodes-message { text-align: center; color: #718096; }

/* Admin Footer */
.admin-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  margin-top: var(--space-2xl);
  text-align: center;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--text-light);
  color: var(--text-white);
  text-decoration: none;
  border-radius: var(--radius-small);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.admin-link:hover {
  background: var(--text-dark);
  opacity: 1;
  transform: translateY(-1px);
}

/* Login Page Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background: var(--bg-gradient);
  color: var(--text-white);
  padding: var(--space-2xl);
  text-align: center;
}

.login-header h1 {
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-2xl);
}

.login-body {
  padding: var(--space-2xl);
}

.login-info {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-light);
  border-radius: var(--radius-small);
  border-left: 4px solid var(--primary);
}

.alert-error {
  background: var(--error);
  color: var(--text-white);
  padding: var(--space-md);
  border-radius: var(--radius-small);
  margin-bottom: var(--space-lg);
  display: none;
}

.btn-full {
  width: 100%;
  justify-content: center;
  position: relative;
}

.spinner {
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

/* Episodes toggle and edit buttons */
.btn-episodes {
  background: #6366f1;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
  margin-left: 8px;
}

.btn-episodes:hover {
  background: #4f46e5;
}

.episode-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-edit-episode {
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-edit-episode:hover {
  background: #059669;
}

.btn-delete-episode {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-delete-episode:hover {
  background: #dc2626;
}

/* Admin panel specific styles */
.admin-hidden-tab {
  display: none;
}

.admin-file-input {
  margin-bottom: 10px;
}

.admin-file-preview {
  display: none;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
}

.admin-upload-note {
  color: #666;
}

.admin-current-image {
  margin-top: 10px;
}

.admin-current-image-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 4px;
  margin-top: 5px;
}

.admin-episode-list-hidden {
  display: none;
}

.admin-username-small {
  font-size: 0.6em;
  opacity: 0.8;
}

.admin-login-spinner {
  display: none;
}

/* Utility classes for JavaScript toggle */
.show {
  display: block !important;
}

.hide {
  display: none !important;
}

.show-inline {
  display: inline-block !important;
}

/* Success/Error message utility classes */
.success-message {
  display: none;
}

.success-message.show {
  display: block !important;
}

.error-message {
  display: none;
}

.error-message.show {
  display: block !important;
}

/* =================================================================
   REORDER PODCASTS STYLES
   ================================================================= */

.reorder-instructions {
  color: var(--text-light);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

.reorder-list {
  max-width: 800px;
  margin: 0 auto;
}

.reorder-item {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
  padding: var(--space-lg);
  cursor: grab;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.reorder-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.reorder-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
}

.reorder-item.drag-over {
  border-color: var(--success);
  background-color: rgba(72, 187, 120, 0.05);
}

.reorder-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: grab;
  padding: var(--space-sm);
  color: var(--text-light);
  font-size: 1.2em;
}

.reorder-drag-handle:hover {
  color: var(--primary);
}

.reorder-drag-handle::before {
  content: '⋮⋮';
}

.reorder-podcast-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-small);
  object-fit: cover;
  flex-shrink: 0;
}

.reorder-podcast-info {
  flex: 1;
}

.reorder-podcast-title {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--text-dark);
  margin-bottom: var(--space-xs);
}

.reorder-podcast-meta {
  color: var(--text-light);
  font-size: var(--font-size-sm);
}

.reorder-order-number {
  background: var(--primary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

/* =================================================================
   PODCAST DETAIL PAGE STYLES
   ================================================================= */

/* Header navigation */
.header-nav {
  margin-top: var(--space-md);
  text-align: center;
}

.nav-link {
  color: var(--text-white);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  display: inline-block;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Podcast detail container */
.podcast-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Podcast header section */
.podcast-header {
  margin-bottom: var(--space-2xl);
}

.podcast-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-xl);
  align-items: start;
  padding: var(--space-xl);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .podcast-hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
}

.podcast-hero-image {
  width: 100%;
  max-width: 300px;
  max-height: 300px;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.podcast-hero-content {
  min-width: 0;
}

.podcast-hero-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.podcast-hero-author {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.podcast-hero-description {
  font-size: var(--font-size-base);
  color: var(--text-dark);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.podcast-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .podcast-actions {
    justify-content: center;
  }
}

.podcast-stats {
  display: flex;
  gap: var(--space-lg);
  color: var(--text-light);
  font-size: var(--font-size-sm);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .podcast-stats {
    justify-content: center;
  }
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Episodes section */
.episodes-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.episodes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.episodes-header h2 {
  font-size: var(--font-size-xl);
  color: var(--text-dark);
  margin: 0;
}

.episodes-controls {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.sort-select {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: white;
  color: var(--text-dark);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.episodes-list {
  padding: 0;
}

.no-episodes {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-light);
}

.no-episodes h3 {
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
}

/* Error state */
.error-state {
  text-align: center;
  padding: var(--space-2xl);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}

.error-state h2 {
  color: var(--error);
  margin-bottom: var(--space-md);
}

.error-state p {
  color: var(--text-light);
  margin-bottom: var(--space-lg);
}

/* Responsive adjustments for detail page */
@media (max-width: 768px) {
  .episodes-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }

  .episodes-controls {
    justify-content: center;
  }
}

/* View all episodes section in modal */
.view-all-episodes {
  text-align: center;
  padding: var(--space-xl);
  border-top: 1px solid var(--border);
  background: var(--bg-light);
  margin-top: var(--space-md);
}

.episode-count-info {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  margin-top: 0;
}

/* =================================================================
   SUBSCRIBER MANAGEMENT STYLES
   ================================================================= */

.subscribers-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xl);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .subscribers-header {
    flex-direction: column;
    gap: var(--space-md);
  }
}

.subscribers-stats {
  display: flex;
  gap: var(--space-lg);
}

@media (max-width: 480px) {
  .subscribers-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
}

.stat-card {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 120px;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscribers-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .subscribers-actions {
    width: 100%;
    justify-content: center;
  }
}

.subscribers-content {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-xl);
}

.subscribers-list {
  margin-top: var(--space-lg);
}

.subscriber-group {
  margin-bottom: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.subscriber-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .subscriber-group-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
}

.subscriber-group-header h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: var(--font-size-lg);
}

.subscriber-group-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .subscriber-group-actions {
    justify-content: space-between;
  }
}

.subscriber-count {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.subscriber-list {
  padding: 0;
}

.subscriber-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

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

.subscriber-item:hover {
  background: var(--bg-light);
}

@media (max-width: 600px) {
  .subscriber-item {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

.subscriber-info {
  flex: 1;
}

.subscriber-email {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--space-xs);
}

.subscriber-name {
  color: var(--text-light);
  font-size: var(--font-size-sm);
}

.subscriber-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

@media (max-width: 600px) {
  .subscriber-meta {
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
  }
}

.subscriber-date {
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.subscriber-status {
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-unsubscribed {
  background: #f8d7da;
  color: #721c24;
}

.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-light);
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: var(--space-md);
}

.admin-button.small {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
}

.admin-button.secondary {
  background: #6c757d;
  border-color: #6c757d;
}

.admin-button.secondary:hover {
  background: #5a6268;
  border-color: #545b62;
}

/* =================================================================
   ANALYTICS STYLES
   ================================================================= */

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xl);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column;
    gap: var(--space-md);
  }
}

.analytics-stats {
  display: flex;
  gap: var(--space-lg);
}

@media (max-width: 480px) {
  .analytics-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
}

.analytics-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .analytics-actions {
    width: 100%;
    justify-content: center;
  }
}

.analytics-content {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-xl);
}

.analytics-list {
  margin-top: var(--space-lg);
}

.analytics-group {
  margin-bottom: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.analytics-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .analytics-group-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
}

.analytics-group-header h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: var(--font-size-lg);
}

.analytics-count {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.analytics-episode-list {
  padding: 0;
}

.analytics-episode-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

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

.analytics-episode-item:hover {
  background: var(--bg-light);
}

@media (max-width: 600px) {
  .analytics-episode-item {
    flex-direction: column;
    gap: var(--space-md);
  }
}

.episode-info {
  flex: 1;
}

.episode-title {
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
}

.episode-plays {
  color: var(--primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
  margin-left: var(--space-md);
}

.episode-meta {
  color: var(--primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.plays-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 200px;
}

@media (max-width: 600px) {
  .plays-timeline {
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

/* Analytics episode title styling */
.analytics-episode-item .episode-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-episode-item .episode-title a {
  color: var(--text-dark);
  text-decoration: none;
}

.analytics-episode-item .episode-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.play-event {
  font-size: var(--font-size-xs);
  color: var(--text-light);
  padding: 2px 6px;
  background: #f0f0f0;
  border-radius: 10px;
  text-align: center;
}

.more-plays {
  font-size: var(--font-size-xs);
  color: var(--primary);
  font-weight: 500;
  text-align: center;
  padding: 2px 6px;
}

/* =================================================================
   EPISODE DETAIL PAGE STYLES
   ================================================================= */

.episode-detail-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.breadcrumb {
  margin-bottom: var(--space-lg);
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 var(--space-xs);
}

.episode-header {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  align-items: start;
}

.episode-image-container {
  flex-shrink: 0;
}

.episode-image {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.episode-image:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.episode-info {
  flex: 1;
}

.episode-meta {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
}

.podcast-category {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.episode-date {
  color: var(--text-light);
}

.episode-title {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.podcast-title-link {
  color: var(--text-light);
  margin-bottom: var(--space-sm);
}

.podcast-title-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.podcast-title-link a:hover {
  text-decoration: underline;
}

.episode-stats {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.episode-player-section {
  background: var(--bg-light);
  padding: var(--space-lg);
  border-radius: 12px;
  margin-bottom: var(--space-xl);
}

.episode-audio-player {
  margin-bottom: var(--space-md);
}

.episode-audio-player audio {
  width: 100%;
  height: 54px;
}

.playback-speed-controls {
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.speed-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-right: var(--space-xs);
}

.speed-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.speed-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
}

.speed-btn:hover {
  background: var(--bg-light);
  border-color: var(--primary);
}

.speed-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.speed-btn.active:hover {
  background: var(--primary-dark);
}

.episode-actions {
  display: flex;
  gap: var(--space-sm);
}

.action-button {
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.action-button:hover {
  background: var(--primary-dark);
}

.action-button.secondary {
  background: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--border-light);
}

.action-button.secondary:hover {
  background: var(--bg-light);
}

.episode-description-section {
  margin-bottom: var(--space-xl);
}

.episode-description-section h2 {
  margin-bottom: var(--space-md);
  color: var(--text-dark);
}

.episode-description {
  line-height: 1.6;
  color: var(--text-dark);
}

.episode-description p {
  margin-bottom: var(--space-md);
}

.read-more-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.read-more-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.more-episodes-section {
  margin-bottom: var(--space-xl);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  color: var(--text-dark);
}

.view-all-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.view-all-link:hover {
  text-decoration: underline;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.episode-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: var(--space-md);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
}

.episode-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.episode-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  float: left;
  margin-right: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.episode-card-content h4 {
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.episode-card-content h4 a {
  color: var(--text-dark);
  text-decoration: none;
}

.episode-card-content h4 a:hover {
  color: var(--primary);
}

.episode-card-date,
.episode-card-duration {
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.subscribe-section {
  background: var(--bg-light);
  padding: var(--space-xl);
  border-radius: 12px;
  text-align: center;
}

.subscribe-section h2 {
  margin-bottom: var(--space-md);
  color: var(--text-dark);
}

.subscribe-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.subscribe-button {
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.subscribe-button:hover {
  background: var(--primary-dark);
}

.subscribe-button.secondary {
  background: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--border-light);
}

.subscribe-button.secondary:hover {
  background: var(--bg-light);
}

/* Share Modal Styles */
.share-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.share-option label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  color: var(--text-dark);
}

.copy-link-container {
  display: flex;
  gap: var(--space-xs);
}

.copy-link-container input {
  flex: 1;
  padding: var(--space-sm);
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

.copy-button {
  padding: var(--space-sm) var(--space-md);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.copy-button:hover {
  background: var(--primary-dark);
}

.share-social {
  display: flex;
  gap: var(--space-sm);
}

.social-share-button {
  flex: 1;
  padding: var(--space-md);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.social-share-button.twitter {
  background: #1da1f2;
  color: white;
}

.social-share-button.twitter:hover {
  background: #1a91da;
}

.social-share-button.facebook {
  background: #4267b2;
  color: white;
}

.social-share-button.facebook:hover {
  background: #365899;
}

/* =================================================================
   EPISODE EDITOR STYLES
   ================================================================= */

.episode-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

.episode-editor-controls {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.episode-editor-actions {
  display: flex;
  gap: var(--space-sm);
}

.episode-table {
  background: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--bg-light);
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

.admin-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.admin-table tr:hover {
  background: var(--bg-light);
}

.episode-info .episode-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  font-size: var(--font-size-base);
}

.episode-info .episode-meta {
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.status-published {
  background: var(--success-light);
  color: var(--success);
}

.status-draft {
  background: #fef3c7;
  color: #d97706;
}

.admin-button.small {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  margin-right: var(--space-xs);
}

.modal-content.large {
  max-width: 600px;
  width: 90%;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.admin-button.danger {
  background: var(--error);
  color: white;
}

.admin-button.danger:hover {
  background: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .episode-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .episode-image {
    width: 150px;
    height: 150px;
  }

  .episode-title {
    font-size: 1.5em;
  }

  .episode-actions,
  .subscribe-buttons {
    flex-direction: column;
  }

  .share-social {
    flex-direction: column;
  }

  .episode-grid {
    grid-template-columns: 1fr;
  }

  .episode-editor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .episode-editor-controls {
    flex-direction: column;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-table th,
  .admin-table td {
    padding: var(--space-sm);
  }

  .admin-table {
    font-size: var(--font-size-sm);
  }

  .admin-button.small {
    display: block;
    margin-bottom: var(--space-xs);
    text-align: center;
  }
}

/* Episode Editor Grouped Layout */
.episode-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.podcast-group {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.podcast-group-header {
  background: var(--header-bg);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.podcast-group-header h3 {
  margin: 0;
  color: var(--header-text);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.episode-count {
  background: var(--primary);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 12px;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.episode-list {
  padding: var(--space-sm);
  min-height: 50px;
  transition: background-color 0.2s ease;
}

.episode-list.drag-over {
  background-color: var(--primary-light);
  border: 2px dashed var(--primary);
}

.episode-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: grab;
  transition: all 0.2s ease;
}

.episode-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.episode-item:active {
  cursor: grabbing;
}

.episode-item:last-child {
  margin-bottom: 0;
}

.episode-drag-handle {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  cursor: grab;
  user-select: none;
  line-height: 1;
  width: 20px;
  text-align: center;
}

.episode-drag-handle:hover {
  color: var(--primary);
}

.episode-order {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  min-width: 24px;
}

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

.episode-info .episode-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.episode-info .episode-meta {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.episode-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.episode-actions .admin-button {
  white-space: nowrap;
}

/* Mobile Responsiveness for Episode Editor */
@media (max-width: 768px) {
  .episode-item {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .episode-item .episode-drag-handle,
  .episode-item .episode-order {
    align-self: flex-start;
  }

  .episode-actions {
    justify-content: center;
    margin-top: var(--space-sm);
  }

  .episode-actions .admin-button {
    flex: 1;
    text-align: center;
  }

  .podcast-group-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .episode-count {
    align-self: center;
  }
}

/* Backup Management Styles */
.backup-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.backup-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.backup-info {
  flex: 1;
}

.backup-filename {
  font-weight: 600;
  color: var(--text-dark);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-xs);
}

.backup-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.backup-actions {
  display: flex;
  gap: var(--space-sm);
}

.backup-info-section {
  background: var(--bg-light);
  padding: var(--space-md);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.backup-info p {
  margin: var(--space-xs) 0;
  color: var(--text-dark);
  font-size: var(--font-size-sm);
}

.btn-small {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.btn-small.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-small.btn-secondary {
  background: var(--text-muted);
  color: white;
}

.btn-small.btn-secondary:hover {
  background: #666;
}

@media (max-width: 768px) {
  .backup-item {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }

  .backup-actions {
    justify-content: center;
  }
}

/* =================================================================
   CATEGORY MANAGEMENT STYLES
   ================================================================= */

.admin-form-section {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow);
}

.admin-form-section h3 {
  margin-bottom: var(--space-lg);
  color: var(--text-dark);
  font-size: var(--font-size-lg);
}

.categories-section {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
}

.categories-section h3 {
  margin-bottom: var(--space-lg);
  color: var(--text-dark);
  font-size: var(--font-size-lg);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.category-color-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
}

.category-description {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.category-stats {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
}

.category-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.category-actions .admin-button {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
}

.category-actions .admin-button.danger {
  background: var(--error);
}

.category-actions .admin-button.danger:hover {
  background: #dc2626;
}

.admin-button-secondary {
  background: var(--text-muted);
  color: white;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
}

.admin-button-secondary:hover {
  background: #666;
}

.edit-category-form {
  display: none;
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
}

.edit-category-form.show {
  display: block;
}

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-light);
  grid-column: 1 / -1;
}

.empty-state h3 {
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin: 0;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .category-actions {
    flex-direction: column;
  }

  .category-actions .admin-button {
    text-align: center;
  }
}
