/* ================================
   AUDIO PAGE - css/audio-page.css
   Urdu Jahan By Hamid Hasan
   ================================ */

/* ---- Hero Variant ---- */
.audio-hero .about-hero-tag { color: #c9a96e; }
.audio-hero h1 { font-size: clamp(30px, 4vw, 50px); }
.audio-hero h1 .gold { color: #c9a96e; }
.audio-hero-stats { display: flex; gap: 36px; margin-top: 36px; justify-content: center; }
.audio-hero .about-stat-num { color: #c9a96e; }
.audio-hero .about-stat-lbl { color: rgba(245,240,232,0.45); }

/* ---- Filter Bar ---- */
.filter-bar {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.filter-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-wrap svg {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    stroke: #aaa; fill: none;
}
.search-wrap input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid #e0ddd8;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #333;
    background: #faf9f7;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.search-wrap input:focus { border-color: #c9a96e; box-shadow: 0 0 0 3px rgba(201,169,110,0.12); }
.search-wrap input::placeholder { color: #bbb; }

.filter-select {
    padding: 10px 16px;
    border: 1px solid #e0ddd8;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #555;
    background: #faf9f7;
    cursor: pointer;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.filter-select:focus { border-color: #c9a96e; box-shadow: 0 0 0 3px rgba(201,169,110,0.12); }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
    padding: 7px 18px;
    border-radius: 24px;
    border: 1px solid #e0ddd8;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.pill.active, .pill:hover {
    background: #1a0a2e;
    color: #c9a96e;
    border-color: #1a0a2e;
}

/* ---- Episodes Section ---- */
.audio-episodes {
    padding: 60px 0 80px;
    background: linear-gradient(135deg,rgba(15,26,63,0.02) 0%,rgba(212,175,55,0.03) 100%);
}
.audio-episodes .about-mission-head { margin-bottom: 40px; }
.audio-episodes .about-mission-head h2 { font-size: clamp(24px, 3vw, 32px); }
.audio-episodes .about-mission-head .ep-count { font-size: 14px; color: #999; font-weight: 400; margin-left: 8px; }

/* ---- 4-column Grid ---- */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    min-height: 200px;
}

/* ---- Episode Card ---- */
.ep-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    outline: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.ep-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(15,26,63,0.1);
}
.ep-card:focus-visible {
    border-color: #c9a96e;
    box-shadow: 0 0 0 3px rgba(201,169,110,0.25);
}
.ep-card--playing {
    border-color: #c9a96e !important;
    box-shadow: 0 6px 24px rgba(201,169,110,0.25) !important;
}

.ep-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg,#1a0a2e,#0F1A3F);
    flex-shrink: 0;
}
.ep-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    filter: brightness(0.85);
    transition: transform 0.4s ease, filter 0.3s ease;
}
.ep-card:hover .ep-thumb img { transform: scale(1.06); filter: brightness(0.65); }

.ep-genre-tag {
    position: absolute; top: 10px; left: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 9px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: #c9a96e; background: rgba(17,5,32,0.85);
    border-radius: 4px; padding: 4px 10px;
}
.ep-cat-tag {
    position: absolute; top: 36px; left: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 9px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: #fff; background: rgba(212,175,55,0.25);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 4px; padding: 3px 9px;
}
.ep-num-tag {
    position: absolute; top: 10px; right: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 9px; font-weight: 600;
    color: rgba(245,240,232,0.4); letter-spacing: 1px;
}
.ep-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s;
    background: rgba(17,5,32,0.3);
}
.ep-card:hover .ep-play-overlay { opacity: 1; }
.ep-play-circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: #c9a96e; border: 2px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s;
    box-shadow: 0 8px 24px rgba(201,169,110,0.3);
}
.ep-card:hover .ep-play-circle { transform: scale(1.08); }
.ep-play-circle svg { width: 18px; height: 18px; fill: #1a0a2e; margin-left: 3px; }

.ep-dur-tag {
    position: absolute; bottom: 10px; right: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 10px; font-weight: 600;
    color: #f5f0e8; background: rgba(17,5,32,0.75);
    border-radius: 4px; padding: 3px 8px; letter-spacing: 0.3px;
}

.ep-body {
    padding: 14px 16px 18px;
    flex: 1; display: flex; flex-direction: column; gap: 6px;
}
.ep-author-row { display: flex; align-items: center; gap: 8px; }
.ep-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 1.5px solid rgba(201,169,110,0.35);
    background: #e8e0f0;
}
.ep-author-name {
    font-family: 'Poppins', sans-serif;
    font-size: 10px; font-weight: 600; color: #7a5a9a;
    letter-spacing: 0.3px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.ep-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px; font-weight: 700; color: #1a0a2e; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    min-height: 39px; /* 2 lines exact – keeps footers aligned */
}
.ep-title-urdu {
    font-family: 'Playfair Display', serif;
    font-size: 12px; color: #c9a96e; font-style: italic; margin-top: 1px;
    min-height: 17px; /* always reserve one line – even when empty */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 11px; color: #888; line-height: 1.65; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    min-height: 36px; /* 2 lines exact – no big gaps below short text */
}
.ep-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.ep-date { font-family: 'Poppins', sans-serif; font-size: 10px; color: #bbb; }
.ep-actions { display: flex; gap: 6px; }
.ep-act-btn {
    width: 30px; height: 30px; border-radius: 6px;
    border: 1px solid #e8e4de;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; background: #fff; padding: 0;
    transition: border-color 0.2s, background 0.2s;
}
.ep-act-btn:hover { border-color: #c9a96e; background: #fdf8f0; }
.ep-act-btn svg { width: 13px; height: 13px; stroke: #bbb; fill: none; stroke-width: 1.5; transition: stroke 0.2s; }
.ep-act-btn:hover svg { stroke: #c9a96e; }
.ep-act-btn.liked svg { stroke: #c9a96e; fill: #c9a96e; }

/* Empty state */
.ep-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
    color: #bbb;
}
.ep-empty svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: 0.45; display: block; margin: 0 auto 14px; }
.ep-empty p { font-family: 'Poppins', sans-serif; font-size: 14px; }

/* ---- Load More ---- */
.load-more-row { text-align: center; margin-top: 40px; }
.load-more-btn {
    font-family: 'Poppins', sans-serif;
    display: inline-flex; align-items: center; gap: 8px;
    background: #1a0a2e; color: #c9a96e;
    border: none; border-radius: 8px;
    padding: 14px 40px; font-size: 13px; font-weight: 600;
    cursor: pointer; letter-spacing: 0.5px;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}
.load-more-btn:hover { background: #2d1050; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,10,46,0.2); }
.load-more-btn svg { width: 14px; height: 14px; stroke: #c9a96e; fill: none; stroke-width: 2; }

/* ---- Now Playing Bar ---- */
.now-playing-bar {
    position: sticky; bottom: 0; z-index: 100;
    background: #1a0a2e;
    border-top: 2px solid #c9a96e;
    padding: 14px 5%;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
}
.np-thumb {
    width: 46px; height: 46px; border-radius: 6px;
    object-fit: cover; flex-shrink: 0;
    border: 1.5px solid rgba(201,169,110,0.35);
}
.np-info { flex: 1; min-width: 0; }
.np-title {
    font-family: 'Playfair Display', serif;
    font-size: 14px; font-weight: 700; color: #f5f0e8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-author { font-family: 'Poppins', sans-serif; font-size: 11px; color: #c9a96e; margin-top: 2px; }
.np-progress-wrap {
    flex: 1; min-width: 120px; max-width: 320px;
    display: flex; flex-direction: column; gap: 5px;
}
.np-progress { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.np-fill { height: 100%; background: #c9a96e; border-radius: 2px; width: 0%; transition: width 1s linear; }
.np-time { font-family: 'Poppins', sans-serif; font-size: 10px; color: rgba(245,240,232,0.38); letter-spacing: 0.5px; }
.np-controls { display: flex; align-items: center; gap: 10px; }
.np-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(201,169,110,0.3);
    background: rgba(201,169,110,0.08);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; transition: background 0.2s;
}
.np-btn:hover { background: rgba(201,169,110,0.18); }
.np-btn svg { width: 14px; height: 14px; stroke: #c9a96e; fill: none; stroke-width: 2; }
.np-btn.play { width: 44px; height: 44px; background: #c9a96e; border-color: #c9a96e; }
.np-btn.play:hover { background: #e0be80; }
.np-btn.play svg { stroke: none; }

/* Donate nav button */
.nav-donate {
    color: #c9a96e !important;
    border: 1px solid rgba(201,169,110,0.45);
    border-radius: 4px;
    padding: 5px 14px !important;
    font-size: 12px; letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s;
}
.nav-donate:hover { background: rgba(201,169,110,0.12) !important; border-color: #c9a96e; }

/* ================================
   EPISODE DETAIL MODAL
   ================================ */
.ep-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,2,15,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
  overflow-y: auto;
  padding: 20px;
}
.ep-modal-overlay.active {
  opacity: 1; visibility: visible;
}

.ep-modal {
  background: #12082a;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(201,169,110,0.12);
  border-bottom: none;
  position: relative;
}
.ep-modal-overlay.active .ep-modal {
  transform: translateY(0);
}

.ep-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.45);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(4px);
}
.ep-modal-close:hover {
  background: rgba(201,169,110,0.2);
  border-color: #c9a96e;
}
.ep-modal-close svg {
  width: 16px; height: 16px; stroke: #f5f0e8;
}

/* Hero Section */
.ep-modal-hero {
  position: relative;
  padding: 40px 32px 28px;
  overflow: hidden;
  flex-shrink: 0;
}
.ep-modal-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: blur(20px) brightness(0.35);
  transform: scale(1.1);
}
.ep-modal-hero-content {
  position: relative; z-index: 1;
  display: flex; gap: 20px; align-items: flex-start;
}
.ep-modal-thumb-wrap {
  flex-shrink: 0;
  width: 110px; height: 110px;
  border-radius: 14px; overflow: hidden;
  border: 2px solid rgba(201,169,110,0.3);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ep-modal-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ep-modal-info { flex: 1; min-width: 0; }
.ep-modal-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: #1a0a2e; background: #c9a96e;
  border-radius: 3px; padding: 3px 10px;
  margin-bottom: 10px;
}
.ep-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  color: #f5f0e8;
  line-height: 1.2;
  margin-bottom: 2px;
}
.ep-modal-title-ur {
  font-family: 'Playfair Display', serif;
  font-size: 14px; font-style: italic;
  color: #c9a96e;
  margin-bottom: 8px;
}
.ep-modal-meta {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px; color: rgba(245,240,232,0.5);
  margin-bottom: 8px;
}
.ep-modal-sep { color: #c9a96e; opacity: 0.5; }
.ep-modal-desc {
  font-family: 'Poppins', sans-serif;
  font-size: 12px; color: rgba(245,240,232,0.55);
  line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Parts List */
.ep-modal-body {
  flex: 1; overflow-y: auto;
  padding: 0 32px 24px;
}
.ep-modal-body::-webkit-scrollbar { width: 4px; }
.ep-modal-body::-webkit-scrollbar-track { background: transparent; }
.ep-modal-body::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.25); border-radius: 2px; }

.ep-modal-parts-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px;
  border-bottom: 1px solid rgba(201,169,110,0.1);
  margin-bottom: 8px;
}
.ep-modal-parts-header h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 13px; font-weight: 600;
  color: #f5f0e8; letter-spacing: 0.5px;
}
.ep-modal-parts-count {
  font-family: 'Poppins', sans-serif;
  font-size: 11px; color: rgba(245,240,232,0.3);
}

.ep-modal-parts { display: flex; flex-direction: column; gap: 4px; }

.ep-part {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s;
  border: 1px solid transparent;
}
.ep-part:hover { background: rgba(201,169,110,0.06); }
.ep-part:active { background: rgba(201,169,110,0.1); }
.ep-part--playing {
  background: rgba(201,169,110,0.1);
  border-color: rgba(201,169,110,0.2);
}

.ep-part-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 11px; font-weight: 700;
  color: #c9a96e;
  transition: background 0.2s, border-color 0.2s;
}
.ep-part:hover .ep-part-num {
  background: rgba(201,169,110,0.18);
  border-color: rgba(201,169,110,0.35);
}
.ep-part--playing .ep-part-num {
  background: #c9a96e;
  border-color: #c9a96e;
  color: #1a0a2e;
}

.ep-part-info { flex: 1; min-width: 0; }
.ep-part-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px; font-weight: 500;
  color: #f5f0e8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-part-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 10px; color: rgba(245,240,232,0.3);
  margin-top: 1px;
}
.ep-part-dur {
  font-family: 'Poppins', sans-serif;
  font-size: 11px; color: rgba(245,240,232,0.3);
  flex-shrink: 0;
  transition: color 0.2s;
}
.ep-part:hover .ep-part-dur { color: rgba(245,240,232,0.5); }
.ep-part--playing .ep-part-dur { color: #c9a96e; }

.ep-part-play-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ep-part:hover .ep-part-play-icon {
  background: rgba(201,169,110,0.15);
  border-color: rgba(201,169,110,0.3);
}
.ep-part--playing .ep-part-play-icon {
  background: #c9a96e;
  border-color: #c9a96e;
}
.ep-part-play-icon svg {
  width: 12px; height: 12px;
  fill: #c9a96e;
  margin-left: 2px;
  transition: fill 0.2s;
}
.ep-part--playing .ep-part-play-icon svg {
  fill: #1a0a2e;
}

/* Modal responsive */
@media (max-width: 600px) {
  .ep-modal-hero { padding: 32px 20px 24px; }
  .ep-modal-body { padding: 0 20px 20px; }
  .ep-modal-hero-content { flex-direction: column; align-items: center; text-align: center; }
  .ep-modal-thumb-wrap { width: 90px; height: 90px; }
  .ep-modal-meta { justify-content: center; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) { .episodes-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .episodes-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-inner { flex-wrap: wrap; }
    .search-wrap { min-width: 100%; }
    .audio-hero-stats { gap: 24px; }
    .np-progress-wrap { display: none; }
}
@media (max-width: 480px) {
    .episodes-grid { grid-template-columns: 1fr; }
    .now-playing-bar { padding: 12px 4%; gap: 10px; }
    .audio-hero-stats { gap: 16px; }
}
