/* Gospel Hall Audio Page Styles */

.audio-container {
  padding: 24px 20px 120px;
  min-height: calc(100vh - 90px);
  background: linear-gradient(180deg, #f6f3e2 0%, #eef4fd 100%);
  pointer-events: auto;
}

/* Header */
.audio-header {
  margin-bottom: 20px;
}

.audio-title {
  font-size: 28px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 6px;
}

.audio-subtitle {
  color: #5d6483;
  font-size: 15px;
  margin: 0;
}

/* Search Bar */
.audio-search-bar {
  margin-bottom: 16px;
}

.audio-search-bar input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.audio-search-bar input:focus {
  outline: none;
  border-color: #1e3a8a;
  box-shadow: 0 2px 12px rgba(30, 58, 138, 0.1);
}

.audio-search-bar input::placeholder {
  color: #9ca3af;
}

/* Category Filters */
.audio-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.audio-cat-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  color: #5d6483;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.audio-cat-btn:hover {
  background: rgba(255,255,255,0.9);
  border-color: #e5e7eb;
}

.audio-cat-btn.active {
  background: #1e3a8a;
  color: white;
}

/* Audio List Grid */
.audio-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  pointer-events: auto;
}

/* Loading State */
.audio-loading {
  text-align: center;
  padding: 60px 20px;
  color: #5d6483;
  grid-column: 1 / -1;
}

/* Empty State */
.audio-empty {
  text-align: center;
  padding: 80px 20px;
  color: #5d6483;
  grid-column: 1 / -1;
}

.audio-empty.hidden {
  display: none;
}

.audio-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.audio-empty h3 {
  font-size: 20px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 8px;
}

.audio-empty p {
  margin: 0;
  font-size: 15px;
}

/* Audio Card */
.audio-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.audio-card-image {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.audio-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.audio-card:hover .audio-card-image img {
  transform: scale(1.05);
}

.audio-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(30, 58, 138, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none; /* Let clicks pass through to the card */
  z-index: 10;
}

.audio-card:hover .audio-card-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: #1e3a8a;
}

.audio-card .play-icon {
  color: white;
  font-size: 24px;
  margin-left: 4px;
  pointer-events: none;
  line-height: 1;
}

.audio-card-content {
  padding: 16px;
}

.audio-card-category {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(30, 58, 138, 0.1);
  color: #1e3a8a;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.audio-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

.audio-card-speaker {
  font-size: 13px;
  color: #5d6483;
  margin: 0 0 6px;
}

.audio-card-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

/* Audio Player Modal */
.audio-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.audio-modal.hidden {
  display: none;
}

.audio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.audio-player-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.audio-player-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 16px;
}

.audio-player-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #374151;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background 0.2s ease;
}

.audio-player-close:hover {
  background: white;
}

/* Audio Player Hero */
.audio-player-hero {
  position: relative;
  height: 240px;
  margin-top: -56px;
}

.audio-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}

.audio-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  color: white;
}

.audio-hero-category {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.2);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
}

.audio-hero-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.audio-hero-speaker {
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
}

