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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(54deg, #2b2c7c, #6a6bff);
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px 15px;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

#designSwitch {
    position: fixed; top: 10px; left: 10px; z-index: 2000;
    color: #f0f0f0; padding: 5px 12px; border-radius: 20px;
    font-size: 10px; cursor: pointer; text-transform: uppercase;
    letter-spacing: 1px; transition: all 0.5s ease;
}

.logo-container {
    margin-top: 35px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
.logo-container a { display: inline-block; transition: transform 0.2s ease; }
.logo-container a:active { transform: scale(0.95); }
.logo-container img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
    cursor: pointer;
}

.widget-box {
    border-radius: 15px;
    padding: 25px;
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.5s ease;
}

.controls { 
    margin-bottom: 15px; 
    width: 100%; 
    display: flex;
    justify-content: center;
    gap: 8px; 
}
.controls select {
    background-color: #2b2c7c;
    color: #f0f0f0;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 8px;
    outline: none;
    width: 240px;
    text-align: center;
    border: 2px solid #4a4aff;
    transition: all 0.5s ease;
}

#gpsButton {
    background-color: #2b2c7c;
    color: #f0f0f0;
    border: 2px solid #4a4aff;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    padding: 0 15px;
    transition: all 0.3s ease;
}
#gpsButton:hover { background-color: #4a4aff; }
body.theme-classic #gpsButton { background-color: #333; border: 2px solid #555; }
body.theme-classic #gpsButton:hover { border-color: #ff9f00; }

.station-header {
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.main-content {
    display: flex;
    flex-direction: row;
    gap: 25px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.text-display { display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.row-container { display: flex; flex-direction: column; gap: 4px; width: 100%; }

.row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.5s ease;
}

.sub-line {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    opacity: 0.6;
    letter-spacing: 1px;
    white-space: nowrap;
}

.gleis-box { margin-right: 15px; text-align: center; min-width: 45px; }
.gleis-text { font-size: 10px; display: block; text-transform: uppercase;}
.gleis-num { font-size: 34px; font-weight: bold; line-height: 1; }

.line { font-weight: bold; width: 35px; font-size: 20px; }
.target { flex-grow: 1; text-transform: uppercase; font-family: 'Consolas', monospace; font-size: 19px; font-weight: bold; overflow: hidden; white-space: nowrap; }
.countdown { width: 70px; text-align: right; font-family: 'Consolas', monospace; font-size: 23px; font-weight: bold; }

.incident-box {
    width: 100%;
    height: 35px;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.5s ease;
}

.ticker-text {
    white-space: nowrap;
    padding-left: 100%;
    display: inline-block;
    font-size: 15px;
    font-family: 'Consolas', monospace;
    animation: marquee 20s linear infinite;
}

.update-info { font-size: 11px; margin-top: 5px; font-weight: bold; transition: color 0.5s ease;}

@keyframes marquee { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }
@keyframes starMove { 0% { transform: translateX(-4px); opacity: 0.5; } 50% { transform: translateX(4px); opacity: 1; } 100% { transform: translateX(-4px); opacity: 0.5; } }
.anim-star { display: inline-block; animation: starMove 0.8s ease-in-out infinite; font-size: 1.2em; }

/* THEMEN */
body.theme-neon #designSwitch { background-color: #4a4aff; border: 1px solid #ffffff; }
body.theme-neon .widget-box { background-color: #2b2c7c; border: 5px solid #4a4aff; box-shadow: 4px 13px 30px rgba(43, 44, 124, 0.4); }
body.theme-neon .controls select { background-color: #2b2c7c; border: 2px solid #4a4aff; }
body.theme-neon .station-header { background-color: #4a4aff; }
body.theme-neon .row { background-color: rgba(0, 0, 0, 0.3); border-left: 5px solid #ffffff; } 
body.theme-neon .gleis-box { color: #ffffff; } 
body.theme-neon .target, body.theme-neon .countdown, body.theme-neon .anim-star { color: #ffffff; } 
body.theme-neon .line { color: #ffffff; } 
body.theme-neon .incident-box { background-color: rgba(0, 0, 0, 0.3); border: 2px solid #4a4aff; }
body.theme-neon .ticker-text { color: #ffffff; } 
body.theme-neon .update-info, body.theme-neon .sub-line { color: #ffffff; } 

body.theme-classic { background: #1a1a1a; }
body.theme-classic #designSwitch { background-color: #333; border: 1px solid #ff9f00; }
body.theme-classic .widget-box { background-color: #222; border: 5px solid #444; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
body.theme-classic .controls select { background-color: #333; border: 2px solid #555; }
body.theme-classic .station-header { background-color: #444; }
body.theme-classic .row { background-color: #111; border-left: 5px solid #ff9f00; }
body.theme-classic .gleis-box, body.theme-classic .target, body.theme-classic .countdown, body.theme-classic .line, body.theme-classic .ticker-text, body.theme-classic .anim-star, body.theme-classic .update-info, body.theme-classic .sub-line { color: #ff9f00; }
body.theme-classic .incident-box { background-color: #000; border: 2px solid #444; }

.progress-container { 
    width: 160px; 
    height: 3px; 
    background-color: rgba(255, 255, 255, 0.15); 
    border-radius: 2px; 
    margin: 10px auto 0px auto; 
    overflow: hidden; 
}
.progress-bar { 
    height: 100%; 
    width: 100%; 
    background-color: #ffffff; 
}
body.theme-classic .progress-bar { background-color: #ff9f00; }
body.theme-classic .progress-container { background-color: rgba(255, 159, 0, 0.2); }

@keyframes shrinkBar {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* --- NEU: DESIGN FÜR DAS GARANTIERTE POPUP (TOAST) --- */
.toast {
    position: fixed;
    top: -100px; /* Startet versteckt oben */
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff9f00; /* Auffälliges Orange */
    color: #000;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 9999;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    white-space: pre-line; /* Erlaubt Zeilenumbrüche */
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Cooler Bounce-Effekt */
    pointer-events: none;
}
.toast.show {
    top: 40px; /* Fährt in den Bildschirm */
    opacity: 1;
}

@media screen and (max-width: 600px) {
    body { padding: 10px 10px; justify-content: flex-start; }
    .logo-container { margin-top: 30px; margin-bottom: 12px; }
    .logo-container img { width: 75px; }
    .controls { margin-bottom: 10px; }
    .controls select { font-size: 15px; padding: 7px; width: 200px; }
    .widget-box { padding: 15px; gap: 10px; border-width: 4px; }
    .main-content { flex-direction: column; gap: 12px; }
    #analogClock { width: 120px !important; height: 120px !important; }
    .row { padding: 8px 12px; }
    .gleis-num { font-size: 28px; }
    .target { font-size: 17px; }
    .countdown { font-size: 20px; width: 65px; }
    .station-header { font-size: 0.9em; padding: 5px 12px; }
    .sub-line { text-align: center; font-size: 9px; }
    .toast { width: 90%; font-size: 14px; top: -150px;}
}