/* ============================= */
/* GLOBAL */
/* ============================= */
@import url("https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css");

:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;

    --card: #fafafa;
    --hover: #f1f5f9;

    --tab: #f3f4f6;
    --tab-active: #111827;

    --map-bg: #e6ebf0;

    --bike-classic: #22c55e;
    --bike-ebike: #3b82f6;
}

/* ============================= */
/* DARK MODE */
/* ============================= */
body.dark {
    --bg: #0f172a;
    --panel: #111827;
    --border: #1f2937;
    --text: #e5e7eb;
    --text-muted: #9ca3af;

    --card: #1f2937;
    --hover: #374151;

    --tab: #1f2937;
    --tab-active: #374151;

    --map-bg: #020617;
}

/* ============================= */
/* BASE */
/* ============================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
}

/* ============================= */
/* NAVBAR */
/* ============================= */
.navbar {
    height: 50px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;
}

.theme-btn {
    border: none;
    background: var(--tab);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}

/* ============================= */
/* LAYOUT */
/* ============================= */
#app {
    display: flex;
    height: calc(100vh - 50px);
}

/* ============================= */
/* SIDEBAR */
/* ============================= */
#side-panel {
    width: 320px;
    min-width: 220px;
    max-width: 600px;

    background: var(--panel);
    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;

    overflow-y: auto;
    position: relative;
}

/* ============================= */
/* HEADER */
/* ============================= */
.panel-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

#station-name {
    font-size: 18px;
    font-weight: 600;
}

#station-addr {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================= */
/* TABS */
/* ============================= */
.tabs {
    display: flex;
    gap: 6px;
}

.tab {
    flex: 1;
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: var(--tab);
    cursor: pointer;
}

.tab.active {
    background: var(--tab-active);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================= */
/* DEPARTURES */
/* ============================= */
.departure-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.departure-group:hover {
    background: var(--hover);
}

.departure-group.active {
    border: 2px solid #3b82f6;
}

.departure-header {
    display: flex;
    gap: 6px;
    align-items: center;
}

.route-icon {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.departure-times {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.train-etd {
    background: var(--tab);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.departure-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================= */
/* INFO / ACCESS */
/* ============================= */
.info-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.info-group h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.info-group h4 {
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-group p {
    font-size: 13px;
    line-height: 1.5;
    margin: 6px 0;
}

.info-group ul {
    padding-left: 18px;
    margin: 6px 0;
}

.info-group li {
    margin-bottom: 4px;
}

.info-group a {
    color: #2563eb;
    text-decoration: none;
}

.info-group a:hover {
    text-decoration: underline;
}

/* ============================= */
/* BIKE SHARE */
/* ============================= */
.bikeshare-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.bike-card-grid {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 6px;
}

.bike-name {
    grid-column: 1 / -1;
    font-weight: 600;
}

.bike-meter {
    grid-column: 1 / -1;
    height: 8px;
    background: var(--tab);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.bike-fill {
    height: 100%;
}

.bike-classic {
    background: var(--bike-classic);
}

.bike-ebike {
    background: var(--bike-ebike);
}

.bike-stat {
    font-size: 13px;
}

.bike-stat.classic {
    color: var(--bike-classic);
}
.bike-stat.ebike {
    color: var(--bike-ebike);
}
.bike-stat.docks {
    color: var(--text-muted);
}

/* ============================= */
/* MAP */
/* ============================= */
#svg-container {
    flex: 1;
    background: var(--map-bg);
}

/* route highlight */
#svg-container svg path {
    transition: all 0.2s ease;
}

.dimmed {
    opacity: 0.15;
}

.active-line {
    opacity: 1;
    stroke-width: 6px;
}

/* ============================= */
/* SVG TEXT */
/* ============================= */
#svg-container svg .station_name_text {
    fill: var(--text);
    font-size: 12px;
    font-weight: 600;

    /* improves readability */
    paint-order: stroke;
    stroke: white;
    stroke-width: 2px;
}

/* dark mode text outline */
body.dark #svg-container svg .station_name_text {
    stroke: #020617;
}
/* ============================= */
/* DIRECTIONS */
/* ============================= */
.directions-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.directions-box select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.directions-box button {
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: #3b82f6;
    color: white;
    cursor: pointer;
}

/* ============================= */
/* MOBILE */
/* ============================= */

/* KEEP YOUR VARIABLES (unchanged) */

/* ============================= */
/* CARD ANIMATIONS */
/* ============================= */
.departure-group {
    animation: fadeSlideIn 0.35s ease forwards;
    transform: translateY(8px);
    opacity: 0;
    transition: all 0.2s ease;
}

@keyframes fadeSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.departure-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.departure-group:active {
    transform: scale(0.97);
}

.departure-group.active {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ============================= */
/* ROUTE ANIMATION */
/* ============================= */
#svg-container svg path {
    transition:
        opacity 0.25s ease,
        stroke-width 0.25s ease;
}

.dimmed {
    opacity: 0.15;
}

.active-line {
    stroke-width: 6px;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 0.6s ease forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================= */
/* TAB ANIMATION */
/* ============================= */
.tab-content {
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.2s ease;
    position: absolute;
    width: 100%;
    pointer-events: none;
}

.tab-content.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: auto;
}

/* ============================= */
/* MAP DARK MODE */
/* ============================= */
body.dark #svg-container {
    background: radial-gradient(circle at center, #020617, #000);
}

/* ============================= */
/* SVG TEXT */
/* ============================= */
#svg-container svg .station_name_text {
    fill: var(--text);
    stroke: white;
    stroke-width: 2px;
    paint-order: stroke;
}

body.dark #svg-container svg .station_name_text {
    stroke: #020617;
}

