/* Globale Basis */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    margin: 0; 
    padding: 0; 
    background-color: #fff; 
    color: #000;
    -webkit-font-smoothing: antialiased;
}

/* Header-Anpassung - Kompakter für Mobile */
.main-header { 
    background: #eb0000; 
    color: white; 
    padding: 8px 10px; 
    position: sticky; 
    top: 0; 
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title { 
    font-weight: bold; 
    font-size: 15px; 
}

.home-btn {
    color: white; 
    text-decoration: none; 
    font-weight: bold;
    background: rgba(0,0,0,0.2); 
    padding: 4px 10px; 
    border-radius: 3px;
    font-size: 15px; 
}

/* Favoriten im Header */
.favorites-header {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.favorites-header::-webkit-scrollbar { display: none; }

.fav-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.fav-btn:active { background: white; color: #eb0000; }

/* Suche */
.search-bar { background-color: #d7d7d7; padding: 8px 10px; border-bottom: 1px solid #999; }
#stationInput { width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #888; font-size: 16px; border-radius: 4px; }

.suggestions-container {
    background: white; 
    position: absolute; 
    width: calc(100% - 20px);
    z-index: 101; 
    border: 1px solid #999; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.suggestion-item { padding: 15px 10px; border-bottom: 1px solid #ccc; cursor: pointer; }

/* Zeit-Navigation */
.time-nav { display: flex; justify-content: center; background: #eee; border-bottom: 1px solid #ccc; }
.time-nav button { width: 100%; padding: 10px; border: none; background: transparent; font-size: 14px; font-weight: bold; color: #003399; cursor: pointer; }

/* Abfahrtstabelle */
.hafas-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hafas-table thead { background-color: #666; color: #fff; font-size: 11px; }
.departure-row { border-bottom: 1px solid #ccc; }
.departure-row td { padding: 10px 4px; vertical-align: middle; }

/* Spaltenbreiten */
.col-time { width: 52px; font-weight: bold; font-size: 18px; text-align: left; padding-left: 8px !important; }
.col-type { width: 55px; text-align: center; font-size: 15px }
.col-dest { width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 5px !important; }
.col-plat { width: 50px; text-align: right; padding-right: 10px !important; }

.delay { color: #d00; font-size: 11px; display: block; }

/* Zuggattungen Boxen */
.type-container { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.type-box { padding: 1px 4px; font-size: 11px; font-weight: bold; color: white; background-color: #333; border-radius: 2px; display: inline-block; min-width: 32px; }
.type-ic, .type-ec, .type-tgv, .type-rj, .type-ir { background-color: #eb0000; }
.type-ice, .type-pe { background-color: #eb0000; font-style: italic }
.type-re { border: 1px solid #eb0000; color: #eb0000; background-color: transparent; }
.type-s, .type-r, .type-ter { border: 1px solid #000; background-color: transparent; color: #000; }
.type-sn { border: 1px solid #000; background-color: #000; color: #fcbb00; }
.type-bus, .type-b, .type-t, .type-ruf, .type-rub, .type-fun, .type-asc, .type-fae, .type-bat { background-color: #2d327d; color: #fff; }
.type-nj, .type-en { background-color: #143A85; color: #fff }
.type-pag { background-color: #ffcc00 !important; color: #fff !important; border: 1px solid #000 }

.train-number { font-size: 10px; color: #666; margin-top: 2px; }
.plat-change { background-color: #fcbb00 !important; color: #000 !important; font-weight: bold; }

/* Detail-Ansicht (SBB Mast-Design) */
.detail-row { background-color: #e9eef3 !important; }
.detail-container { padding: 15px 10px 15px 20px; position: relative; }

.stop-item { display: flex; align-items: flex-start; margin-bottom: 0px; position: relative; min-height: 50px; }

/* Der vertikale Mast */
.stop-line-container {
    width: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    position: relative;
    flex-shrink: 0;
}

.line-bar { width: 2px; background: #999; flex-grow: 1; }
.line-bar.first { margin-top: 10px; }
.line-bar.last { flex-grow: 0; height: 10px; }

.line-dot {
    width: 10px;
    height: 10px;
    background: #003399;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    z-index: 2;
}

.stop-time-container {
    min-width: 90px;
    flex-shrink: 0;
    margin-left: 5px;
}

.time-row { white-space: nowrap; font-size: 13px; line-height: 1.5; }
.time-row b { color: #777; font-size: 10px; width: 20px; display: inline-block; }

.no-prognosis { font-style: italic; color: #666; }
.delay-tag { color: #eb0000; font-size: 13px; margin-left: 4px; font-style: normal; }

.stop-info { margin-left: 10px; padding-top: 5px; }
.stop-name { color: #003399; text-decoration: underline; font-weight: bold; font-size: 15px; cursor: pointer; display: block; }
.stop-link { color: inherit; text-decoration: inherit; }
.stop-plat { font-size: 11px; color: #444; display: block; margin-top: 2px; }

#dateInput, #timeInput { padding: 10px; border: 1px solid #888; font-size: 16px; border-radius: 4px; background: white; }