/*   CSS CUSTOM PROPERTIES    */
:root {
    --theme-color: #d9d4cc;
    /* fallback */
    --theme-dark: #1e1e1e;
    --theme-light: #f0ede8;
}

/*   RESET & BASE    */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f7f5f0;
    color: #1e1e1e;
    padding-bottom: 110px;
    line-height: 1.5;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem 1rem;
}

/*   HEADER    */
#header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}
#header h1 span {
    transition: color 0.8s;
}

/*   NOW PLAYING HERO    */
#now-playing-hero {
    margin: 1.5rem 0 2rem 0;
    background: #fff;
    border: 2px solid #1e1e1e;
    padding: 1.6rem 1.8rem 1.4rem 1.8rem;
    position: relative;
    overflow: hidden;
}

#now-playing-hero::after {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--theme-color, #d9d4cc);
    opacity: 0.07;
    pointer-events: none;
    transition: background 1s;
}

.np-hero-content {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    position: relative;
    z-index: 1;
}

.np-visual {
    flex: 0 0 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.eq-bar {
    display: block;
    width: 8px;
    border-radius: 4px;
    background: var(--theme-color, #d9d4cc);
    transition: background 1s, height 0.3s ease;
    height: 20px;
    animation: eq-pulse 1.2s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) {
    animation-delay: 0.0s;
    height: 28px;
}
.eq-bar:nth-child(2) {
    animation-delay: 0.15s;
    height: 44px;
}
.eq-bar:nth-child(3) {
    animation-delay: 0.3s;
    height: 56px;
}
.eq-bar:nth-child(4) {
    animation-delay: 0.45s;
    height: 32px;
}
.eq-bar:nth-child(5) {
    animation-delay: 0.6s;
    height: 48px;
}
.eq-bar:nth-child(6) {
    animation-delay: 0.75s;
    height: 24px;
}
.eq-bar:nth-child(7) {
    animation-delay: 0.9s;
    height: 40px;
}
.eq-bar:nth-child(8) {
    animation-delay: 1.05s;
    height: 36px;
}

@keyframes eq-pulse {
    0% {
        transform: scaleY(0.4);
    }
    100% {
        transform: scaleY(1);
    }
}

/*  Hero text info   */
.np-info {
    flex: 1;
    min-width: 0;
}

.np-label {
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    color: #999;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.np-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: #1a1a1a;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-artist {
    font-size: 1.1rem;
    font-weight: 400;
    color: #555;
    margin-top: 0.05rem;
}

.np-show {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.25rem;
}
.np-show span {
    font-weight: 600;
    color: var(--theme-color, #444);
    transition: color 0.8s;
}

/*   Station bio    */
.station-bio {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e5e0;
    font-size: 0.9rem;
    color: #555;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    align-items: center;
}
.station-bio p {
    flex: 1;
    min-width: 180px;
    margin: 0;
}

.station-bio a {
    color: var(--theme-color, #444);
}

.station-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--theme-color, #666);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    transition: color 0.8s, background 0.8s;
    white-space: nowrap;
}
.np-dot {
    display: inline-block;
    padding: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--theme-color, #888);
    transition: background 0.8s;
    animation: dot-breathe 2s ease-in-out infinite;
}
@keyframes dot-breathe {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/*   UNIFIED INFO PANEL (recent / schedule)   */
#info-controls {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border: 2px solid #1c1c1c;
    border-bottom: none;
    background: #fff;
}

.info-toggle {
    flex: 1;
    background: #eee;
    border: none;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    letter-spacing: 0.3px;
    transition: background 0.8s, color 0.5s;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}
.info-toggle:last-child {
    border-right: none;
}
.info-toggle:hover {
    text-decoration: underline;
    border-bottom: 4px solid var(--theme-color, #d9d4cc);
    color: #1e1e1e;
    background: var(--theme-color, #d9d4cc);
    transition: border-bottom 0.1s;
}
.info-toggle.active {
    z-index: 100;
    border-bottom: 4px solid var(--theme-color, #d9d4cc);
    text-decoration: underline;
    background: transparent;
    color: #1c1c1c;
    transition: background 0.1s, border-color 0.1s;
}

#info-panel {
    background: #fff;
    border: 2px solid #1e1e1e;
    border-top: none;
    padding: 0.8rem 0.2rem 0.2rem 0.2rem;
    min-height: 160px;
}

#info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0.6rem 0.6rem 0.6rem;
}

/*   LIST ITEMS (shared for tracks & schedule)   */
#info-list li {
    padding: 0.4rem 0.7rem;
    background: var(--block-color, #f7f5f0);
    border-left: 8px solid var(--theme-color, #d9d4cc);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    transition: border-color 1s, background 1s;
}

/* Track item specific */
.track-title {
    font-weight: 650;
}
.track-artist {
    color: #555;
}
.track-time {
    font-size: 0.7rem;
    color: #999;
    white-space: nowrap;
}

/* Schedule item specific */
.schedule-container {
    border-left: 8px solid var(--block-color, #ddd);
}
.schedule-time {
    font-weight: 600;
    white-space: nowrap;
    margin-right: 0.5rem;
}
.schedule-name {
    flex: 1;
}
.schedule-desc {
    font-size: 0.8rem;
    color: #666;
}

/*   STICKY FOOTER    */


/*  FOOTER — always single row   */
#player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1e1e1e;
    color: #f0ede8;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: nowrap;
    border-top: 5px solid var(--theme-color, #444);
    z-index: 100;
    transition: border-color 1s;
    min-height: 64px;
}

#player-controls {
    flex: 0 0 auto;
}

#play-pause-btn {
    background: var(--theme-color, #fff);
    color: #1e1e1e;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.2rem 1.2rem;
    cursor: pointer;
    min-width: 72px;
    text-align: center;
    letter-spacing: 0.5px;
    transition: background 1s, transform 0.1s;
    border-radius: 4px;
    line-height: 1.6;
}
#play-pause-btn:hover {
    filter: brightness(0.9);
    transform: scale(0.97);
}

#footer-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

#footer-now-playing {
    font-size: 1rem;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#footer-now-playing #np-title {
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--theme-color, #ccc);
    transition: color 0.3s;
}

#footer-now-playing #np-artist {
    color: #ddd;
}

#footer-block-name {
    font-size: 0.7rem;
    color: var(--theme-color, #777);
}

#footer-station-name {
    font-size: 0.7rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#volume-control {
    flex: 0 0 90px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #aaa;
    font-size: 1rem;
}

#volume-slider {
    flex: 1;
    min-width: 24px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #444;
    border-radius: 2px;
    outline: none;
    transition: background 0.3s;
    cursor: pointer;
}

#volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--theme-color, #d9d4cc);
    cursor: pointer;
    margin-top: -5px;
    transition: background 0.8s;
    border: none;
}

#volume-slider::-moz-range-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
    border: none;
}

#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--theme-color, #d9d4cc);
    cursor: pointer;
    border: none;
    transition: background 0.8s;
}

#volume-slider:focus-visible {
    outline: 2px solid var(--theme-color, #aaa);
    outline-offset: 2px;
}

/* Hide audio element */
audio {
    display: none;
}

/*   RESPONSIVE   */
@media (max-width: 550px) {
    body {
        padding-bottom: 120px;
    }

    #direct-link {
        font-size: 0.6rem;
    }
    #direct-link a {
        font-size: 0.6rem;
    }

    #player-bar {
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
        min-height: 56px;
    }

    #play-pause-btn {
        font-size: 1rem;
        min-width: 64px;
        padding: 0.1rem 0.7rem;
        line-height: 1.5;
    }

    #footer-now-playing {
        font-size: 0.8rem;
    }
    #footer-now-playing #np-title {
        font-size: 0.8rem;
    }
    #footer-block-name {
        font-size: 0.6rem;
    }
    #footer-station-name {
        font-size: 0.6rem;
    }

    #volume-control {
        flex: 0 0 32px;
        gap: 0.3rem;
        font-size: 0.85rem;
    }
    #volume-slider {
        min-width: 8px;
    }

    .info-toggle {
        font-size: 0.8rem;
        padding: 0.4rem 0.4rem;
    }
    #info-list li {
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    .track-time {
        font-size: 0.6rem;
    }
    .schedule-desc {
        font-size: 0.7rem;
    }

    #now-playing-hero {
        padding: 1.2rem 1rem 1rem 1rem;
    }
    .np-hero-content {
        gap: 1rem;
        flex-wrap: wrap;
    }
    .np-visual {
        flex: 0 0 60px;
        height: 60px;
        gap: 4px;
    }
    .eq-bar {
        width: 5px;
        height: 16px;
    }
    .eq-bar:nth-child(1) {
        height: 20px;
    }
    .eq-bar:nth-child(2) {
        height: 32px;
    }
    .eq-bar:nth-child(3) {
        height: 44px;
    }
    .eq-bar:nth-child(4) {
        height: 26px;
    }
    .eq-bar:nth-child(5) {
        height: 38px;
    }
    .eq-bar:nth-child(6) {
        height: 18px;
    }
    .eq-bar:nth-child(7) {
        height: 34px;
    }
    .eq-bar:nth-child(8) {
        height: 24px;
    }
    .np-title {
        font-size: 1.3rem;
    }
    .np-artist {
        font-size: 0.95rem;
    }
    .station-bio {
        font-size: 0.8rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }
    .station-tag {
        align-self: flex-start;
        font-size: 0.6rem;
    }
    #header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 400px) {
    #player-bar {
        padding: 0.3rem 0.4rem;
        gap: 0.3rem;
        min-height: 48px;
    }

    #play-pause-btn {
        font-size: 0.85rem;
        min-width: 44px;
        padding: 0.05rem 0.5rem;
        line-height: 1.4;
    }

    #footer-now-playing {
        font-size: 0.65rem;
    }
    #footer-now-playing #np-title {
        font-size: 0.65rem;
    }
    #footer-block-name {
        font-size: 0.5rem;
    }
    #footer-station-name {
        font-size: 0.5rem;
    }

    #volume-control {
        flex: 0 0 48px;
        gap: 0.2rem;
        font-size: 0.7rem;
    }
    #volume-slider {
        min-width: 12px;
    }

    .np-title {
        font-size: 1.1rem;
    }
    .np-artist {
        font-size: 0.85rem;
    }
    .np-visual {
        flex: 0 0 48px;
        height: 48px;
        gap: 3px;
    }
    .eq-bar {
        width: 4px;
    }
    #now-playing-hero {
        padding: 0.8rem 0.8rem 0.8rem 0.8rem;
    }
}
