/* =========================================
   FONT
========================================= */

/* Inter - Light (300) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/assets/fonts/inter-v13-latin-300.woff2') format('woff2');
}

/* Inter - Regular (400) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/inter-v13-latin-400.woff2') format('woff2');
}

/* Inter - Medium (500) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/inter-v13-latin-500.woff2') format('woff2');
}

/* Inter - SemiBold (600) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/inter-v13-latin-600.woff2') format('woff2');
}

/* Montserrat - SemiBold (600) */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/montserrat-v26-latin-600.woff2') format('woff2');
}

/* Montserrat - Bold (700) */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/montserrat-v26-latin-700.woff2') format('woff2');
}


/* =========================================
   ROOT (gemeinsames Basis-System, auch für andere Seiten)
========================================= */

:root {

    --primary-900: #2d9846;
    --primary-800: #2d9846;
    --primary-700: #36d25b;
    --primary-600: #36d25b;

    /* Hellblau */
    --blue-300: #8ab5e3;
    --blue-200: #95bae5;
    --blue-100: #a0c0e7;
    --blue-50: #b7cde6;

    /* Grautöne */
    --white: #ffffff;
    --bg: #f5f5f7;
    --surface: #ffffff;
    --border: #d3d7e0;
    --text: #1d2939;
    --text-secondary: #667085;
    --text-light: #667085;
    --soft-surface: #f0f1f5;
    --soft-surface-hover: #e8eaef;
    --brand-bg: rgba(255, 255, 255, .88);
    --app-bg-start: rgba(244, 244, 247, .96);
    --app-bg-end: rgba(234, 234, 240, .94);
    --overlay-start: rgba(244, 244, 247, 0);
    --overlay-end: rgba(244, 244, 247, 0);
    --card-border: rgba(207, 211, 222, .95);
    --progress-track: #dfe1e8;

    /* Radius */
    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius-md: 7px;
    --radius-lg: 10px;

    /* Schatten */
    --shadow-sm:
        0 2px 6px rgba(36, 64, 120, .08);

    --shadow-md:
        0 10px 30px rgba(36, 64, 120, .12);

    --shadow-lg:
        0 20px 50px rgba(36, 64, 120, .15);

    --shadow:
        0 10px 30px rgba(36, 64, 120, .12);

    /* Übergänge */
    --transition: .3s ease;
}

[data-theme="dark"] {
    --bg: #161616;
    --surface: #1e1e1e09;
    --text: #f0f0f0;
    --text-secondary: #b8bcc6;
    --text-light: #b8bcc6;
    --border: #3a3a3a;
    --soft-surface: #3a2a45;
    --soft-surface-hover: rgba(50, 50, 50, .5);
    --brand-bg: rgba(22, 22, 22, .90);
    --app-bg-start: rgba(20, 20, 20, .97);
    --app-bg-end: rgba(12, 12, 12, .96);
    --overlay-start: rgba(20, 20, 20, 0.0);
    --overlay-end: rgba(20, 20, 20, 0.0);
    --card-border: rgba(58, 58, 58, .95);
    --progress-track: #333333;
    --shadow-sm:
        0 2px 8px rgba(0, 0, 0, .28);
    --shadow-md:
        0 15px 40px rgba(0, 0, 0, .4);
    --shadow-lg:
        0 24px 60px rgba(0, 0, 0, .45);
    --shadow:
        0 15px 40px rgba(0, 0, 0, .4);
    color-scheme: dark;
}


/* =========================================
   HINTERGRUND: NEUTRAL GRAU (statt blaustichig)
   Akzentfarben (primary/blue) bleiben unverändert blau.
   Kombinierbar mit [data-theme="light"|"dark"] -> 4 Kombinationen
========================================= */

