/* ==========================================================================
   Caster.fm Collapsible Footer Radio Player Styles
   Marist Brothers of East Asia
   ========================================================================== */

/* Integrated Footer Player Card */
#footer-radio-player {
    margin-top: 1.5rem; /* Increased top margin for clean spacing below newsletter form */
    padding: 0.75rem 0.9rem;
    background: #18181b; /* matches bg-zinc-800 / footer card */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem; /* rounded-xl */
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, padding 0.3s ease;
    width: 100%;
    overflow: hidden;
}

#footer-radio-player:hover {
    border-color: rgba(196, 30, 58, 0.5); /* Marist Red #c41e3a */
    box-shadow: 0 6px 22px rgba(196, 30, 58, 0.2);
}

/* Header Bar — two-row layout */
.marist-radio-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0;
    user-select: none;
}

/* Row 1: Play button + Label + Expand button */
.marist-radio-row-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.marist-radio-row-top .marist-radio-label {
    flex: 1 1 auto;     /* takes up remaining space between play btn and expand btn */
    min-width: 0;
}

.marist-radio-row-top .marist-expand-btn {
    flex-shrink: 0;     /* expand button never shrinks */
    margin-left: auto;
}

/* Row 2: LIVE badge + Equalizer — sits below, smaller */
.marist-radio-row-bottom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Legacy selectors kept for safety (pill code removed but PJAX may reference these) */
.marist-radio-title-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
}

.marist-radio-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.marist-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c41e3a;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    box-shadow: 0 3px 10px rgba(196, 30, 58, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    padding-left: 2px; /* Center play icon visually */
}

.marist-play-btn:hover {
    transform: scale(1.08);
    background: #dc2626;
    box-shadow: 0 4px 14px rgba(196, 30, 58, 0.7);
}

.marist-play-btn:active {
    transform: scale(0.95);
}

.marist-play-btn.is-playing {
    padding-left: 0; /* Reset offset for pause icon */
    background: #991b1b;
}

.marist-radio-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Play icon inside the Expand to Play button */
.marist-expand-play-icon {
    font-size: 0.6rem;
    opacity: 0.9;
}

/* Live Badge & Expand Controls */
.marist-radio-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;     /* never compress the right-side controls */
}

.marist-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(196, 30, 58, 0.2);
    color: #f43f5e;
    border: 1px solid rgba(196, 30, 58, 0.4);
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.marist-live-dot {
    width: 5px;
    height: 5px;
    background-color: #c41e3a;
    border-radius: 50%;
    animation: maristPulse 1.5s infinite;
}

@keyframes maristPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(196, 30, 58, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(196, 30, 58, 0);
    }
}

/* Equalizer Bars */
.marist-equalizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.marist-equalizer.is-playing {
    opacity: 1;
}

.marist-equalizer-bar {
    width: 2px;
    background-color: #c41e3a;
    border-radius: 1px;
    height: 30%;
}

.marist-equalizer.is-playing .marist-equalizer-bar {
    animation: maristEq 1.2s ease-in-out infinite alternate;
}

.marist-equalizer.is-playing .marist-equalizer-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.marist-equalizer.is-playing .marist-equalizer-bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.marist-equalizer.is-playing .marist-equalizer-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.marist-equalizer.is-playing .marist-equalizer-bar:nth-child(4) { height: 50%; animation-delay: 0.4s; }

@keyframes maristEq {
    0% { height: 20%; }
    100% { height: 100%; }
}

/* Expand Button */
.marist-expand-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e4e4e7;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.marist-expand-btn:hover {
    background: rgba(196, 30, 58, 0.25);
    border-color: rgba(196, 30, 58, 0.5);
    color: #ffffff;
}

.marist-expand-icon {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Embed Slot (Hidden by Default) */
.marist-radio-embed-slot {
    width: 100%;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
    border-radius: 6px;
}

.marist-radio-embed-slot .cstrEmbed {
    width: 100%;
    margin: 0;
}

.marist-radio-embed-slot iframe {
    width: 100% !important;
    border: 0 !important;
    border-radius: 6px !important;
}

/* Expanded State */
#footer-radio-player.is-expanded {
    padding-bottom: 0.85rem;
}

#footer-radio-player.is-expanded .marist-radio-header {
    margin-bottom: 0.5rem;
}

#footer-radio-player.is-expanded .marist-radio-embed-slot {
    max-height: 380px;
    opacity: 1;
    margin-top: 0.5rem;
}

#footer-radio-player.is-expanded .marist-expand-icon {
    transform: rotate(180deg);
}

/* Top Progress Bar for Page Transitions */
#marist-pjax-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #c41e3a, #f43f5e, #fb7185);
    z-index: 100000;
    width: 0%;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.8);
    pointer-events: none;
}

/* ==========================================================================
   Floating Mobile Radio Pill Widget (#marist-radio-min-pill)
   ========================================================================== */
#marist-radio-min-pill {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 99998;
    background: rgba(24, 24, 27, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(196, 30, 58, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(196, 30, 58, 0.3);
    color: #ffffff;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: scale(1) translateY(0);
}

#marist-radio-min-pill:hover {
    background: rgba(196, 30, 58, 0.95);
    border-color: #ffffff;
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.6);
}

#marist-radio-min-pill .pill-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #c41e3a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
    padding-left: 1px;
}

#marist-radio-min-pill .pill-play-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

#marist-radio-min-pill .pill-play-btn.is-playing {
    padding-left: 0;
    background: #991b1b;
}

#marist-radio-min-pill .marist-pill-chevron {
    font-size: 0.7rem;
    color: #a1a1aa;
    transition: transform 0.3s ease, color 0.2s ease;
}

#marist-radio-min-pill:hover .marist-pill-chevron {
    color: #ffffff;
}

#marist-radio-min-pill.is-expanded .marist-pill-chevron {
    transform: rotate(180deg);
}

/* Suppress redundant raw floating widgets injected by Caster.fm embed script */
div.cstrEmbed > div[style*="position: fixed"],
iframe[src*="caster.fm"][style*="position: fixed"] {
    display: none !important;
}

/* Desktop auto-hide for floating pill when near bottom footer */
@media (min-width: 1024px) {
    #marist-radio-min-pill.hide-desktop {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.9) translateY(10px);
    }
}

