/* ============================================
   BASIS-STYLES - gemeinsam für alle Stationen
   Themes überschreiben nur Farben/Akzente
   ============================================ */

/* ===== CSS Custom Properties ===== */
:root {
    --accent:         #6c5ce7;
    --accent-hover:   #5849d6;
    --accent-glow:    rgba(108, 92, 231, 0.4);
    --bg-gradient-1:  #1a1a2e;
    --bg-gradient-2:  #16213e;
    --card-bg:        rgba(255, 255, 255, 0.05);
    --card-border:    rgba(255, 255, 255, 0.1);
    --text-primary:   #ffffff;
    --text-secondary: #b0b0c0;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(
        135deg,
        var(--bg-gradient-1) 0%,
        var(--bg-gradient-2) 100%
    );
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}
/* ===== Container ===== */
.container,
.container-fluid {
    width: 100%;
    padding-left:  1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .container,
    .container-fluid {
        padding-left:  1.5rem;
        padding-right: 1.5rem;
    }
}


/* ============================================
   HEADER
   ============================================ */
.player-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;          /* flex-child darf schrumpfen */
}

.brand-short {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 0 20px var(--accent-glow);
}

.brand-name {
    font-size: clamp(0.9rem, 4vw, 1.25rem);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Sehr schmale Screens: nur Logo-Kürzel */
@media (max-width: 360px) {
    .brand-name {
        display: none;
    }
}


/* ============================================
   PLAYER CARD
   ============================================ */
.player-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .player-card {
        padding: 2rem;
    }
}

@media (min-width: 1025px) {
    .player-card {
        max-width: 560px;
        padding: 2rem 2.25rem;
    }
}

@media (min-width: 1400px) {
    .player-card {
        max-width: 600px;
    }
}

/* ============================================
   COVER
   ============================================ */
.cover-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 1.5rem;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 40px var(--accent-glow);
    transition: border-radius 0.8s ease;
}

.cover-wrapper.playing {
    border-radius: 50%;
}

.cover-wrapper.paused {
    border-radius: 16px;
}

@media (min-width: 1025px) {
    .cover-wrapper {
        max-width: 100%;
    }
}

/* ---- Cover Image ---- */
.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
    transition: border-radius 0.8s ease;
}

.cover-image.playing {
    border-radius: 50%;
    animation: vinyl-spin 4s linear infinite;
    animation-delay: 0.8s;
}

.cover-image.finishing {
    border-radius: 50%;
    animation: vinyl-spin 4s linear 1;
}

.cover-image.paused {
    border-radius: 16px;
    animation: none;
}

.cover-wrapper.finishing {
    border-radius: 50%;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}






/* Visualizer-Overlay */
.cover-overlay {
    position: absolute;
    inset: auto 0 0 0;
    height: 140px;
    pointer-events: none;
    overflow: hidden;
    mask-image: linear-gradient(to top, black 0%, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, black 50%, transparent 100%);
}

.cover-overlay canvas {
    width:   100% !important;
    height:  100% !important;
    display: block;
}

/* audioMotion baut eigenes Canvas → altes verstecken */
#visualizer {
    display: none;
}


/* ============================================
   TRACK INFO
   ============================================ */
.track-info {
    margin-bottom: 1.25rem;
    min-width: 0;            /* Ellipsis funktioniert nur mit begrenzter Breite */
}

.track-title-wrap {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    position: relative;
}

.track-title {
    font-size: clamp(1rem, 5vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    display: inline-block;
    white-space: nowrap;
    min-width: 100%;
    text-overflow: clip;
}

.track-artist {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    color: var(--text-secondary);
}

@media (min-width: 1025px) {
    .track-title  { font-size: 1.5rem; }
    .track-artist { font-size: 1.05rem; }
}


/* ============================================
   PLAYER CONTROLS
   ============================================ */
.player-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(0.6rem, 2.5vw, 1.5rem);
    margin-bottom: 1.25rem;
}

/* ── Play-Button ── */
.btn-play {
    flex-shrink: 0;
    width:  clamp(52px, 13vw, 70px);
    height: clamp(52px, 13vw, 70px);
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: clamp(1.3rem, 4.5vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-play:hover  { background: var(--accent-hover); transform: scale(1.05); }
.btn-play:active { transform: scale(0.95); }

@media (min-width: 1025px) {
    .btn-play {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
}

/* ── Volume ── */
.volume-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-wrapper i {
    flex-shrink: 0;
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    color: var(--text-secondary);
}

#volumeSlider {
    flex: 1;
    min-width: 60px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

#volumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Touch-Geräte: größere Trefferflächen */
@media (pointer: coarse) {
    #volumeSlider {
        height: 10px;
    }

    #volumeSlider::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    #volumeSlider::-moz-range-thumb {
        width: 26px;
        height: 26px;
    }
}


/* ============================================
   STATUS ROW
   ============================================ */
.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Basis-Status-Dot */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    background: #6c757d;
}

.status-dot.live {
    background: #28a745;
    box-shadow: 0 0 8px #28a745;
}

