/* Jitter House Radio — site-wide persistent player bar */

:root {
    --jh-radio-h: 64px;
}

body { padding-top: var(--jh-radio-h, 64px) !important; }
@media (max-width: 640px) {
    body { padding-top: 56px !important; }
}

body.admin-bar #jh-radio-root { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar #jh-radio-root { top: 46px; }
    body.admin-bar { padding-top: calc(var(--jh-radio-h, 64px) + 46px) !important; }
}
@media screen and (min-width: 783px) {
    body.admin-bar { padding-top: calc(var(--jh-radio-h, 64px) + 32px) !important; }
}


#jh-radio-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--jh-radio-h, 64px);
    z-index: 100001;
    background: linear-gradient(135deg, #1a0f07 0%, #3c2414 60%, #5c3a1f 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    color: #fff7ed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
}

#jh-radio-root::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px 200px at 30% -50%, rgba(217, 119, 6, 0.18), transparent 60%);
    pointer-events: none;
}

.jh-radio-bar {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(180px, 1.5fr) auto minmax(220px, 2fr) auto auto auto;
    gap: 14px;
    align-items: center;
    height: 100%;
    padding: 0 18px;
    max-width: 1600px;
    margin: 0 auto;
    z-index: 1;
}

.jh-radio-bar--empty {
    grid-template-columns: auto 1fr;
}

/* Brand */
.jh-radio-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 247, 237, 0.12);
    height: 32px;
}
.jh-radio-brand-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: #fde68a;
}
.jh-radio-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: jh-pulse 1.6s ease-out infinite;
}
@keyframes jh-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}

/* Album art */
.jh-radio-art {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: linear-gradient(135deg, #6b3e16, #8b5a2b);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255, 247, 237, 0.7);
}

/* Equalizer bars overlay (visible only when playing) */
.jh-radio-eq {
    position: absolute;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.45);
}
#jh-radio-root.is-playing .jh-radio-eq { display: flex; }
.jh-radio-eq span {
    width: 4px;
    background: #fde68a;
    border-radius: 2px;
    animation: jh-eq 1s ease-in-out infinite;
}
.jh-radio-eq span:nth-child(1) { height: 30%; animation-delay: -0.6s; }
.jh-radio-eq span:nth-child(2) { height: 60%; animation-delay: -0.3s; }
.jh-radio-eq span:nth-child(3) { height: 40%; animation-delay: 0s; }
@keyframes jh-eq {
    0%, 100% { transform: scaleY(0.4); transform-origin: bottom; }
    50%      { transform: scaleY(1);   transform-origin: bottom; }
}

/* Track info */
.jh-radio-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
.jh-radio-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff7ed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.jh-radio-meta {
    font-size: 11px;
    color: rgba(255, 247, 237, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jh-radio-source {
    color: #fde68a !important;
    font-weight: 600;
    text-decoration: none !important;
}
.jh-radio-source:hover { color: #fff7ed !important; text-decoration: underline !important; }
.jh-radio-style { color: rgba(255, 247, 237, 0.85); text-transform: uppercase; letter-spacing: 0.4px; font-size: 10px; }
.jh-radio-bpm { color: rgba(255, 247, 237, 0.85); font-variant-numeric: tabular-nums; font-size: 10px; }
.jh-sep { opacity: 0.4; padding: 0 2px; }

/* Controls */
.jh-radio-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}
.jh-radio-btn {
    background: transparent;
    border: 1px solid rgba(255, 247, 237, 0.0);
    border-radius: 8px;
    color: #fff7ed;
    font-size: 14px;
    padding: 6px 9px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s, transform 0.08s;
    line-height: 1;
    min-width: 32px;
}
.jh-radio-btn:hover {
    background: rgba(255, 247, 237, 0.10);
    border-color: rgba(255, 247, 237, 0.20);
}
.jh-radio-btn:active { transform: scale(0.96); }
.jh-radio-btn.is-active { background: rgba(251, 191, 36, 0.18); border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }

.jh-radio-play {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #1a0f07;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.35);
}
.jh-radio-play:hover {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    border: none;
    transform: scale(1.05);
}

/* Progress + scrubber */
.jh-radio-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}
.jh-radio-times {
    font-size: 10px;
    color: rgba(255, 247, 237, 0.6);
    font-variant-numeric: tabular-nums;
    text-align: center;
    letter-spacing: 0.3px;
}
.jh-radio-scrubber {
    position: relative;
    height: 6px;
    background: rgba(255, 247, 237, 0.12);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    transition: height 0.12s;
}
.jh-radio-scrubber:hover { height: 8px; }
.jh-radio-scrubber-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #ef4444);
    border-radius: 999px;
    transition: width 0.1s linear;
}

/* Mode buttons */
.jh-radio-modes {
    display: flex;
    gap: 4px;
    padding: 0 4px;
    border-left: 1px solid rgba(255, 247, 237, 0.12);
    border-right: 1px solid rgba(255, 247, 237, 0.12);
    margin: 0 2px;
}

/* Vibe buttons */
.jh-radio-vibes {
    display: flex;
    gap: 3px;
}
.jh-radio-vibe {
    background: rgba(255, 247, 237, 0.05);
    border: 1px solid transparent;
    border-radius: 999px;
    color: #fff7ed;
    font-size: 12px;
    padding: 5px 9px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.12s;
    line-height: 1;
    font-weight: 700;
}
.jh-radio-vibe:hover { background: rgba(255, 247, 237, 0.12); }
.jh-radio-vibe.is-active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(217, 119, 6, 0.95));
    color: #1a0f07;
    border-color: rgba(251, 191, 36, 0.6);
}
.jh-radio-vibe span {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.jh-radio-resume-pill {
    background: #ef4444;
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: jh-pulse 1.6s ease-out infinite;
}

.jh-radio-empty-msg {
    color: rgba(255, 247, 237, 0.7);
    font-size: 13px;
}
.jh-radio-empty-msg a { color: #fde68a; font-weight: 700; text-decoration: none; }
.jh-radio-empty-msg a:hover { text-decoration: underline; }

/* /songs/ row state — playing row gets equalizer + highlight */
.csm-songs-row.is-playing .csm-songs-art::after { content: '❚❚' !important; padding-left: 0 !important; }

/* Mobile compact mode */
@media (max-width: 900px) {
    .jh-radio-bar {
        grid-template-columns: auto auto 1fr auto auto;
        gap: 8px;
        padding: 0 10px;
    }
    .jh-radio-brand { display: none; }
    .jh-radio-progress { display: none; }
    .jh-radio-modes { display: none; }
    .jh-radio-vibes { display: none; }
    .jh-radio-info { font-size: 12px; }
    .jh-radio-title { font-size: 12px; }
    .jh-radio-meta { font-size: 10px; }
}
@media (max-width: 640px) {
    #jh-radio-root { height: 56px; }
    .jh-radio-art { width: 38px; height: 38px; font-size: 16px; }
    .jh-radio-play { width: 32px; height: 32px; font-size: 13px; }
}
