/* =====================================================
   PODCAST STICKY PLAYER — FINAL, CLEAN, RESPONSIVE
===================================================== */

/* -------------------------------
   ROOT PLAYER
-------------------------------- */
#podcast-sticky-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    height: var(--player-height, 160px);
    background: #0e0f13;

    z-index: 999999;
    display: flex;
    align-items: stretch;

    box-shadow: 0 -14px 40px rgba(0,0,0,0.6);

    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(.25,.8,.25,1);

    padding-bottom: env(safe-area-inset-bottom);
     background-color: var(--podcast-dark, #0e0f13);
}

body.podcast-player-open #podcast-sticky-player {
    transform: translateY(0);
}

/* =====================================================
   LEFT SECTION (BACKGROUND + CONTENT)
===================================================== */

.player-left {
    position: relative;
    width: 35%;
    min-width: 260px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    color: #fff;
    overflow: hidden;

    display: flex;
    align-items: center;
    padding: 1.2rem 1.4rem;
}

/* Overlay */
.player-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.45),
        rgba(0,0,0,0.85)
    );
    z-index: 1;
    pointer-events: none;
}

/* Content */
.player-left-content {
    position: relative;
    z-index: 2;

    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 1rem;
    row-gap: 0.5rem;

    width: 100%;
}

/* Episode number */
.episode-number {
    grid-column: 1 / 2;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    opacity: 0.85;
    color: #fff;
}

/* Episode title */
.episode-title {
    grid-column: 1 / 2;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

/* =====================================================
   SPEAKER
===================================================== */

.player-speaker {
    grid-column: 2 / 3;
    grid-row: 1 / span 3;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 72px;
}

.player-art {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    min-width: 64px;
    min-height: 64px;

    display: block !important;
    visibility: visible !important;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);

    transition: transform 0.3s ease;
}

.player-art:hover {
    transform: scale(1.08);
}

.player-speaker-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    opacity: 0.9;
    text-align: center;
}

/* =====================================================
   PREV / NEXT CONTROLS
===================================================== */

.episode-nav {
    grid-column: 1 / 2;

    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.episode-nav button {
    appearance: none;
    border: none;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1;
    width: 40px;
    height: 40px;

    border-radius: 10px;
    background: rgba(255,255,255,0.18);

    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.episode-nav button:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}
.episode-nav .prev::before { content: "⏮"; }
.episode-nav .next::before { content: "⏭"; }

.episode-nav button {
    color: #fff;
}

/* =====================================================
   RIGHT SIDE CONTROLS
===================================================== */

.player-right {
    flex: 1;
    position: relative;

    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
}

/* Close button — smaller + higher */
.close-player {
    position: absolute;
    top: 6px;
    right: 10px;

    width: 30px;
    height: 30px;

    border-radius: 50%;
    border: none;

    background: rgba(0,0,0,0.55);
    color: #fff;

    font-size: 1.1rem;
    cursor: pointer;
}

/* Controls row */
.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Play button */
.play-pause {
    width: 52px;
    height: 52px;

    border-radius: 50%;
    border: none;

    background: #e50914;
    color: #fff;

    font-size: 1.3rem;
    cursor: pointer;
}

.play-pause.pulse {
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(229,9,20,0.6); }
    70%  { box-shadow: 0 0 0 18px rgba(229,9,20,0); }
    100% { box-shadow: 0 0 0 0 rgba(229,9,20,0); }
}

/* Timeline */
.timeline-wrap {
    flex: 1;
}

.timeline {
    height: 6px;
    background: #333;
    border-radius: 6px;
    cursor: pointer;
}

.timeline .progress {
    height: 100%;
    width: 0%;
    background: #e50914;
}

.time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.85;
    color: #fff;
}

/* Icons */
.mute,
.share {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}
/* =====================================================
   EPISODE TRANSITIONS
===================================================== */

/* Left background fade */
.player-left {
    transition: background-image 0.4s ease;
}

/* Transition wrapper state */
.player-left.is-transitioning .episode-number,
.player-left.is-transitioning .episode-title {
    opacity: 0;
    transform: translateY(6px);
}

.player-left .episode-number,
.player-left .episode-title {
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

/* Speaker image animation */
.player-left.is-transitioning .player-art {
    transform: scale(0.85);
    opacity: 0;
}

.player-art {
    transition:
        transform 0.35s ease,
        opacity 0.35s ease;
}

/* Speaker name */
.player-left.is-transitioning .player-speaker-name {
    opacity: 0;
}

.player-speaker-name {
    transition: opacity 0.35s ease;
}

/* Controls stay stable (no animation) */
.player-right {
    transition: none;
}

/* =====================================================
   MOBILE RESPONSIVE
===================================================== */

@media (max-width: 768px) {

    #podcast-sticky-player {
        flex-direction: column;
        height: auto;
        min-height: 240px;
    }

    .player-left {
        width: 100%;
        min-width: 0;
        padding: 1rem;
    }

    .player-left-content {
        grid-template-columns: 1fr auto;
    }

    .player-right {
        width: 100%;
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .controls {
        flex-wrap: wrap;
    }

    .timeline-wrap {
        width: 100%;
        order: 2;
    }

    .play-pause {
        width: 58px;
        height: 58px;
        font-size: 1.5rem;
    }

    .close-player {
        top: 4px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* =====================================================
   BODY OFFSET
===================================================== */

body.podcast-player-open {
    padding-bottom: var(--player-height, 160px);
    overflow-x: hidden;
}
/* Share hover */
.share-wrap {
    position: relative;
}

.share-menu {
    position: absolute;
    bottom: 120%;
    right: 0;
    background: #111;
    border-radius: 12px;
    padding: 0.6rem;
    display: none;
    min-width: 140px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.share-wrap:hover .share-menu {
    display: flex;
    flex-direction: column;
}

.share-menu a {
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background .25s;
}

.share-menu a:hover {
    background: var(--podcast-accent);
}
