/* ============================================================
   RADIO ONLINE — PODCAST PLAYER
   ============================================================ */

.podcast-player {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ── Main row ── */
.podcast-player__main {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

/* ── Artwork ── */
.podcast-player__artwork-wrap {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
}

.podcast-player__artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .3s;
}

.podcast-player__artwork[src=""] {
    opacity: 0;
}

.podcast-player__artwork-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.podcast-player__artwork:not([src=""]) ~ .podcast-player__artwork-placeholder {
    display: none;
}

/* ── Center section ── */
.podcast-player__center {
    flex: 1;
    min-width: 0;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

/* ── Meta ── */
.podcast-player__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.podcast-player__show {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcast-player__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* ── Controls row ── */
.podcast-player__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.podcast-player__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: color .2s, background .2s, transform .15s;
    flex-shrink: 0;
}

.podcast-player__btn:disabled {
    opacity: .35;
    pointer-events: none;
}

.podcast-player__btn--skip {
    width: 36px;
    height: 36px;
    background: transparent;
}

.podcast-player__btn--skip:hover {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

.podcast-player__btn--play {
    width: 52px;
    height: 52px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(227,6,19,.4);
}

.podcast-player__btn--play:hover {
    background: var(--accent-dark);
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(227,6,19,.5);
}

.podcast-player__btn--play.is-loading .icon-play,
.podcast-player__btn--play.is-loading .icon-pause { display: none !important; }
.podcast-player__btn--play.is-loading .icon-loading { display: block !important; animation: spin .8s linear infinite; }

.podcast-player__btn--play.is-playing .icon-play { display: none !important; }
.podcast-player__btn--play.is-playing .icon-pause { display: block !important; }

/* ── Progress ── */
.podcast-player__progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.podcast-player__time {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
}

.podcast-player__progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,.12);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    outline: none;
}

.podcast-player__progress-bar:hover { height: 5px; }
.podcast-player__progress-bar:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.podcast-player__progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    pointer-events: none;
    transition: width .1s linear;
}

.podcast-player__progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    left: 0%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s, left .1s linear;
    box-shadow: 0 0 0 3px rgba(227,6,19,.3);
}

.podcast-player__progress-bar:hover .podcast-player__progress-thumb { opacity: 1; }

/* ── Bottom row ── */
.podcast-player__bottom-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.podcast-player__speed-btn {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    background: rgba(255,255,255,.07);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    cursor: pointer;
    transition: background .2s, color .2s;
    letter-spacing: .02em;
}

.podcast-player__speed-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }

.podcast-player__episodes-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    padding: 3px 0;
    transition: color .2s;
}

.podcast-player__episodes-btn:hover,
.podcast-player__episodes-btn[aria-expanded="true"] { color: var(--text); }

/* ── Episodes list ── */
.podcast-player__episodes {
    border-top: 1px solid var(--border);
    max-height: 260px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.podcast-player__episodes::-webkit-scrollbar { width: 4px; }
.podcast-player__episodes::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.podcast-player__episodes-inner { padding: 8px 0; overflow: hidden; }

.podcast-player__loading-text {
    padding: 16px 22px;
    font-size: 13px;
    color: var(--muted);
}

.podcast-episode {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    cursor: pointer;
    transition: background .15s;
    border-radius: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.podcast-episode:hover { background: rgba(255,255,255,.04); }
.podcast-episode.is-active { background: rgba(227,6,19,.08); }

.podcast-episode__thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0d0d0d;
}

.podcast-episode__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.podcast-episode__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.podcast-episode__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .15s;
    word-break: break-word;
    min-width: 0;
}

.podcast-episode:hover .podcast-episode__title,
.podcast-episode.is-active .podcast-episode__title { color: var(--text); }

.podcast-episode__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
}

.podcast-episode__duration {
    margin-left: auto;
    flex-shrink: 0;
}

.podcast-episode__play-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: background .2s, border-color .2s;
}

.podcast-episode:hover .podcast-episode__play-icon { background: var(--accent); color: #fff; border-color: transparent; }
.podcast-episode.is-active .podcast-episode__play-icon { background: var(--accent); color: #fff; border-color: transparent; }

/* ── Responsive ── */
@media screen and (max-width: 640px) {
    .podcast-player {
        max-width: 100% !important;
        overflow: hidden;
    }

    .podcast-player__main {
        flex-direction: column !important;
        align-items: stretch !important;
        overflow: hidden;
        max-width: 100%;
    }

    .podcast-player__artwork-wrap {
        flex-shrink: 0;
        width: 100% !important;
        height: 200px !important;
    }

    .podcast-player__artwork {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }

    .podcast-player__center {
        padding: 16px 16px 18px !important;
        gap: 12px;
        min-width: 0;
        overflow: hidden;
    }

    .podcast-player__show {
        font-size: 10px;
    }

    .podcast-player__title {
        font-size: 15px;
    }

    .podcast-player__controls {
        justify-content: center !important;
        gap: 16px;
    }

    .podcast-player__btn--play {
        width: 52px;
        height: 52px;
    }

    .podcast-player__btn--skip {
        width: 36px;
        height: 36px;
    }

    .podcast-player__progress-wrap {
        gap: 8px;
        overflow: hidden;
    }

    .podcast-player__time {
        font-size: 11px;
        min-width: 30px;
    }

    .podcast-player__bottom-row {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .podcast-player__episodes {
        display: none !important;
    }
}

/* ── Mobile episodes modal ── */
.pod-episodes-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: flex-end;
}

.pod-episodes-modal.is-open {
    display: flex;
}

.pod-episodes-modal__panel {
    background: var(--bg-card);
    width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 0 -8px 32px rgba(0,0,0,.5);
}

.pod-episodes-modal.is-open .pod-episodes-modal__panel {
    transform: translateY(0);
}

.pod-episodes-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.pod-episodes-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.pod-episodes-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .2s, color .2s;
    border: none;
    font-size: 18px;
    line-height: 1;
}

.pod-episodes-modal__close:hover {
    background: rgba(255,255,255,.16);
    color: var(--text);
}

.pod-episodes-modal__list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pod-episodes-modal .podcast-episode {
    padding: 14px 20px;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.pod-episodes-modal .podcast-episode__thumb {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
}

.pod-episodes-modal .podcast-episode__title {
    font-size: 14px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    word-break: break-word;
    min-width: 0;
}

.pod-episodes-modal .podcast-episode__meta {
    margin-top: 4px;
    font-size: 12px;
}

.pod-episodes-modal .podcast-episode__duration {
    margin-left: auto;
}

@media (min-width: 641px) {
    .pod-episodes-modal {
        display: none !important;
    }
}

.podcast-player.is-loading-feed .podcast-player__controls,
.podcast-player.is-loading-feed .podcast-player__progress-wrap,
.podcast-player.is-loading-feed .podcast-player__bottom-row {
    opacity: .35;
    pointer-events: none;
}

.podcast-player.is-fetching {
    position: relative;
}

.podcast-player.is-fetching::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.podcast-player.is-fetching::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pod-spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes pod-spin {
    to { transform: rotate(360deg); }
}
