/* app.css – layout + glass footer player + waveform + now-playing */

/* ---- Base ---- */
body {
    background-color: #f9fafb;
    padding-bottom: 80px;
    /* space for sticky footer player */
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ================================
   GLOBAL FOOTER PLAYER (Spotify-ish)
   ================================ */

#ph-player.ph-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    padding: 0.4rem 0.9rem;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: linear-gradient(120deg,
            rgba(15, 23, 42, 0.94),
            rgba(15, 23, 42, 0.8));
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.7);
    color: #f9fafb;
    font-size: 0.85rem;
}

#ph-player.is-hidden {
    display: none;
}

.ph-player-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Left block: cover + meta */
.ph-player-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    min-width: 0;
}

.ph-player-cover img {
    border-radius: 10px;
    width: 48px;
    height: 48px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.ph-player-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    max-width: 260px;
}

.ph-player-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-player-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-player-status {
    font-size: 0.7rem;
    color: #a5b4fc;
}

/* Center block: controls + seek + waveform */
.ph-player-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.ph-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ph-player-seek-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.ph-time {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Seek slider */
.ph-seek,
#ph-player-seek {
    flex: 1;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
    cursor: pointer;
}

/* Waveform */
.ph-player-wave {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    margin-top: 1px;
    opacity: 0.6;
}

.ph-wave-bar {
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(to top, #22c55e, #bbf7d0);
    transform-origin: center bottom;
    transform: scaleY(0.4);
}

/* Animate waveform only when playing */
#ph-player.is-playing .ph-wave-bar {
    animation: phWave 1s infinite ease-in-out;
}

#ph-player.is-playing .ph-wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

#ph-player.is-playing .ph-wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

#ph-player.is-playing .ph-wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

#ph-player.is-playing .ph-wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes phWave {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}

/* Right block: speed + volume */
.ph-player-right {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ph-player-speed select {
    min-width: 72px;
    font-size: 0.75rem;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

/* Volume */
.ph-player-volume {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ph-player-volume i {
    font-size: 0.8rem;
    color: #9ca3af;
}

#ph-player-volume {
    width: 90px;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
    cursor: pointer;
}

/* Range thumbs (WebKit) */
.ph-seek::-webkit-slider-thumb,
#ph-player-seek::-webkit-slider-thumb,
#ph-player-volume::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #38bdf8;
    border: none;
    margin-top: -4px;
}

/* Firefox track/thumb */
.ph-seek::-moz-range-track,
#ph-player-seek::-moz-range-track,
#ph-player-volume::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
}

.ph-seek::-moz-range-thumb,
#ph-player-seek::-moz-range-thumb,
#ph-player-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #38bdf8;
    border: none;
}

/* Mute button tweak */
#ph-player-mute {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

/* ================================
   EPISODE ROW HIGHLIGHT (NOW PLAYING)
   ================================ */

.ep-row-playing {
    background: #e6ffed !important;
    /* soft green */
    border-left: 4px solid #23a55a !important;
    /* green accent */
    border-radius: 8px;
    padding-left: 12px;
    /* compensate border */
}

.ep-row-playing .ep-now-playing-label {
    display: inline-block !important;
}

.ep-row-playing .is-size-7,
.ep-row-playing p,
.ep-row-playing strong {
    color: #065f46 !important;
}

/* ================================
   RESPONSIVE TWEAKS
   ================================ */

/* Tablet and down: stack layout and reduce clutter */
@media (max-width: 768px) {
    body {
        padding-bottom: 110px;
        /* a bit more room for taller player */
    }

    #ph-player.ph-player {
        padding: 0.55rem 0.75rem;
        font-size: 0.8rem;
    }

    .ph-player-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .ph-player-left {
        width: 100%;
        align-items: center;
    }

    .ph-player-cover img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .ph-player-meta {
        max-width: 100%;
    }

    /* Hide subtitle to free horizontal space */
    .ph-player-subtitle {
        display: none;
    }

    .ph-player-center {
        width: 100%;
        align-items: stretch;
        gap: 0.3rem;
    }

    .ph-player-controls {
        justify-content: center;
    }

    .ph-player-seek-row {
        align-items: center;
    }

    /* Waveform is nice but can feel busy on small mobile */
    .ph-player-wave {
        display: none;
    }

    .ph-player-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .ph-player-speed select {
        min-width: 64px;
        font-size: 0.7rem;
    }
}

/* Very small phones: simplify volume controls */
@media (max-width: 480px) {
    #ph-player.ph-player {
        padding: 0.5rem 0.65rem;
    }

    .ph-player-volume {
        gap: 0.1rem;
    }

    #ph-player-volume {
        display: none;
        /* hide slider, keep only mute icon */
    }

    .ph-player-speed select {
        min-width: 56px;
    }
}

/* Make 15s skip buttons green */
#ph-skip-back,
#ph-skip-forward {
    color: #23a55a !important;
    /* Bulma "success" green */
}

#ph-skip-back:hover,
#ph-skip-forward:hover {
    color: #1e8e4d !important;
    /* slightly darker green */
}

/* Category cards */
.ph-category-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ph-category-card {
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    background: #ffffff;
}

.ph-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    background: #f9fafb;
}

/* Category pills */
.ph-cat-pill {
    background: linear-gradient(135deg, #2563eb, #22c55e);
    color: #fff !important;
    border: none;
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    text-decoration: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.ph-cat-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    filter: brightness(1.05);
}

.ph-cat-pill-name {
    font-weight: 600;
    white-space: nowrap;
}

.ph-cat-pill-count {
    font-size: 0.7rem;
    opacity: 0.9;
    background: rgba(15, 23, 42, 0.25);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
}