/* Public Domain - Radioplayer Stylesheet */

@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap; /* Verhindert, dass Text unsichtbar ist, während die Schrift lädt */
}
    
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Bold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
    
:root {
    /* Farben */
    --primary-color: #ff9999;
    --primary-color-hover: #ff7777;
    --success-text: #1a5c1a;
    --success-color: #d2f8d2;
    --success-color-hover: #b8e9b8;
    --background-color: #fafafa;
    --header-background: #FFFFE3;
    --header-color: #000;
    --modal-background: #fff;
    --modal-background-export: #f9f9f9;
    --item-background: #f1f1f1;
    --item-hover: #e6e6e6;
    --button-background: #f0f0f0;
    --button-hover: #e0e0e0;
    --button-color: #fff;
    --border-color: #ddd;
    --text-color: #333;
    --text-color-light: #666;
    --text-color-lighter: #ccc;
    --table-header-bg: #f8f8f8;
    --search-button-bg: #ffffff;
    --input-bg: #ffffff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --modal-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

    /* Layout Fix */
    --header-height: 80px;
    --padding-top: calc(var(--header-height) + 20px);
    --font-family: 'Inter Tight', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* --- DIESE BLEIBEN GLEICH --- */
        --header-background: #FFFFE3;  /* Helles Gelb */
        --primary-color: #ff9999;      /* Rot */
        --primary-color-hover: #ff7777;
        --success-color: #d2f8d2;      /* Grün */
        --success-color-hover: #b8e9b8;

        /* --- DER REST WIRD DUNKEL --- */
        --success-text: #000000;
        --background-color: #121212;   /* Tiefdunkler Hintergrund für die Seite */
        --header-color: #000;
        --modal-background: #1e1e1e;   /* Dunkle Modals */
        --modal-background-export: #252525;
        --item-background: #242424;    /* Dunkle Preset-Karten */
        --item-hover: #2c2c2c;
        
        --button-background: #333333;
        --button-hover: #444444;
        --button-color: #eeeeee;
        
        --text-color: #e0e0e0;         /* Heller Text auf dunklem Grund */
        --text-color-light: #aaaaaa;
        --text-color-lighter: #444444;
        --border-color: #333333;
        
        --table-header-bg: var(--item-background); 
        --search-button-bg: var(--modal-background);
        --input-bg: #2a2a2a;
        
        --shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        --modal-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    }


}

/* --- BASICS --- */
body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    text-align: center;
    margin: 0;
    padding: 20px;
    padding-top: var(--padding-top);
    background-color: var(--background-color);
    color: var(--text-color);
}

.hidden {
    display: none !important;
}

/* --- HEADER & NAVIGATION --- */
.header {
    background-color: var(--header-background);
    color: var(--header-color);
    height: auto; 
    padding: 10px 15px 10px 15px; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
    box-sizing: border-box; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; 
}

/* --- TITEL ZEILE --- */
.titel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0 !important; 
}

.titel h1 {
    margin: 0;
    padding: 0;
    line-height: 1.2; /* Sorgt dafür, dass die Schriftbox nicht unnötig hoch ist */
}

.titel img {
    height: 30px;
    width: auto;
}

.stop-button {
    background-color: var(--primary-color);
    color: var(--button-color);
    font-weight: bold;
    border: none;
    border-radius: 5px;
    height: 27px;      /* Deine gewünschte Höhe */
    min-width: 27px;   /* Macht ihn quadratisch, falls nur ein Icon drin ist */
    padding: 0 8px;    /* Etwas schmaler für Mobile */
    font-size: 16px;   /* Leicht reduziert für bessere Proportionen */
    margin-left: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* Sorgt für perfekte Zentrierung des Symbols im Button */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -3px;         /* -2px ist oft einen Tick zu viel bei 27px Höhe */
}

.stop-button:hover {
    background-color: var(--primary-color-hover);
}

#aktueller-sender {
    background-color: var(--success-color);
    border-radius: 5px;
    padding: 0 15px; /* Vertikales Padding auf 0, Höhe wird über min-height/line-height gesteuert */
    display: block; 
    width: 100%; 
    max-width: 600px; 
    margin: 0 auto 6px; 
    box-sizing: border-box; 
    white-space: nowrap;
    overflow: hidden; 
    font-weight: bold;
    font-size: 0.95em;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    /* ERZWINGT GLEICHE HÖHE: */
    height: 34px;        /* Feste Höhe statt min-height */
    line-height: 34px;   /* Zentriert den Text exakt vertikal */
}

#current-station-name {
    display: inline-block;
    vertical-align: middle;
}

