/* =========================================================
   RETROBASS R-26
   Phase 11: Live-Metadaten
   ========================================================= */

/* ---------------------------------------------------------
   Gesamter Now-Playing-Bereich
   --------------------------------------------------------- */

.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    min-width: 0;

    text-align: center;

    transition:
        opacity 220ms ease,
        filter 220ms ease;
}

/* ---------------------------------------------------------
   Sendername
   --------------------------------------------------------- */

.now-playing__station {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    max-width: 100%;

    color: rgba(220, 124, 27, 0.66);

    font-size: clamp(0.29rem, 0.49vw, 0.40rem);
    letter-spacing: 0.15em;
}

.now-playing__station > span:first-child {
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.now-playing__live {
    flex: 0 0 auto;

    padding: 1px 3px;

    border: 1px solid rgba(229, 139, 47, 0.30);
    border-radius: 2px;

    color: #e4943e;

    font-size: 0.82em;
    letter-spacing: 0.10em;

    box-shadow:
        0 0 4px rgba(226, 132, 37, 0.12);
}

/* ---------------------------------------------------------
   Sendung
   --------------------------------------------------------- */

.now-playing__program {
    max-width: 100%;
    margin:
        clamp(3px, 0.45vw, 5px)
        0
        0;

    overflow: hidden;

    color: rgba(218, 120, 23, 0.46);

    font-size: clamp(0.27rem, 0.46vw, 0.37rem);
    letter-spacing: 0.11em;

    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------
   Interpret und Titel
   --------------------------------------------------------- */

.now-playing__track {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    min-width: 0;
    margin-top: clamp(6px, 0.95vw, 10px);
}

.now-playing__artist {
    display: block;

    max-width: 96%;

    overflow: hidden;

    color: rgba(227, 137, 43, 0.72);

    font-size: clamp(0.38rem, 0.67vw, 0.54rem);
    letter-spacing: 0.11em;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.now-playing__title {
    display: block;

    max-width: 98%;
    margin-top: 3px;

    overflow: hidden;

    color: #eca04b;

    font-size: clamp(0.67rem, 1.28vw, 0.98rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.06em;

    white-space: nowrap;
    text-overflow: ellipsis;

    text-shadow:
        0 0 6px rgba(226, 133, 40, 0.28);
}

/* ---------------------------------------------------------
   Titelwechsel
   --------------------------------------------------------- */

.now-playing.is-changing
.now-playing__artist,

.now-playing.is-changing
.now-playing__title {
    animation: metadata-change 580ms ease both;
}

/* ---------------------------------------------------------
   Fortschritt
   --------------------------------------------------------- */

.now-playing__progress {
    display: grid;
    grid-template-columns: auto minmax(55px, 1fr) auto;
    align-items: center;
    gap: 6px;

    width: min(92%, 250px);
    margin-top: clamp(7px, 1vw, 11px);
}

.now-playing__time {
    min-width: 23px;

    color: rgba(220, 125, 29, 0.48);

    font-size: clamp(0.23rem, 0.40vw, 0.33rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.now-playing__progress-track {
    position: relative;

    height: 3px;

    overflow: hidden;

    border: 1px solid rgba(218, 120, 23, 0.15);
    border-radius: 3px;

    background: rgba(42, 19, 5, 0.64);

    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.54);
}

.now-playing__progress-track > span {
    display: block;

    width: var(--track-progress, 0%);
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #9e4d0e,
            #e69a43
        );

    box-shadow:
        0 0 5px rgba(224, 127, 29, 0.34);

    transition: width 850ms linear;
}

/* ---------------------------------------------------------
   Höreranzeige
   --------------------------------------------------------- */

.radio-interface__footer {
    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto
        auto;
}

.radio-interface__listeners {
    display: inline-flex;
    align-items: center;
    gap: 3px;

    color: rgba(224, 131, 34, 0.56);

    font-variant-numeric: tabular-nums;
}

.radio-interface__listeners i {
    position: relative;

    display: block;

    width: 5px;
    height: 5px;

    border: 1px solid currentColor;
    border-radius: 50%;
}

.radio-interface__listeners i::after {
    content: "";

    position: absolute;

    top: 5px;
    left: 50%;

    width: 7px;
    height: 3px;

    border: 1px solid currentColor;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;

    transform: translateX(-50%);
}

.receiver.is-audio-playing
.radio-interface__listeners {
    color: rgba(232, 148, 57, 0.78);
}

/* ---------------------------------------------------------
   API-Status
   --------------------------------------------------------- */

.receiver.is-metadata-loading .now-playing {
    opacity: 0.58;
}

.receiver.is-metadata-loading
.now-playing__title::after {
    content: "";

    display: inline-block;

    width: 3px;
    height: 3px;
    margin-left: 5px;

    border-radius: 50%;

    background: currentColor;

    animation: metadata-loading 900ms ease-in-out infinite;
}

.receiver.has-metadata-error
.now-playing__program {
    color: rgba(222, 126, 29, 0.52);
}

/* ---------------------------------------------------------
   Tuner während Titelwechsel nicht abdunkeln
   --------------------------------------------------------- */

.receiver.is-tuning .now-playing {
    opacity: 0.22;
    filter: blur(1px);
}

/* ---------------------------------------------------------
   Animationen
   --------------------------------------------------------- */

@keyframes metadata-change {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    42% {
        opacity: 0;
        transform: translateY(-3px);
    }

    58% {
        opacity: 0;
        transform: translateY(3px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes metadata-loading {
    0%,
    100% {
        opacity: 0.22;
    }

    50% {
        opacity: 1;
    }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 480px) {
    .now-playing__program {
        display: none;
    }

    .now-playing__track {
        margin-top: 4px;
    }

    .now-playing__progress {
        width: 96%;
        margin-top: 5px;
    }

    .radio-interface__footer {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;
    }

    .radio-interface__quality {
        display: none;
    }
}

/* ---------------------------------------------------------
   Reduzierte Bewegung
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .now-playing.is-changing
    .now-playing__artist,

    .now-playing.is-changing
    .now-playing__title,

    .receiver.is-metadata-loading
    .now-playing__title::after {
        animation: none;
    }
}