/* ============================================
   DayZ Interactive Map — Tactical UI
   ============================================ */

/* ── Page Layout ── */
.map-page {
    position: relative;
    height: calc(100vh - 64px);
    overflow: hidden;
    background: #050505;
    user-select: none;
}

/* ── Filter Bar ── */
.map-filters {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(to bottom, rgba(5,5,5,0.92) 60%, transparent);
    flex-wrap: wrap;
    pointer-events: none;
}
.map-filters > * { pointer-events: all; }
.map-filters-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-sub);
    margin-right: 8px;
}
.map-filter-btn {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid var(--line-2);
    background: rgba(18,18,18,0.8);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.map-filter-btn:hover {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-hi);
}
.map-filter-btn.active {
    border-color: var(--filter-color, var(--accent));
    background: rgba(59,130,246,0.08);
    color: var(--text-hi);
    box-shadow: 0 0 12px rgba(59,130,246,0.1);
}
.map-filter-btn .f-icon { font-size: 0.85rem; }
.map-filter-btn .f-count {
    font-size: 0.6rem;
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--text-dim);
}
.map-filter-btn.active .f-count {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

/* ── 3D Canvas ── */
#mapCanvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    cursor: grab;
}
#mapCanvas:active { cursor: grabbing; }

/* ── Loading overlay ── */
.map-loading {
    position: absolute; inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
    transition: opacity 0.5s ease;
}
.map-loading-inner { text-align: center; }
.map-loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--line-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mapSpin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes mapSpin { to { transform: rotate(360deg); } }
.map-loading-text {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.map-loading-progress {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 4px;
}

/* ── Atmospheric Overlays ── */
.map-vignette {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 8;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(5,5,5,0.7) 100%);
}

.map-scanlines {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 7;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
}

/* HUD corner brackets */
.map-hud-corner {
    position: absolute;
    width: 40px; height: 40px;
    z-index: 9;
    pointer-events: none;
    opacity: 0.25;
}
.map-hud-corner::before,
.map-hud-corner::after {
    content: '';
    position: absolute;
    background: var(--accent);
}
.map-hud-corner.tl { top: 16px; left: 16px; }
.map-hud-corner.tl::before { top: 0; left: 0; width: 20px; height: 2px; }
.map-hud-corner.tl::after  { top: 0; left: 0; width: 2px; height: 20px; }
.map-hud-corner.tr { top: 16px; right: 16px; }
.map-hud-corner.tr::before { top: 0; right: 0; width: 20px; height: 2px; }
.map-hud-corner.tr::after  { top: 0; right: 0; width: 2px; height: 20px; }
.map-hud-corner.bl { bottom: 16px; left: 16px; }
.map-hud-corner.bl::before { bottom: 0; left: 0; width: 20px; height: 2px; }
.map-hud-corner.bl::after  { bottom: 0; left: 0; width: 2px; height: 20px; }
.map-hud-corner.br { bottom: 16px; right: 16px; }
.map-hud-corner.br::before { bottom: 0; right: 0; width: 20px; height: 2px; }
.map-hud-corner.br::after  { bottom: 0; right: 0; width: 2px; height: 20px; }

/* (3D markers rendered in Three.js — no CSS markers needed) */

/* ── Marker Modal ── */
.map-modal-overlay {
    position: absolute; inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.map-modal {
    position: relative;
    width: 600px; max-width: 92vw;
    max-height: 85vh;
    background: rgba(14,14,14,0.97);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(0,0,0,0.3);
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.map-modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line-2);
    color: var(--text-sub);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    z-index: 2;
}
.map-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-hi); }
.map-modal-image {
    width: 100%;
    border-bottom: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
}
.map-modal-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.map-modal-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    border: 1px solid;
    flex-shrink: 0;
}
.map-modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-hi);
}
.map-modal-cat {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}
.map-modal-body {
    padding: 16px 20px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text);
}
.map-modal-body:empty { display: none; }
.map-modal-coords {
    padding: 10px 20px 16px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    border-top: 1px solid var(--line);
}

/* ── Controls ── */
.map-controls {
    position: absolute;
    bottom: 24px; right: 24px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.map-ctrl-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18,18,18,0.85);
    border: 1px solid var(--line-2);
    color: var(--text-hi);
    font-size: 1.1rem; font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.map-ctrl-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(59,130,246,0.15);
}

/* ── Coordinates display ── */
.map-coords {
    position: absolute;
    bottom: 24px; left: 24px;
    z-index: 20;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    background: rgba(18,18,18,0.7);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .map-page { height: calc(100vh - 56px); }
    .map-filters { padding: 10px 12px; gap: 6px; }
    .map-filter-btn { font-size: 0.62rem; padding: 4px 8px; }
    .map-filters-title { display: none; }
    .map-popup { width: 240px; }
    .map-controls { bottom: 12px; right: 12px; }
    .map-coords { bottom: 12px; left: 12px; }
}
