/*
 * Wanderland Radio — Persistent Bar v5.0.0
 * Neon Noir palette — matches widget.css
 */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&display=swap');

#wlr-bar, #wlr-bar * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Shell ────────────────────────────────────────────────────────── */
#wlr-bar {
    --c-bg:      #0a0a0a;
    --c-border:  rgba(243,239,230,.12);
    --c-ink:     #f3efe6;
    --c-muted:   #a09a8e;
    --c-dim:     #5a564f;
    --c-red:     #d62828;
    --c-red-glow:rgba(214,40,40,.18);
    --c-hover:   rgba(243,239,230,.06);
    --c-track:   rgba(243,239,230,.08);
    --bar-h:     72px;
    --sans:      'Oswald', sans-serif;

    position:    fixed;
    bottom:      0;
    left:        0;
    right:       0;
    z-index:     99999;
    height:      var(--bar-h);
    background:  var(--c-bg);
    border-top:  1px solid var(--c-border);
    font-family: var(--sans);
    color:       var(--c-ink);
    box-shadow:  0 -4px 24px rgba(0,0,0,.5);
    transition:  transform .35s cubic-bezier(.4,0,.2,1),
                 opacity   .35s ease;
}

#wlr-bar.wlr-bar--hidden {
    transform:      translateY(100%);
    opacity:        0;
    pointer-events: none;
}

/* Loading indicator — thin red line animates along top border */
#wlr-bar.wlr-bar--loading::before {
    content:    '';
    position:   absolute;
    top:        -1px;
    left:       0;
    width:      40%;
    height:     2px;
    background: var(--c-red);
    animation:  wlr-loading 1.2s ease-in-out infinite alternate;
}
@keyframes wlr-loading {
    from { left: 0; width: 30%; }
    to   { left: 70%; width: 30%; }
}

body          { padding-bottom: calc(var(--bar-h) + 4px) !important; }
body.admin-bar #wlr-bar { bottom: 32px; }

/* ── Inner layout ─────────────────────────────────────────────────── */
.wlr-bar__inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 24px;
    padding: 5px 28px !important;
    max-width: 1400px;
    margin: 0 auto !important;
}

/* ── Left: branding + track info ──────────────────────────────────── */
.wlr-bar__info {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    min-width:      0;
}

.wlr-bar__label {
    font-size:      9px;
    font-weight:    700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color:          var(--c-dim);
    white-space:    nowrap;
    line-height:    1;
}

.wlr-bar__label span { color: var(--c-red); }

.wlr-bar__title {
    font-size:      15px;
    font-weight:    600;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space:    nowrap;
    overflow:       hidden;
    text-overflow:  ellipsis;
    color:          var(--c-ink);
    line-height:    1.2;
}

.wlr-bar__artist {
    font-size:      11px;
    font-weight:    400;
    letter-spacing: .06em;
    text-transform: uppercase;
    color:          var(--c-red);
    white-space:    nowrap;
    overflow:       hidden;
    text-overflow:  ellipsis;
    line-height:    1;
}

/* ── Centre: controls + progress ──────────────────────────────────── */
.wlr-bar__centre {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            8px;
    min-width:      280px;
}

.wlr-bar__controls {
    display:     flex;
    align-items: center;
    gap:         6px;
}

.wlr-bar__btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff !important;
    padding: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    line-height: 0 !important;
    transition: color .15s, background .15s, transform .12s;
    flex-shrink: 0;
}

.wlr-bar__btn:hover {
    color:      var(--c-ink);
    background: var(--c-hover);
    transform:  scale(1.08);
}

.wlr-bar__btn:active { transform: scale(.94); }

.wlr-bar__btn svg { width: 15px; height: 15px; }

/* Play button — larger, accented */
.wlr-bar__btn--play {
    width:        42px;
    height:       42px;
    border-radius:50%;
    border:       1.5px solid rgba(243,239,230,.22);
    color:        var(--c-ink);
    margin:       0 6px;
    transition:   color .15s, border-color .15s,
                  background .15s, transform .12s, box-shadow .15s;
}

.wlr-bar__btn--play svg { width: 16px; height: 16px; }

.wlr-bar__btn--play:hover {
    color:        var(--c-red);
    border-color: var(--c-red);
    background:   var(--c-red-glow);
    box-shadow:   0 0 12px var(--c-red-glow);
    transform:    scale(1.08);
}

#wlr-bar.wlr-bar--playing .wlr-bar__btn--play {
    color:        var(--c-red);
    border-color: var(--c-red);
    background:   var(--c-red-glow);
    box-shadow:   0 0 10px var(--c-red-glow);
}

/* Progress row */
.wlr-bar__progress-wrap {
    width:   100%;
    display: flex;
    flex-direction: column;
    gap:     4px;
}

.wlr-bar__progress {
    width:         100%;
    height:        3px;
    background:    var(--c-track);
    border-radius: 2px;
    cursor:        pointer;
    position:      relative;
    overflow:      hidden;
    transition:    height .15s;
}

.wlr-bar__progress:hover { height: 5px; }

.wlr-bar__fill {
    height:        100%;
    width:         0%;
    background:    var(--c-red);
    border-radius: 2px;
    transition:    width .1s linear;
}

.wlr-bar__time {
    display:         flex;
    justify-content: space-between;
    font-size:       9px;
    letter-spacing:  .06em;
    color:           var(--c-dim);
}

/* ── Right: close ─────────────────────────────────────────────────── */
.wlr-bar__right {
    display:         flex;
    justify-content: flex-end;
    align-items:     center;
}

.wlr-bar__btn--close {
    color: var(--c-dim);
}

.wlr-bar__btn--close:hover {
    color:      #ff5a3c;
    background: rgba(255,90,60,.08);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wlr-bar__inner {
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 0 16px;
    }
    .wlr-bar__progress-wrap { display: none; }
    .wlr-bar__right { display: none; }
    .wlr-bar__centre { min-width: unset; gap: 0; }
    .wlr-bar__time   { display: none; }
}

@media (max-width: 480px) {
    :root { --bar-h: 64px; }
    .wlr-bar__title  { font-size: 13px; }
    .wlr-bar__artist { font-size: 10px; }
    .wlr-bar__btn--play { width: 36px; height: 36px; }
}
