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

:root {
    --bg: #0a0e17;
    --bg-card: #111827;
    --text: #e5e7eb;
    --text-dim: #6b7280;
    --accent: #3b82f6;
    --green: #22c55e;
    --yellow: #eab308;
    --orange: #f97316;
    --red: #ef4444;
    --border: #1f2937;
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
header {
    text-align: center;
    padding: 16px 0;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dot {
    color: var(--accent);
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading dots */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* Predictions */
.predictions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.prediction-row {
    display: grid;
    grid-template-columns: 70px 1fr 100px;
    align-items: center;
    gap: 12px;
    height: 36px;
}

.time-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dim);
}

.bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s ease, background-color 0.5s ease;
}

/* Shimmer effect for loading bars */
.prediction-row.loading .bar-container {
    background: linear-gradient(90deg, var(--border) 25%, #1e293b 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.result {
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
}

.prediction-row.loading .result {
    color: var(--text-dim);
}

/* Map */
.map-section {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

#map {
    height: 350px;
    width: 100%;
    background: var(--bg-card);
}

/* Leaflet dark tiles */
.leaflet-tile-pane {
    filter: brightness(0.7) contrast(1.1) saturate(0.3);
}

.leaflet-control-attribution {
    background: rgba(10, 14, 23, 0.8) !important;
    color: var(--text-dim) !important;
    font-size: 10px !important;
}

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

/* Map animation controls */
.map-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.anim-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.anim-btn:hover {
    background: var(--border);
}

.anim-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 0 4px;
}

/* Error state */
.error-message {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.875rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Responsive */
@media (min-width: 640px) {
    .container {
        padding: 40px 16px;
    }

    h1 {
        font-size: 2.5rem;
    }

    #map {
        height: 420px;
    }
}
