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

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: #2C2E3B;
    color: #FFFFFF;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styling */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
}

/* Route Planner */
.route-planner {
    background: #3A3D4E;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.route-planner h2 {
    text-align: center;
    color: #FFFFFF;
    margin: 0 0 30px 0;
    font-size: 1.8em;
}

.route-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    color: #FFFFFF;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: #2C2E3B;
    color: #FFFFFF;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #60A5FA;
}

.input-group input::placeholder {
    color: #9CA3AF;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2C2E3B;
    border: 2px solid #60A5FA;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #FFFFFF;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item:hover {
    background: #3f4252;
}

.autocomplete-item .line-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: #FFFFFF;
    flex-shrink: 0;
}

.route-button {
    padding: 12px 40px;
    background: #60A5FA;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.route-button:hover {
    background: #3B82F6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(96, 165, 250, 0.4);
}

.route-button:active {
    transform: translateY(0);
}

h1 {
    font-size: 3.5em;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    color: #FFFFFF;
}

.line-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.line-card {
    background: #3A3D4E;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.line-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.line-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.line-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4em;
    color: #FFFFFF;
    flex-shrink: 0;
}

.line-info h2 {
    font-size: 1.3em;
    font-weight: 500;
    margin-bottom: 4px;
}

.line-info p {
    font-size: 0.9em;
    opacity: 0.8;
}

.stations {
    padding: 0 20px 20px 20px;
}

.station {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    background: #2C2E3B;
    border-radius: 4px;
    transition: background 0.2s;
}

.station:hover {
    background: #3f4252;
}

.station {
    cursor: pointer;
}

.station.selected {
    background: #4a5568;
    box-shadow: 0 0 0 2px #60A5FA;
}

.station-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    font-weight: bold;
    color: #FFFFFF;
}

.station-name {
    flex: 1;
    color: #FFFFFF;
    font-size: 0.95em;
}

.travel-time {
    color: #9CA3AF;
    font-size: 0.85em;
    margin-right: 12px;
    min-width: 45px;
    text-align: right;
}

.transfer {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.transfer-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    color: #FFFFFF;
}

/* Linienfarben */
.u1 {
    background: #59C134;
}

.u2 {
    background: #DA421E;
}

.u3 {
    background: #16683D;
}

.u4 {
    background: #F0D722;
    color: #2C2E3B !important;
}

.u5 {
    background: #7E5330;
}

.u6 {
    background: #8C6DAB;
}

.u7 {
    background: #528DBA;
}

.u8 {
    background: #224F86;
}

.u9 {
    background: #F3791D;
}

/* S-Bahn Line Colors */
.s1 {
    background: #DD4D9A;
}

.s2 {
    background: #0F6E3C;
}

.s25 {
    background: #0F6E3C;
}

.s3 {
    background: #0071BC;
}

.s5 {
    background: #F39200;
}

.s7 {
    background: #6F4E99;
}

.s8 {
    background: #55A932;
}

.s9 {
    background: #8B1C40;
}

.s41 {
    background: #A3662C;
}

.s42 {
    background: #C47825;
}

.network-map {
    width: 100%;
    background: #3A3D4E;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.network-map svg,
.network-map img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    filter: brightness(0.85) contrast(1.1) saturate(1.2);
    background: #2C2E3B;
}

/* Footer Styling */
.page-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-footer p {
    color: #9CA3AF;
    font-size: 0.95em;
    margin: 0 0 20px 0;
    font-weight: 300;
}

.page-footer p:hover {
    color: #FFFFFF;
    transition: color 0.3s ease;
}

.info-button {
    background: #3A3D4E;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.info-button:hover {
    background: #4A4D5E;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1F2937;
    color: #FFFFFF;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 1em;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: #059669;
    border-left: 4px solid #10B981;
}

.toast-warning {
    background: #D97706;
    border-left: 4px solid #F59E0B;
}

.toast-info {
    background: #1F2937;
    border-left: 4px solid #60A5FA;
}

/* Info Dialog */
.info-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

.info-dialog.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-dialog-content {
    background: #3A3D4E;
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.info-dialog-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.info-dialog-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.info-dialog h2 {
    color: #FFFFFF;
    font-size: 2em;
    margin: 0 0 30px 0;
}

.info-dialog h3 {
    color: #60A5FA;
    font-size: 1.4em;
    margin: 0 0 15px 0;
}

.info-section {
    margin-bottom: 30px;
}

.info-section p {
    color: #D1D5DB;
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-section ul,
.info-section ol {
    color: #D1D5DB;
    line-height: 1.8;
    margin: 15px 0;
    padding-left: 25px;
}

.info-section li {
    margin-bottom: 10px;
}

.info-section li strong {
    color: #FFFFFF;
}

.example-box {
    background: #2C2E3B;
    border-left: 4px solid #60A5FA;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    color: #D1D5DB;
    line-height: 1.8;
}

.info-section pre {
    background: #1F2937;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 15px 0;
}

.info-section code {
    color: #10B981;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .line-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }

    h1 {
        font-size: 2.2em;
    }

    .route-inputs {
        grid-template-columns: 1fr;
    }

    .route-button {
        width: 100%;
    }

    .toast {
        padding: 12px 20px;
        font-size: 0.85em;
        max-width: 95%;
    }

    .info-dialog-content {
        padding: 30px 20px;
        max-height: 95vh;
    }

    .info-dialog h2 {
        font-size: 1.5em;
        margin-right: 40px;
    }

    .info-dialog h3 {
        font-size: 1.2em;
    }

    .info-section pre {
        padding: 15px;
    }

    .info-section code {
        font-size: 0.8em;
    }
}