.status-dot.onair {
    background: #dc3545;
    box-shadow: 0 0 8px #dc3545;
    animation: blink-red 1s infinite;
}

@keyframes blink-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-dot.error {
    background: #fd7e14;
}

.status-dot.loading {
    background: #0dcaf0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}



/* ============================================
   STATION SWITCHER
   ============================================ */
.station-switcher {
    padding: 0 0.25rem;
}

.station-switcher h5 {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons immer zentriert fließend */
.station-switcher .d-flex,
.station-switcher .flex-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.4rem !important;
}

.station-btn {
    font-size: clamp(0.7rem, 2.2vw, 0.875rem);
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border-color: var(--card-border) !important;
    color: var(--text-secondary) !important;
    transition: all 0.2s ease;
    background: transparent;
}

.station-btn:hover {
    border-color: var(--accent) !important;
    color: #fff !important;
    background: var(--accent) !important;
}

.station-btn.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Touch: mind. 44×44 px Trefferfläche */
@media (pointer: coarse) {
    .station-btn {
        min-height: 44px;
        min-width:  44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.45rem 0.9rem;
    }
}


/* ============================================
   FOOTER
   ============================================ */
.player-footer {
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--card-border);
    margin-top: 3rem;
    padding-left:  1rem;
    padding-right: 1rem;
}

.player-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.player-footer a:hover {
    color: var(--accent);
}


/* ============================================
   CONSENT MODAL
   ============================================ */
.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.consent-modal[hidden] {
    display: none;
}

.consent-box {
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    background: var(--bg-gradient-2);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.consent-box h2 {
    color: var(--accent);
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    margin-bottom: 1rem;
}

.consent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.consent-actions .btn {
    flex: 1;
}

@media (min-width: 400px) {
    .consent-actions {
        flex-direction: row;
    }
}


/* ============================================
   BOOTSTRAP OVERRIDES
   ============================================ */

/* Primär-Button */
.btn-primary {
    background:   var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background:   var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Modal */
.modal-dialog {
    margin: 0.5rem;
}

.modal-content {
    border-radius: 16px;
    background: var(--bg-gradient-2);
    border-color: var(--card-border);
}

@media (min-width: 576px) {
    .modal-dialog {
        margin: 1.75rem auto;
        max-width: 520px;
    }
}

/* Tabs */
.nav-tabs .nav-link {
    font-size: clamp(0.72rem, 3vw, 0.875rem);
    padding: 0.4rem clamp(0.4rem, 2vw, 0.75rem);
    white-space: nowrap;
}

/* List-Group im Info-Tab */
.list-group-item {
    background: transparent;
    border-color: var(--card-border);
    color: var(--text-primary);
}

/* ===== Marquee-Animation für lange Songtitel ===== */
.track-title.is-marquee {
    padding-left: 100%;                     /* Start: rechts außen */
    animation-name: marquee-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); } /* Wandert um eigene Breite nach links */
}

/* ============================================
   LIGHT MODE
   ============================================ */
[data-bs-theme="light"] {
    --bg-gradient-1:  #f0f2f5;
    --bg-gradient-2:  #ffffff;
    --card-bg:        rgba(0, 0, 0, 0.03);
    --card-border:    rgba(0, 0, 0, 0.1);
    --text-primary:   #1a1a2e;
    --text-secondary: #6c757d;
}


/* ============================================
   LANDSCAPE MOBILE  (Höhe ≤ 500 px)
   Cover links | Track-Info + Controls rechts
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {

    .player-card {
        max-width: 96vw;
        display: grid;
        grid-template-columns: 150px 1fr;
        grid-template-areas:
            "cover  info"
            "cover  controls"
            "cover  status";
        column-gap: 1.25rem;
        align-items: start;
        padding: 0.75rem 1rem;
    }

    .cover-wrapper {
        grid-area: cover;
        max-width: none;
        width: 100%;
        margin: 0;
    }

    .track-info {
        grid-area: info;
        margin-bottom: 0.5rem;
        text-align: left;
    }

    .track-title {
        font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    }

    .player-controls {
        grid-area: controls;
        margin-bottom: 0.5rem;
    }

    .status-row {
        grid-area: status;
        justify-content: flex-start;
    }
}


/* ============================================
   PORTRAIT – sehr kleine Screens (≤ 390 px)
   ============================================ */
@media (max-width: 390px) {
    .player-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .cover-wrapper {
        max-width: 260px;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .track-info      { margin-bottom: 0.75rem; }
    .player-controls { margin-bottom: 0.75rem; }
}


/* ============================================
   PORTRAIT – geringe Höhe (z. B. Falt-Phone)
   ============================================ */
@media (max-height: 650px) and (orientation: portrait) {
    .cover-wrapper {
        max-width: 220px;
        margin-bottom: 1rem;
    }

    .player-card {
        padding: 1rem;
    }

    .track-info      { margin-bottom: 0.75rem; }
    .player-controls { margin-bottom: 0.75rem; }
}
