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

body {
    font-family: "Oxanium", sans-serif;
    display: flex;
    height: 100vh;
    background: #f5f5f5;
}

.navbar-brand {
    color: white;
    font-size: 48px;
    font-weight: bold;
    text-decoration: none;
    padding: 15px 0;
}

.navbar-brand:hover {
    color: #FFB703;
}

#sidebar {
    width: 300px;
    background: #002C49;
    border-right: 1px solid #FFB703;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#sidebar h1 {
    font-size: 18px;
    margin-bottom: 15px;
    margin-top: 15px;
    color: #FFB703;
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.route-item {
    padding: 8px 10px;
    background: #001f32;
    border: 1px solid #3a3a3a;
    color: #FFF;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-size: 16px;
}

.route-item:hover {
    background: #001f32;
    border-color: #FFB703;
}

.route-item.active {
    background: #FFB703;
    color: #000;
    border-color: #333;
    font-weight: bold;
}

.colour-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

#map-container {
    flex: 1;
    background: white;
    position: relative;
    overflow: hidden;
}

svg {
    width: 100%;
    height: 100%;
    display: block;
}

.route-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: stroke;
}

.route-line:hover {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.route-line.active {
    stroke-width: 4;
    opacity: 1;
    z-index: 100;
}

.stop {
    fill: white;
    stroke: #333;
    stroke-width: 2;
    cursor: pointer;
    z-index: 10;
}

.stop:hover {
    r: 8;
    stroke-width: 3;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}

.stop.inactive {
    opacity: 0.3;
}


#tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
}

.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

#controls {
    padding: 10px;
    background: #001f32;
    border-bottom: 1px solid #FFB703;
    margin-bottom: 10px;
}

button {
    padding: 8px 12px;
    background: #1b84c9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-right: 8px;
}

button:hover {
    background: #FFB703;
}

.stop-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 500px;
    height: 100vh;
    background: #EEE;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    font-family: "Oxanium", sans-serif;
}

.stop-panel:not(.hidden) {
    transform: translateX(0);
}

.stop-panel.hidden {
    display: none;
}

.stop-panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: sticky;
    top: 0;
    background: #001f32;
}

.stop-panel-header h2 {
    margin: 0;
    font-size: 22px;
    color: #FFB703;
    flex: 1;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #FFB703;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #D00;
}

.stop-panel-content {
    padding: 20px;
}

.stop-info-section {
    margin-bottom: 24px;
}

.stop-info-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.routes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.route-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    color: white;
    min-width: 60px;
    text-align: center;
}

.stop-id-section {
    border-top: 2px solid #001f32;
    margin-bottom: 24px;
}

.stop-id-section h3 {
    margin: 10px 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.stop-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.stop-id-tag {
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'Nova Mono', monospace;
    color: #222;
}

.page-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 14px;
    color: #333;
    z-index: 100;
    pointer-events: none;
    padding: 4px 8px;
    border-radius: 3px;
}

.page-footer a {
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none;
}

.view-departures-btn {
    width: 100%;
    padding: 12px;
    margin: 0 0;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.view-departures-btn:hover {
    background-color: #0052a3;
}

.view-departures-btn:active {
    background-color: #003d7a;
}


@media (orientation: portrait) {
    body {
        flex-direction: column;
    }

    .name-container {
        display: none;
    }

    #sidebar {
        width: 100%;
        height: 30%;
        border-right: none;
        border-top: 1px solid #ddd;
        padding: 10px 15px;
        overflow-y: auto;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 10;
    }

    .route-list {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 8px;
    }

    #map-container {
        flex: 1;
        height: 70%;
        width: 100%;
    }

    .stop-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 50%;
        transform: translateY(100%);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
        z-index: 1001;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .stop-panel:not(.hidden) {
        transform: translateY(0);
    }

    .stop-panel-header {
        padding: 15px;
        flex-shrink: 0;
        position: static !important;
        top: auto !important;
    }

    .stop-panel-content {
        padding: 15px;
        overflow-y: visible;
    }

    .page-footer {
        bottom: auto;
        top: 3px;
        left: 1px;
        right: auto;
        padding: 1px 4px;
        background-color: #00000000;
        font-size: 10px;
    }
}
