/* =============================================================================
   ui.components.css — Design system globals + UI shell components
   Extracted from index.html <style> block.
   ============================================================================= */

/* ── Design system globals ───────────────────────────────────────────────────── */

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.glass-panel {
    background: rgba(15, 25, 48, 0.7);
    backdrop-filter: blur(24px);
}

.map-overlay-glow {
    box-shadow: 0 0 15px rgba(129, 233, 255, 0.3);
}

.spring-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-glow {
    box-shadow: 0 0 15px rgba(129, 233, 255, 0.15);
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.header-blur {
    background: rgba(6, 14, 32, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(129, 233, 255, 0.05);
}

/* ── Navigation rail ─────────────────────────────────────────────────────────── */

.nav-rail {
    background: rgba(6, 14, 32, 0.8);
    backdrop-filter: blur(32px);
    border-right: 1px solid rgba(129, 233, 255, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: rgb(100 116 139);
    font-family: Inter, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    padding: 8px 0;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}

.nav-item:hover  { color: #a5f3fc; }
.nav-item.active { color: #22d3ee; }

.nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    height: 32px;
    background: #22d3ee;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(129, 233, 255, 0.8);
}

.nav-item .nav-label        { font-weight: 400; }
.nav-item.active .nav-label { font-weight: 700; }

/* ── Nav collapse toggle ─────────────────────────────────────────────────────── */

#main-nav {
    transition: width 0.25s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}

#nav-toggle {
    left: 80px;
    top: calc(50vh - 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 44px;
    background: rgba(15, 25, 48, 0.30);
    border: 1px solid rgba(129, 233, 255, 0.07);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: rgba(163, 170, 196, 0.55);
    cursor: pointer;
    transition: left 0.25s cubic-bezier(.4, 0, .2, 1), color 0.15s, background 0.15s, border-color 0.15s;
}

#nav-toggle:hover {
    color: #81e9ff;
    background: rgba(15, 25, 48, 0.60);
    border-color: rgba(129, 233, 255, 0.18);
}

/* ── Sync panel selects ──────────────────────────────────────────────────────── */

.sync-field-select {
    width: 100%;
    background-color: rgba(15, 25, 48, 0.8);
    border: 1px solid rgba(64, 72, 93, 0.4);
    border-radius: 0.5rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 11px;
    color: #dee5ff;
    transition: all 0.2s;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236d758c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.875rem;
}

.sync-field-select:hover  { border-color: rgba(129, 233, 255, 0.4); background-color: rgba(15, 25, 48, 1); }
.sync-field-select:focus  { outline: none; border-color: rgba(129, 233, 255, 0.5); box-shadow: 0 0 0 1px rgba(129, 233, 255, 0.3); }
.sync-field-select option { background-color: #060e20; color: #dee5ff; }

/* ── Sync action button ──────────────────────────────────────────────────────── */

.sync-action-btn {
    width: 100%;
    background-color: rgba(129, 233, 255, 0.1);
    border: 1px solid rgba(129, 233, 255, 0.3);
    color: #81e9ff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sync-action-btn:hover  { background-color: rgba(129, 233, 255, 0.2); border-color: rgba(129, 233, 255, 0.5); }
.sync-action-btn:active { transform: scale(0.98); }

/* ── Layer card & action buttons ─────────────────────────────────────────────── */

.layer-card { transition: all 0.2s; }

.layer-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    color: #a3aac4;
}

.layer-action-btn:hover  { color: #81e9ff; transform: scale(1.1); }
.layer-action-btn.active { color: #81e9ff; background: rgba(129, 233, 255, 0.1); }

/* ── Sync toggle checkbox ────────────────────────────────────────────────────── */

.sync-toggle {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 3px;
    border: 1.5px solid rgba(64, 72, 93, 0.5);
    background: rgba(6, 14, 32, 0.9);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sync-toggle:hover { border-color: rgba(100, 116, 139, 0.8); }
.sync-toggle.on    { border-color: rgba(52, 211, 153, 0.6); }

.sync-toggle.on::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 1px;
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

/* ── Changelog scrollbar ─────────────────────────────────────────────────────── */

.changelog-scrollbar {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 233, 255, 0.35) rgba(255, 255, 255, 0.04);
    /* Ensure mousewheel works even when not focused */
    overscroll-behavior: contain;
}

.changelog-scrollbar::-webkit-scrollbar       { width: 6px; }
.changelog-scrollbar::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 10px; }
.changelog-scrollbar::-webkit-scrollbar-thumb { background: rgba(129, 233, 255, 0.35); border-radius: 10px; }
.changelog-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(129, 233, 255, 0.6); }

/* ── Layer icon container ────────────────────────────────────────────────────── */

.layer-icon-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ── Leaflet control overrides (replaced by custom UI) ───────────────────────── */

.msr-control.leaflet-bar          { display: none !important; }
.map-location-control.leaflet-bar { display: none !important; }
.cursor-coords-control            { display: none !important; }
