/* Front-end player — readable contrast, no neon/glow, keyboard-focusable controls. */

@font-face {
    font-family: 'prompt';
    src: url('./font/SVBasicManual.ttf');
    font-display: swap;
}

.hidden {
    display: none !important;
}

.radio_container .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.radio_container,
#preview-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 520px;
    margin: 30px auto;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    padding: clamp(20px, 5vw, 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-family: 'prompt', sans-serif;
    color: #fff;
}

#track,
#program,
.preview-panel {
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    width: 100%;
    padding: 12px 15px;
    box-sizing: border-box;
    font-size: 1em;
}

h4,
#preview-title-display,
.sr42-preview-title {
    font-size: clamp(1.5em, 4vw, 2.1em);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
    z-index: 2;
    font-weight: 700;
    color: #fff;
}

.station-selector-container {
    z-index: 3;
    width: 100%;
}

#sr42-station-selector {
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
    background: #1d2327;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-size: 1rem;
}

#sr42-station-selector:focus-visible,
#volumeslider:focus-visible,
.sr42-disc-control:focus-visible,
.sr42-vlc-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#englobe,
#preview-englobe,
#player_button {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 8px 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#play_button,
#pause_button,
#round,
#preview-play-button,
#preview-pause-button,
#preview-round {
    position: absolute;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0;
}

.sr42-disc-control {
    border: 0;
    background-color: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}

.sr42-disc-control:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

#round,
#preview-round {
    z-index: 1;
    background-size: 100% 100%;
    animation: sr42-rotate 20s infinite linear;
    animation-play-state: paused;
    pointer-events: none;
}

#play_button,
#preview-play-button {
    background-size: 40%;
    z-index: 10;
}

#pause_button,
#preview-pause-button {
    background-size: 35%;
    z-index: 10;
}

@keyframes sr42-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#track h5,
#program h5,
.preview-panel h5 {
    margin: 0 0 5px;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
}

#volume-controls {
    width: 100%;
    max-width: 300px;
    margin-top: auto;
    display: flex;
    align-items: center;
    padding: 12px 0 0;
}

#volumeslider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #fff 0%, #fff var(--sr42-vol, 80%), rgba(255, 255, 255, 0.35) var(--sr42-vol, 80%), rgba(255, 255, 255, 0.35) 100%);
    border-radius: 4px;
    cursor: pointer;
}

#volumeslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #1d2327;
    border-radius: 50%;
    cursor: pointer;
}

#volumeslider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #1d2327;
    border-radius: 50%;
    cursor: pointer;
}

.sr42-vlc-link {
    font-size: 0.85em;
    background: none;
    border: 0;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.9;
}

.sr42-vlc-link:hover {
    opacity: 1;
}

.center,
#wait,
#offline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1d2327;
    color: #fff;
    padding: 16px 20px;
    border-radius: 4px;
    z-index: 20;
    text-align: center;
    border: 1px solid #fff;
}

@media (max-width: 600px) {
    .radio_container,
    #preview-container {
        max-width: 90%;
        min-height: auto;
        padding: 20px;
    }

    #englobe,
    #preview-englobe,
    #player_button {
        width: 180px;
        height: 180px;
    }
}

/* Optional video mode (station has an HLS URL). */
#sr42-video-wrap {
    width: 100%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

#sr42-video {
    display: block;
    width: 100%;
    max-height: 340px;
    background: #000;
}

.radio_container.sr42-video-on #englobe,
.radio_container.sr42-video-on #player_button {
    width: 90px;
    height: 90px;
}

.sr42-mode-toggle {
    font: inherit;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    padding: 6px 16px;
    cursor: pointer;
}

.sr42-mode-toggle:hover,
.sr42-mode-toggle:focus-visible {
    background: #fff;
    color: #1d2327;
    outline: none;
}
