
/* CVAG_Client.css */

/* --- VARIABLEN FÜR THEMEN (Standard = Hell) --- */
:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --accent-color: #2575fc;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* --- DUNKELMODE VARIABLEN (wird per Klasse .dark-mode aktiviert) --- */
body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --accent-color: #4d8aff; /* Etwas helleres Blau für dunklen Hintergrund */
    --shadow-color: rgba(255, 255, 255, 0.05);
}

/* --- BASIS STYLES (Nutzen der Variablen) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* --- HEADER STYLES --- */
header#mainHeader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 1000;
    
    display: flex;
    flex-direction: column;
    padding: 10px 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
}

#currentStationLabel {
    font-size: 1.7rem;
    color: var(--text-color); /* Nutzt Variable */
    font-weight:bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    flex-grow: 1;
    transition: color 0.3s ease;
    text-align:center;
}

#currentClock {
    font-size: 1.0rem;
    color: var(--text-color); /* Nutzt Variable */
    white-space: nowrap;
    margin-left: 10px;
}

/* --- SUCHBEREICH & TOGGLE LOGIK --- */
.search-container-expanded {
    width: 100%;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.search-container-expanded.search-hidden {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    margin-bottom: 0;
    border: none;
}

.search-section-mobile-friendly {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color); /* Nutzt Variable */
    background-color: var(--bg-color); /* Optional: Input-Hintergrund anpassen */
    color: var(--text-color); /* Textfarbe im Input */
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

/* Dark Mode Input Anpassung falls nötig, hier standardmäßig hell halten für Lesbarkeit oder anpassen */
body.dark-mode #searchInput {
    background-color: #2d2d2d; 
    color: #fff;
    border-color: #444;
}

#searchInput:focus {
    border-color: var(--accent-color);
}

#searchBtn {
    padding: 0.8rem 1.5rem;
    background: var(--accent-color); /* Nutzt Variable */
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
}

#searchBtn:hover {
    opacity: 0.9;
}

/* Quick Links Styles */
.quick-links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 5px;
}

.quick-links-container span {
    cursor: pointer;
    color: var(--accent-color); /* Nutzt Variable */
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

.quick-links-container span:hover {
    text-decoration: underline;
}


/* --- ERGEBNISSE & DETAILS --- */
.results-container {
    margin-top: 1.5rem;
    width: 100%;
}

.station-item {
    background-color: var(--card-bg); /* Nutzt Variable */
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color); /* Nutzt Variable */
    cursor: pointer;
}

.station-item h3 { color: var(--accent-color); }
.station-item p { color: #666; font-size: 0.9rem; }
body.dark-mode .station-item p { color: #aaa; }

.station-details {
    background-color: var(--card-bg); /* Nutzt Variable */
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color); /* Nutzt Variable */
}

.station-details h2 {
    color: var(--text-color); /* Nutzt Variable */
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
body.dark-mode .station-details h2 { border-bottom-color: #333; }

.departure-item {
    background-color: var(--bg-color); /* Nutzt Variable */
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color); /* Nutzt Variable */
}

.departure-line { font-weight: bold; color: #6a11cb; }
body.dark-mode .departure-line { color: #9d8aff; }

.hidden { display: none !important; }


.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: white;
    bottom: 2px;
    content: "";
    height: 20px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 20px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider-icon {
    margin-left: 8px;
    font-size: 0.9rem;
    color: #555;
    user-select: none;
}
body.dark-mode .slider-icon { color: #aaa; }

/* --- NEU: Konfigurations Modal Styles --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Halbtransparenter Hintergrund */
    z-index: 2001; /* Muss höher sein als der Button (2000) */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-bg); /* Nutzt die aktuelle Theme-Variable */
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: left;
    transition: background-color 0.3s ease;
}

/* Close Button (X) oben rechts im Modal */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    line-height: 1;
}

.close-modal:hover {
    color: var(--accent-color);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 10px;
    background-color: var(--bg-color); /* Kontrast für den Setting-Container */
    border-radius: 8px;
}

.setting-row label {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0;
}


/* Dark Mode Anpassung für Modal Hintergrund */
body.dark-mode .modal-content {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

/* Minimaler Status-Balken (unten links) */
#statusBar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-color); /* Nutzt aktuelles Theme */
    color: var(--text-color);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    
    /* Standard: Unsichtbar */
    opacity: 0; 
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    
    z-index: 2005;
}

/* Wenn aktiv (Klasse .active wird per JS gesetzt) */
#statusBar.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Klickbar */
    transform: translateY(0);
}

/* Hover-Effekt nur wenn sichtbar */
#statusBar:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* Trennlinie für "Letzte Update" */
.status-sep { margin: 0 4px; opacity: 0.5; }



/* --- MEDIA QUERIES & MOBILE OPTIMIERUNG --- */
@media (max-width: 768px) {
    .header-top {
        flex-direction: row;
    }
    
    #currentStationLabel {
        font-size: 1rem;
        max-width: 200px;
    }

    body {
        padding-top: 90px; /* Mehr Platz für Header + Suche */
    }

    .search-section-mobile-friendly {
        flex-direction: column;
    }

    #searchBtn {
        width: 100%;
    }

    .quick-links-container {
        justify-content: flex-start;
        font-size: 0.85rem;
    }
    
    #searchInput {
        width: 100%;
    }
}

@media (min-width: 769px) {
    body {
        padding-top: 80px;
    }
    .quick-links-container {
        justify-content: center;
    }
}