.marquee-active {
    display: inline-block;
    padding-left: 0 !important;
    padding-right: 80px; /* Dieser Puffer ist wichtig, damit das Ende nicht am Anfang klebt */
    animation: marquee-pause 15s linear infinite;
}

@keyframes marquee-pause {
    /* 0% bis 25%: Text steht still (ca. 3-4 Sek. bei 15s Gesamtdauer) */
    0%, 25% { 
        transform: translateX(0); 
    }
    /* 100%: Text ist komplett nach links aus dem sichtbaren Bereich gewandert */
    100% { 
        transform: translateX(-100%); 
    }
}

#current-station-name i {
    color: var(--header-color); 
    margin-right: 3px;
    margin-left: 0px;
    font-size: 0.9em; 
    display: inline-block;
    line-height: 1; 
    vertical-align: middle; 
}

#current-station-name i:first-child {
    margin-left: 0;
}

/* --- PRESET GRID --- */
.preset-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 20px;
    margin: 30px auto;
    max-width: 1200px;
    padding: 0 10px;
}

.preset-item {
    background-color: var(--item-background);
    padding: 0 15px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.preset-item h3 {
    margin: 0;
    text-align: center;
    word-break: break-word;
    font-size: 1.1em;
    line-height: 1.2;
    font-weight: 600;
}

.preset-item:hover {
    background-color: var(--item-hover);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --- BUTTONS (Zusammengefasst) --- */
.button-container button, 
.btn, 
.custom-modal-buttons button,
.search-link {
    margin: 0px 3px 6px 0;
    padding: 10px 20px;
    min-width: 120px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--button-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 8px;
}

.search-link {
    background-color: var(--search-button-bg) !important; /* Nutzt jetzt die Variable */
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.button-container button:hover, 
.btn:hover, 
.custom-modal-buttons button:hover,
.search-link:hover {
    background-color: var(--button-hover) !important;
}

#sleep-timer-modal .button-container {
    margin-bottom: 15px; 
}

#sleep-timer-modal .button-container:last-of-type {
    margin-bottom: 0;
}

/* Spezial-Buttons */
.btn-ok {
    background-color: var(--success-color) !important;
    color: var(--success-text) !important;
    font-weight: bold !important;
}

.btn-ok.btn-ok:hover { 
    background-color: var(--success-color-hover) !important;
    color: var(--success-text) !important;
}

.delete-btn {
    background: transparent !important;
    border: none !important;
    min-width: auto !important;
    padding: 5px !important;
    color: var(--primary-color);
}

.delete-btn:hover {
    color: #ff4444 !important;
    background: transparent !important;
}

/* --- MODALS --- */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--modal-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--modal-shadow);
    z-index: 2000;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

#preset-table {
    width: 100%;           
    border-collapse: collapse;
    margin: 15px 0;
    table-layout: auto;    
}

#preset-table th:nth-child(2), 
#preset-table td:nth-child(2) {
    width: 40%;
}

#preset-table th:nth-child(3), 
#preset-table td:nth-child(3) {
    width: 50%;
}

#preset-table th, #preset-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
}

#preset-table input[type="text"] {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

#preset-table td {
    padding: 10px 5px;
}

#preset-table th {
    background-color: var(--table-header-bg);
    color: var(--text-color);
}

.drag-handle {
    cursor: grab;
    color: var(--text-color-lighter);
}

/* --- EXPORT / SHARE --- */
.export-import-container {
    margin: 20px 0;
    padding: 20px;
    background: var(--modal-background-export);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.share-row {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.share-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    background: #fff;
}

/* --- FOOTER & ALERTS --- */
.footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

#current-year {
    display: inline-block;
    margin: 0;
    padding: 0;
}

#server-name {
    display: inline-block;
    margin: 0;
    padding: 0;
}

footer a, 
footer a:visited, 
footer a:hover, 
footer a:active {
    color: var(--text-color-light); 
    text-decoration: none; 
}

footer a:hover {
    text-decoration: underline; 
}

.custom-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

.custom-modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    max-width: 400px;
    width: 85%;
    text-align: center;
}

/* --- MOBILE OPTIMIERUNG (Komplett bereinigt) --- */
@media (max-width: 600px) {
    #aktueller-sender {
        display: flex;
        align-items: center;
        justify-content: center; /* Standard: Zentriert */
    }

    /* Diese Klasse wird per JS hinzugefügt, wenn der Text zu lang ist */
    #aktueller-sender.has-marquee {
        justify-content: flex-start !important;
    }
    
    #current-station-name {
        transition: none !important; /* Erzwingt Ruhe beim Umschalten */
    }
}