:root {
    --bg-deep: #020617;
    --bg-dark: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.3);
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;

    --cargo: #22c55e;
    --tanker: #f97316;
    --passenger: #3b82f6;
    --other: #a855f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-deep);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: 70px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 1000;
    padding: 0 2rem;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand h1 {
    font-size: 1.25rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ship-icon {
    font-size: 1.5rem;
    animation: bobbing 3s ease-in-out infinite;
}

@keyframes bobbing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.metrics {
    display: flex;
    gap: 3rem;
}

.metric {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.metric .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.metric .value.status {
    font-size: 0.9rem;
}

/* Map */
#map {
    flex: 1;
    z-index: 1;
    background: #0a1628;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    z-index: 1000;
}

.legend-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.scale-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.color-dot.cargo {
    background: var(--cargo);
}

.color-dot.tanker {
    background: var(--tanker);
}

.color-dot.passenger {
    background: var(--passenger);
}

.color-dot.other {
    background: var(--other);
}

/* Loader */
.loader-bg {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}

.loader-bg.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.wave {
    width: 80px;
    height: 20px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(90deg, var(--accent), transparent, var(--accent));
    background-size: 200% 100%;
    animation: wave 1.5s infinite;
    border-radius: 10px;
}

@keyframes wave {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Popups */
.leaflet-popup-content-wrapper {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

.leaflet-popup-tip {
    background: var(--bg-dark);
}

.popup-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.popup-card p {
    font-size: 0.85rem;
    margin: 0.25rem 0;
    color: var(--text-dim);
}

.popup-card .speed {
    color: var(--cargo);
    font-weight: 600;
}

/* Ship marker */
.ship-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.3s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        height: 60px;
        padding: 0 1rem;
    }

    .brand h1 {
        font-size: 0.9rem;
    }

    .metrics {
        gap: 1rem;
    }

    .metric .label {
        font-size: 0.6rem;
    }

    .metric .value {
        font-size: 0.9rem;
    }

    .legend {
        bottom: 20px;
        right: 10px;
        padding: 0.75rem;
    }

    .legend-title {
        font-size: 0.65rem;
    }

    .scale-item {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .brand h1 {
        display: none;
    }

    .metrics {
        gap: 0.75rem;
    }

    .metric .value.status {
        font-size: 0.75rem;
    }
}