/* ============================= */
/* BIKE */
/* ============================= */
.bike-classic {
    background: var(--bike-classic);
}

.bike-ebike {
    background: var(--bike-ebike);
}

.tab {
    transition: all 0.2s ease;
}

.tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.theme-btn {
    transition: all 0.2s ease;
}

.theme-btn:hover {
    transform: rotate(10deg) scale(1.05);
}
/* ============================= */
/* BUTTON FEEDBACK */
/* ============================= */

.directions-box button {
    position: relative;
    overflow: hidden;
}

.directions-box button::after {
    content: "";
    position: absolute;
    width: 120%;
    height: 120%;
    top: 50%;
    left: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.directions-box button:active::after {
    transform: translate(-50%, -50%) scale(1);
}
/* ============================= */
/* ROUTE GLOW */
/* ============================= */

.active-line {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

body.dark .active-line {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8));
}
/* ============================= */
/* ROUTE GLOW */
/* ============================= */

.active-line {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

body.dark .active-line {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8));
}
/* ============================= */
/* STATION HOVER */
/* ============================= */

/* ============================= */
/* SCROLL SMOOTH */
/* ============================= */

#side-panel {
    scroll-behavior: smooth;
}
/* ============================= */
/* LOADING SHIMMER */
/* ============================= */

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.2s infinite;
}
/* ============================= */
/* ACTIVE CARD PULSE */
/* ============================= */

.departure-group.active {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes shimmer {
    100% {
        left: 150%;
    }
}
@media (max-width: 700px) {
    #app {
        flex-direction: column;
    }

    #side-panel {
        width: 100%;
        height: 45%;
    }

    #svg-container {
        height: 55%;
    }
}
/* ============================= */
/* BACKGROUND DEPTH */
/* ============================= */

#svg-container {
    background: radial-gradient(circle at center, var(--map-bg), #cbd5e1);
}

body.dark #svg-container {
    background: radial-gradient(circle at center, #020617, #000);
}
/* ============================= */
/* ICON POLISH */
/* ============================= */

.route-icon {
    transition: transform 0.2s ease;
}

.departure-group:hover .route-icon {
    transform: scale(1.15);
}