/* Audio Player Section */
.audio-player-section {
  padding: 24px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.audio-player {
  width: 100%;
  height: 50px;
  margin-bottom: 16px;
}

.audio-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.audio-player-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.audio-control-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  background: #1e3a8a;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.audio-control-btn:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

.audio-control-btn.secondary {
  background: #e5e7eb;
  color: #374151;
}

.audio-control-btn.secondary:hover {
  background: #d1d5db;
}

.audio-control-btn span {
  font-size: 14px;
}

/* Audio Description */
.audio-description {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.audio-description h4 {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.audio-description p {
  font-size: 15px;
  line-height: 1.7;
  color: #4b5563;
  margin: 0;
}

/* Audio Player Tags */
.audio-player-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px 24px 32px;
}

.audio-tag {
  padding: 8px 16px;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Mobile */
@media (max-width: 640px) {
  .audio-title {
    font-size: 24px;
  }
  
  .audio-categories {
    gap: 6px;
  }
  
  .audio-cat-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .audio-list {
    grid-template-columns: 1fr;
  }
  
  .audio-player-hero {
    height: 200px;
  }
  
  .audio-hero-title {
    font-size: 18px;
  }
  
  .audio-player-section {
    padding: 16px;
  }
  
  .audio-controls {
    gap: 12px;
  }

  .audio-control-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .audio-control-btn.play-btn-large {
    padding: 12px 24px;
  }
}

/* --------------------------------------------------
   MINI AUDIO PLAYER (Floating at bottom)
-------------------------------------------------- */
.mini-audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.mini-audio-player.visible {
  transform: translateY(0);
}

.mini-audio-art {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.mini-audio-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-audio-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mini-audio-title {
  font-size: 14px;
  font-weight: 600;
  color: #162b46;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-audio-speaker {
  font-size: 12px;
  color: #5d6483;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-audio-controls {
  display: flex;
  gap: 8px;
}

.mini-audio-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mini-audio-btn:hover {
  background: #e5e7eb;
}

.mini-audio-btn.play-btn {
  background: #3b82f6;
  color: white;
}

.mini-audio-btn.play-btn:hover {
  background: #2563eb;
}

.mini-audio-btn.close-btn {
  background: transparent;
  color: #9ca3af;
}

.mini-audio-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.mini-audio-main:hover .mini-audio-title {
  color: #3b82f6;
}

/* --------------------------------------------------
   AUDIO PROGRESS BAR IN MODAL
-------------------------------------------------- */
.audio-progress-bar {
  padding: 0 24px 16px;
}

.audio-progress-container {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.1s linear;
}

.audio-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
}

.audio-player-controls-large {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 24px 24px;
}

.audio-control-btn-large {
  padding: 14px 28px;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  background: #f3f4f6;
  color: #374151;
}

.audio-control-btn-large:hover {
  background: #e5e7eb;
}

.audio-control-btn.play-btn-large,
.audio-control-btn-large.play-btn-large {
  background: #3b82f6;
  color: white;
}

.audio-control-btn.play-btn-large:hover,
.audio-control-btn-large.play-btn-large:hover {
  background: #2563eb;
}

/* ========== THEME SUPPORT ========== */

/* Dark Theme */
body.dark-theme .audio-container {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-theme .audio-title,
body.dark-theme .audio-hero-title,
body.dark-theme .audio-card-title,
body.dark-theme .audio-card-speaker {
  color: #ffffff;
}

body.dark-theme .audio-subtitle,
body.dark-theme .audio-card-description,
body.dark-theme .audio-time-display {
  color: #e8e8e8;
}

body.dark-theme .audio-card {
  background: #1e1e1e;
  border-color: #3d3d3d;
}

body.dark-theme .audio-card:hover {
  background: #2d2d2d;
}

body.dark-theme .audio-search-bar input {
  background: #1e1e1e;
  border-color: #3d3d3d;
  color: #e8e8e8;
}

body.dark-theme .audio-player-section,
body.dark-theme .audio-description {
  background: #1e1e1e;
}

body.dark-theme .audio-control-btn-large {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-theme .audio-player-controls .audio-control-btn {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-theme .audio-card .play-icon {
  color: #1e3a8a;
}

body.dark-theme .audio-card:hover .play-icon {
  color: #ffffff;
}

/* Parchment Theme */
body.parchment-theme .audio-container {
  background: linear-gradient(180deg, #f5e6c8 0%, #f0e6d0 100%);
}

body.parchment-theme .audio-title,
body.parchment-theme .audio-hero-title,
body.parchment-theme .audio-card-title,
body.parchment-theme .audio-card-speaker {
  color: #1a1a1a;
}

body.parchment-theme .audio-subtitle,
body.parchment-theme .audio-card-description,
body.parchment-theme .audio-time-display {
  color: #3d2914;
}

body.parchment-theme .audio-card {
  background: #fff8e7;
  border-color: #d4c4a8;
}

body.parchment-theme .audio-card:hover {
  background: #f0e6d0;
}

body.parchment-theme .audio-search-bar input {
  background: #fff8e7;
  border-color: #d4c4a8;
  color: #3d2914;
}

body.parchment-theme .audio-player-section,
body.parchment-theme .audio-description {
  background: #fff8e7;
}

body.parchment-theme .audio-control-btn-large {
  background: #f0e6d0;
  color: #3d2914;
}

body.parchment-theme .audio-player-controls .audio-control-btn {
  background: #f0e6d0;
  color: #3d2914;
}

body.parchment-theme .audio-card .play-icon {
  color: #3d2914;
}

body.parchment-theme .audio-card:hover .play-icon {
  color: #1a1a1a;
}

/* Light Theme */
body.light-theme .audio-container {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