[data-bg="gray"] {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --border: #d3d7e0;
    --text: #1d2939;
    --text-secondary: #667085;
    --text-light: #667085;
    --soft-surface: #f0f1f5;
    --soft-surface-hover: #e8eaef;
    --brand-bg: rgba(255, 255, 255, .88);
    --app-bg-start: rgba(244, 244, 247, .96);
    --app-bg-end: rgba(234, 234, 240, .94);
    --overlay-start: rgba(244, 244, 247, 0);
    --overlay-end: rgba(244, 244, 247, 0);
    --card-border: rgba(207, 211, 222, .95);
    --progress-track: #dfe1e8;
}

[data-bg="gray"][data-theme="dark"] {
    --bg: #161616;
    --surface: #1e1e1e00;
    --text: #f0f0f0;
    --text-secondary: #b8bcc6;
    --text-light: #b8bcc6;
    --border: #3a3a3a;
    --soft-surface: #2a2a2a;
    --soft-surface-hover: rgba(50, 50, 50, .5);
    --brand-bg: rgba(22, 22, 22, .90);
    --app-bg-start: rgba(20, 20, 20, .97);
    --app-bg-end: rgba(12, 12, 12, .96);
    --overlay-start: rgba(20, 20, 20, 0.0);
    --overlay-end: rgba(20, 20, 20, 0.0);
    --card-border: rgba(58, 58, 58, .95);
    --progress-track: #333333;
    --shadow-sm:
        0 2px 8px rgba(0, 0, 0, .30);
    --shadow-md:
        0 15px 40px rgba(0, 0, 0, .45);
    --shadow-lg:
        0 24px 60px rgba(0, 0, 0, .50);
    --shadow:
        0 15px 40px rgba(0, 0, 0, .45);
}

/* Grau-Hell: h3/h4 in dunklem Grau statt Dunkelblau, h1/h2 bleiben Standard-Blau */
[data-bg="gray"]:not([data-theme="dark"]) h3,
[data-bg="gray"]:not([data-theme="dark"]) h4 {
    color: #3a3a3a;
}


/* =========================================
   RESET
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}


/* =========================================
   TYPOGRAFIE
========================================= */

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-900);
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-900);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-800);
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-700);
}

h5 {
    font-size: 1.1rem;
    font-weight: 500;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    color: var(--text-secondary);
}

small {
    font-size: .875rem;
}

/* =========================================
   LINKS
========================================= */

a {
    color: var(--primary-700);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-900);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text);
}

[data-theme="dark"] a,
[data-theme="dark"] a:hover {
    color: var(--blue-50);
}



button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 13px 24px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =========================================
   INPUTS
========================================= */

input,
textarea,
select {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: .3s;
    color: var(--text);
    background: var(--surface);
}

input:focus,
textarea:focus {
    border-color: var(--blue-300);

    box-shadow:
        0 0 0 4px rgba(138, 181, 227, .25);
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    color: var(--text-light);
    font-size: .9rem;
    font-weight: 600;
}


/* =========================================
   APP SHELL (Hintergrund, Brand-Header)
========================================= */

html,
body {
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background:
        linear-gradient(180deg, var(--app-bg-start), var(--app-bg-end)),
        var(--bg);
    /* Sanftes Einblenden der ganzen Seite beim Laden */
    opacity: 0;
    animation: page-fade-in .6s ease forwards;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body {
        opacity: 1;
        animation: none;
    }
}

/* Wird aktuell nicht mehr für den Fade-In benötigt (Fade läuft jetzt auf body),
   bleibt aber als Hook für zukünftige Overlay-Effekte erhalten. */
.page-fade {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
}

.video-container {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}


/* =========================================
   DESKTOP FIXATION (verhindert Scrollen auf großen Screens)
========================================= */

@media(min-width: 901px) {

    html,
    body {
        overflow: hidden;
        height: 100%;
    }
}


/* =========================================
   MAIN CARD (server.html)
========================================= */



.footer-links {
    text-align: center;
    color: var(--text-light);
    font-size: .9rem;
}



/* ══════════════════════════════════════
           SETTINGS OVERLAY
        ══════════════════════════════════════ */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.settings-overlay.open {
    display: block;
    opacity: 1;
}

