:root {
    --radio-color: #4e73df;
    --radio-color-accent: #2e59d9;
    --radio-text-color: #ffffff;
    --radio-station-bg: #2b3140;
    --radio-station-hover: #4e73df;
    --radio-volume-bg: #2b3140;
    --radio-slider-color: #4e73df;
    --radio-metadata-color: #cfd4da;
}

.radio-widget {
    position: fixed;
    z-index: 1050;
    display: none;
}

.radio-widget.radio-bottom-right { right: 1.25rem; bottom: 1.25rem; }
.radio-widget.radio-bottom-left  { left: 1.25rem;  bottom: 1.25rem; }
.radio-widget.radio-top-right    { right: 1.25rem; top: 1.25rem; }
.radio-widget.radio-top-left     { left: 1.25rem;  top: 1.25rem; }

.radio-widget-toggle {
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 50%;
    background: var(--radio-color);
    color: var(--radio-text-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.3);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.radio-widget-toggle:hover {
    background: var(--radio-color-accent);
    transform: scale(1.05);
}

.radio-widget-toggle.radio-playing {
    animation: radio-pulse 1.6s ease-in-out infinite;
}

@keyframes radio-pulse {
    0%, 100% {
        box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 0.35rem var(--radio-color-accent), 0 0.3rem 1.2rem var(--radio-color-accent);
    }
}

.radio-player {
    position: fixed;
    z-index: 1060;
    width: 20rem;
    max-width: calc(100vw - 1.5rem);
    background: #1f2430;
    color: #e9ecef;
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
    display: none;
    font-family: var(--bs-body-font-family, inherit);
    font-size: 1rem;
}

.radio-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--radio-color);
    color: var(--radio-text-color);
    border-radius: 0.75rem 0.75rem 0 0;
}

.radio-player-body {
    padding: 1rem;
    border-radius: 0 0 0.75rem 0.75rem;
}

.radio-player.radio-bottom-right { right: 1.25rem; bottom: 5rem; }
.radio-player.radio-bottom-left  { left: 1.25rem;  bottom: 5rem; }
.radio-player.radio-top-right    { right: 1.25rem; top: 5rem; }
.radio-player.radio-top-left     { left: 1.25rem;  top: 5rem; }

.radio-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--radio-color);
    color: var(--radio-text-color);
}

.radio-marquee.radio-marquee-title,
.radio-marquee.radio-marquee-title .radio-marquee-inner {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: inherit;
}

.radio-player-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem;
    cursor: pointer;
    opacity: 0.8;
    flex: 0 0 auto;
}

.radio-player-close:hover { opacity: 1; }

.radio-player-body {
    padding: 1rem;
}

.radio-player-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #cfd4da;
}

.radio-player-eq {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 1rem;
}

.radio-player-eq span {
    width: 3px;
    height: 0.35rem;
    background: var(--radio-color);
    border-radius: 1px;
}

.radio-player.radio-is-playing .radio-player-eq span {
    animation: radio-eq 0.9s ease-in-out infinite;
}

.radio-player.radio-is-playing .radio-player-eq span:nth-child(2) { animation-delay: 0.15s; }
.radio-player.radio-is-playing .radio-player-eq span:nth-child(3) { animation-delay: 0.3s; }

@keyframes radio-eq {
    0%, 100% { height: 0.35rem; }
    50% { height: 1rem; }
}

.radio-player-station {
    position: relative;
    margin-bottom: 0.75rem;
    background-color: var(--radio-station-bg);
    color: #e9ecef;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.radio-station-selected {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-station-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: var(--radio-station-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 12rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.radio-station-dropdown::-webkit-scrollbar {
    display: none;
}

.radio-station-option {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
    color: #e9ecef;
    cursor: pointer;
}

.radio-player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.radio-mute-btn {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: var(--radio-track-color, #adb5bd);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.radio-mute-btn:hover {
    color: var(--radio-color);
}

.radio-volume-icon {
    line-height: 1;
}

.radio-volume-slider {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--radio-track-color, #adb5bd);
    outline: none;
    cursor: pointer;
}

.radio-volume-slider::-webkit-slider-runnable-track {
    height: 0.4rem;
    border-radius: 999px;
    background: var(--radio-track-color, #adb5bd);
    border: none;
}

.radio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--radio-slider-color);
    border: 2px solid #fff;
    cursor: pointer;
    margin-top: -0.3rem;
}

.radio-volume-slider::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--radio-slider-color);
    border: 2px solid #fff;
    cursor: pointer;
}

.radio-volume-slider::-moz-range-track {
    height: 0.4rem;
    border-radius: 999px;
    background: var(--radio-track-color, #adb5bd);
}

.radio-player-now-playing,
.radio-marquee {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--radio-metadata-color);
    line-height: 1.35;
    min-height: 1.2em;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.radio-marquee-inner {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.radio-marquee.radio-marquee-scroll .radio-marquee-inner {
    animation: radio-marquee-anim var(--marquee-duration, 14s) ease-in-out infinite;
}

@keyframes radio-marquee-anim {
    0% { transform: translateX(var(--marquee-start, 0)); }
    40% { transform: translateX(0); }
    60% { transform: translateX(0); }
    100% { transform: translateX(var(--marquee-end, -300px)); }
}

.radio-player-controls {
    display: flex;
    gap: 0.5rem;
}

.radio-player-btn {
    flex: 1;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    background: var(--radio-color);
    color: var(--radio-text-color);
    transition: background-color 0.15s ease;
}

.radio-player-btn:hover:not(:disabled) { background: var(--radio-color-accent); }
.radio-player-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.radio-player-btn.radio-flex-none { flex: 0 0 auto; }

.radio-player-error {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #f8d7da;
    background: #842029;
    border-radius: 0.4rem;
    padding: 0.5rem 0.75rem;
}

.radio-player-standalone {
    position: static;
    display: block;
    width: 100%;
    max-width: 22rem;
    background: #1f2430;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.25);
}
