/* HUD: map surface overlay controls (zoom, heat legend, timescale, logo) */

/* --- Logo --- */

.hud-logo {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 100px;
    z-index: 2;
    opacity: 0.7;
}

.hud-logo svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Locate --- */

.hud-locate {
    position: absolute;
    bottom: 177px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(36, 38, 56, 0.85);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hud-locate.revealed {
    opacity: 1;
    pointer-events: auto;
}

.hud-locate:hover {
    color: rgba(255, 255, 255, 1);
}

.hud-locate svg {
    width: 18px;
    height: 18px;
}

/* --- Zoom --- */

.hud-zoom {
    position: absolute;
    bottom: 96px;
    right: 20px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hud-zoom button {
    width: 36px;
    height: 36px;
    background: rgba(36, 38, 56, 0.85);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.hud-zoom button:hover {
    color: rgba(255, 255, 255, 1);
}

.hud-zoom-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Heat legend --- */

.hud-heat {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.15);
    padding: 12px 14px 8px;
    border-radius: 8px;
    font-size: 11px;
    color: white;
    z-index: 2;
}

.hud-heat-bar {
    width: 120px;
    height: 12px;
    border-radius: 2px;
    margin-bottom: 4px;
}

.hud-heat-labels {
    display: flex;
    justify-content: space-between;
}

/* --- Timescale --- */

.hud-timescale {
    position: absolute;
    bottom: 20px;
    right: 195px;
    width: 100px;
    z-index: 2;
}

.hud-timescale-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 4px;
}

/* Tick marks at each end */
.hud-timescale-bar::before,
.hud-timescale-bar::after {
    content: '';
    position: absolute;
    top: -2px;
    width: 1px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.hud-timescale-bar::before { left: 0; }
.hud-timescale-bar::after { right: 0; }

.hud-timescale-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease, left 0.3s ease;
    left: 50%;
}

.hud-timescale.active .hud-timescale-marker {
    opacity: 1;
}

.hud-timescale-year {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hud-timescale.active .hud-timescale-year {
    opacity: 1;
}

.hud-timescale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.25);
}

/* --- Mobile --- */

@media (max-width: 800px) {
    .hud-timescale {
        /* Just above the half-open drawer, left side */
        bottom: 50%;
        right: auto;
        left: 16px;
        margin-bottom: -28px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .hud-timescale.mobile-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .hud-heat {
        bottom: 16px;
        right: 16px;
    }

    .hud-locate {
        bottom: 80px;
        right: 16px;
    }

    .hud-logo {
        top: 68px;
        right: 16px;
        width: 80px;
        transition: opacity 0.3s ease;
    }

    .hud-logo.obscured {
        opacity: 0;
        pointer-events: none;
    }
}
