/* ==========================================================================
   Katrusin Tracker (katrusya.pp.ua) - Futuristic Cyber Dark Theme CSS
   ========================================================================== */

:root {
    --bg-dark: #070a11;
    --surface-dark: #0f1522;
    --surface-variant: #182032;
    --glass-border: rgba(255, 183, 3, 0.28);
    --gold-accent: #ffb703;
    --gold-glow: #ffc300;
    --candy-red: #ff2a4b;
    --emerald-green: #00e676;
    --cyan-accent: #00b4d8;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #57657a;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Card Style */
.glass-card {
    background: linear-gradient(180deg, rgba(24, 32, 50, 0.88) 0%, rgba(15, 21, 34, 0.94) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Header Navbar */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(15, 21, 34, 0.92);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-accent), var(--candy-red));
    border: 1px solid var(--gold-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.4);
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.brand-text span {
    font-size: 11px;
    color: var(--emerald-green);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--emerald-green);
    box-shadow: 0 0 8px var(--emerald-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.date-picker-input {
    background: var(--surface-variant);
    border: 1px solid var(--glass-border);
    color: var(--gold-accent);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.settings-btn {
    background: var(--surface-variant);
    border: 1px solid var(--glass-border);
    color: var(--gold-accent);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: var(--gold-accent);
    color: var(--bg-dark);
}

/* Route Slider / Carousel */
.slider-section {
    padding: 16px 24px 12px 24px;
}

.slider-section-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--gold-accent);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.route-slider-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
}

.route-slider-track::-webkit-scrollbar {
    height: 4px;
}

.route-slider-track::-webkit-scrollbar-thumb {
    background: var(--gold-accent);
    border-radius: 4px;
}

.route-card {
    min-width: 220px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.route-card.active {
    border-color: var(--gold-accent);
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.18), var(--surface-dark));
    box-shadow: 0 0 16px rgba(255, 183, 3, 0.25);
}

.route-card-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-badge {
    background: rgba(0, 230, 118, 0.2);
    color: var(--emerald-green);
    border: 1px solid var(--emerald-green);
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
}

.route-card-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.route-card-dist {
    font-size: 16px;
    font-weight: 800;
    color: var(--gold-accent);
    margin-top: 8px;
}

/* Main Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    padding: 0 24px 24px 24px;
    flex: 1;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Map View Container */
.map-container-card {
    position: relative;
    width: 100%;
    height: 580px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

#map {
    width: 100%;
    height: 100%;
    background-color: #0d121d;
}

/* Dark Matrix Filter for Leaflet Tiles */
.leaflet-tile-pane {
    filter: brightness(0.65) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3);
}

/* Live Telemetry Panel Right Side */
.telemetry-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hud-speed-box {
    padding: 20px;
    text-align: center;
}

.hud-speed-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.hud-speed-value {
    font-size: 56px;
    font-weight: 900;
    color: var(--emerald-green);
    line-height: 1;
    margin: 8px 0;
    text-shadow: 0 0 18px rgba(0, 230, 118, 0.4);
}

.hud-speed-unit {
    font-size: 16px;
    font-weight: 700;
    color: var(--emerald-green);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-card {
    padding: 12px;
    background: rgba(24, 32, 50, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    text-align: center;
}

.metric-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.metric-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--gold-accent);
    margin-top: 4px;
}

.stops-list-container {
    padding: 16px;
    max-height: 240px;
    overflow-y: auto;
}

.stop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 42, 75, 0.1);
    border: 1px solid rgba(255, 42, 75, 0.3);
    border-radius: 12px;
    margin-bottom: 8px;
}

.stop-item-icon {
    color: var(--candy-red);
    font-size: 16px;
}

.stop-item-text {
    font-size: 12px;
}

.stop-item-text strong {
    color: var(--text-primary);
    display: block;
}

.stop-item-text span {
    color: var(--text-secondary);
    font-size: 11px;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 10, 17, 0.82);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 420px;
    padding: 24px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--gold-accent);
    margin-bottom: 20px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.setting-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Custom Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--surface-variant);
    border: 1px solid var(--glass-border);
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--gold-accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--bg-dark);
}

.modal-close-btn {
    width: 100%;
    padding: 12px;
    background: var(--gold-accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
}