/* ══════════════════════════════════════
           SETTINGS PANEL
        ══════════════════════════════════════ */
.settings-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    z-index: 1000;
    background: var(--brand-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border);
    transition: right 0.28s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.settings-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    box-shadow: none;
    min-height: unset;
}

.settings-close:hover {
    background: var(--soft-surface-hover);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.settings-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.settings-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-secondary);
    padding: 14px 4px 6px;
}

.settings-section-label:first-child {
    padding-top: 4px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--soft-surface);
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition), box-shadow var(--transition), transform 0.13s ease;
    box-shadow: none;
    min-height: unset;
}

.settings-row:hover {
    background: var(--soft-surface-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    color: var(--text);
}

.settings-row:active {
    transform: translateY(0);
}

.settings-row-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.settings-row-text {
    flex: 1;
    font-weight: 500;
    text-align: left;
}

.settings-row-badge {
    font-size: 0.74rem;
    color: var(--text-secondary);
    background: var(--soft-surface-hover);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.settings-row-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
}



.settings-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.settings-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Wave canvas background */
.background-wave {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: none;
}

/* =========================================
   RESPONSIVE
========================================= */

@media(max-width:768px) {

    h1 {
        font-size: 2.2rem;
    }


}

/* =========================================
   RADIO UI (Settings Panel)
========================================= */

.radio-ui {
    background: var(--soft-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-station-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.radio-station-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s;
}

.radio-status-dot.live {
    background: #22c55e;
    animation: radio-pulse 1.6s infinite;
}

.radio-status-dot.connecting {
    background: #f59e0b;
    animation: radio-pulse 0.8s infinite;
}

@keyframes radio-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.radio-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radio-btn {
    width: 40px;
    height: 40px;
    min-height: unset;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s;
}

.radio-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.radio-btn:active {
    transform: scale(0.95);
}

.radio-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--progress-track);
    outline: none;
    cursor: pointer;
    border: none;
    min-height: unset;
    padding: 0;
    box-shadow: none;
}

.radio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-800);
    cursor: pointer;
    transition: transform 0.15s;
}

.radio-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.radio-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-800);
    border: none;
    cursor: pointer;
}

.radio-volume-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 34px;
    text-align: right;
    font-family: 'Inter', sans-serif;
}

.radio-station-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.radio-station-btn {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    box-shadow: none;
    min-height: unset;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-station-btn:hover {
    background: var(--soft-surface-hover);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.radio-station-btn.active {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    color: #fff;
    border-color: transparent;
}

.radio-eq-row {
    display: flex;
    gap: 8px;
}

.radio-eq-toggle {
    flex: 1;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--soft-surface);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: none;
    min-height: unset;
    line-height: 1;
}

.radio-eq-toggle:hover {
    background: var(--soft-surface-hover);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.radio-eq-toggle.active {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    color: #fff;
    border-color: transparent;
}

.radio-eq-canvas {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    background: #0a0a0a;
    display: block;
}

.radio-status-msg {
    font-size: 0.78rem;
    color: #ef4444;
    min-height: 16px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* =========================================
   RADIO OVERLAY CARD (Taste 'r')
========================================= */

.radio-overlay-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 18000;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .radio-overlay-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

.radio-overlay-card {
    background: var(--surface, #fff);
    border: 1px solid var(--card-border, #d3d7e0);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 24px 24px 18px 24px;
    min-width: 320px;
    max-width: 420px;
    width: 90vw;
    position: relative;
}

.radio-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.radio-overlay-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
}

.radio-overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    min-height: unset;
    box-shadow: none;
}

.radio-overlay-close:hover {
    background: var(--soft-surface-hover);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.radio-overlay-logo {
    display: flex;
    justify-content: center;
    margin: -4px 0 16px;
}

.radio-overlay-logo img {
    max-width: 70%;
    height: auto;
    display: block;
}