@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&display=swap');

:root {
    /* Design System Colors */
    --bg-color: #0F0F23;
    --card-bg: rgba(23, 23, 35, 0.8);
    /* Glass effect base */
    --primary: #7C3AED;
    --secondary: #A78BFA;
    --cta: #F43F5E;
    --text-main: #E2E8F0;
    --text-dim: #94A3B8;

    /* Functional Colors (Neon) */
    --neon-yellow: #facc15;
    --neon-green: #4ade80;
    --neon-red: #fb7185;

    --border-color: rgba(148, 163, 184, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', monospace;
    /* Tech/Industrial look */
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 50% 0%, #1e1e3f 0%, transparent 70%),
        linear-gradient(rgba(15, 15, 35, 0.9), rgba(15, 15, 35, 0.9));
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Header - Cyberpunk HUD style */
header {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
    z-index: 1000;
}

h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

#status {
    font-size: 0.75rem;
    color: var(--secondary);
    background: rgba(124, 58, 237, 0.1);
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

#status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse-dot 2s infinite;
}

/* Map Container */
#map {
    flex: 1;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

/* Leaflet Dark Mode Tweaks */
.leaflet-container {
    background: #0F0F23;
}

.leaflet-control-attribution {
    background: rgba(15, 15, 35, 0.8) !important;
    color: var(--text-dim) !important;
}

.leaflet-control-attribution a {
    color: var(--secondary) !important;
}

/* Bento Grid Dashboard Panel */
#info-panel {
    background: linear-gradient(to top, var(--bg-color), rgba(15, 15, 35, 0.95));
    padding: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 12px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Station Card - Hero Element */
#nearest-station {
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.05) 0%, transparent 100%);
}

.card h2 {
    margin: 0 0 12px 0;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Station Info Typography */
.station-name {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 4px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.station-dist {
    font-size: 0.9rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Train List Styles */
.train-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.train-row:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    border-color: rgba(124, 58, 237, 0.3);
}

.train-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.train-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.t-no {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-yellow);
    line-height: 1;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}

.t-dir {
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.t-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.t-time {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.t-status {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Animations */
@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* User Marker */
.user-marker div {
    animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}
