/* ============================================================
   MAP PAGE STYLES
   map.html — Globe overview + Leaflet world viewer
   ============================================================ */

/* ── Map hero status bar ─────────────────────────────────── */
.map_hero {
    position: relative;
    padding: 16px 0 14px;
    text-align: center;
}

.map_hero_meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Live player count */
.map_player_count {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.03em;
}

.map_player_count strong {
    color: #c8a84e;
    font-weight: 600;
}

/* Server status dot */
.map_status_dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map_status_dot::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: background 0.4s, box-shadow 0.4s;
}

.map_status_dot.online::before {
    background: #4cce6e;
    box-shadow: 0 0 0 4px rgba(76,206,110,0.18);
    animation: pulse_dot 2.5s ease-in-out infinite;
}

.map_status_dot.offline::before {
    background: #e05050;
}

@keyframes pulse_dot {
    0%   { box-shadow: 0 0 0 0   rgba(76,206,110,0.35); }
    60%  { box-shadow: 0 0 0 6px rgba(76,206,110,0);    }
    100% { box-shadow: 0 0 0 0   rgba(76,206,110,0);    }
}

/* ── Globe overview section ──────────────────────────────── */
#map-globe-section {
    position: relative;
    height: 350px;
    background: radial-gradient(ellipse at 50% 60%, #0d0820 0%, #04020c 100%);
    border-top:    1px solid rgba(200,168,78,0.12);
    border-bottom: 1px solid rgba(200,168,78,0.12);
    overflow: hidden;
}

/* Globe canvas fills the section absolutely */
#map-globe-section canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* World name label bar — centred row of clickable world names */
.globe-label-bar {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    pointer-events: all;
}

.globe-label {
    color: rgba(255,255,255,0.45);
    font-size: 0.72rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    white-space: nowrap;
    padding: 2px 6px;
    border-bottom: 1px solid transparent;
}

.globe-label:hover,
.globe-label.active {
    color: #c8a84e;
    border-bottom-color: rgba(200,168,78,0.5);
}

/* ── Leaflet canvas wrapper ──────────────────────────────── */
#map-canvas-wrapper {
    position: relative;
    height: calc(100vh - 540px);
    min-height: 380px;
    border-bottom: 1px solid rgba(200,168,78,0.1);
    background: #0a0810;
    overflow: hidden;
}

/* Leaflet map div fills the wrapper */
#leaflet-map {
    width: 100%;
    height: 100%;
    background: #0a0810;
}

/* ── Leaflet dark theme overrides ────────────────────────── */
.leaflet-container {
    background: #0a0810 !important;
    font-family: inherit;
}

/* Zoom buttons */
.leaflet-control-zoom {
    border: none !important;
}

.leaflet-control-zoom a {
    background: rgba(10,8,16,0.88) !important;
    color: rgba(255,255,255,0.55) !important;
    border: 1px solid rgba(200,168,78,0.25) !important;
    border-radius: 3px !important;
    transition: background 0.15s, color 0.15s;
}

.leaflet-control-zoom a:hover {
    background: rgba(200,168,78,0.12) !important;
    color: #c8a84e !important;
    border-color: rgba(200,168,78,0.5) !important;
}

.leaflet-control-zoom-in  { margin-bottom: 2px !important; }

/* Tile pane cursor */
.leaflet-grab   { cursor: grab; }
.leaflet-grabbing { cursor: grabbing; }

/* ── Map UI overlay ──────────────────────────────────────── */
#map-ui {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

#map-coords-display {
    pointer-events: none;
    background: rgba(10,8,16,0.82);
    color: rgba(255,255,255,0.55);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    padding: 4px 10px;
    border: 1px solid rgba(200,168,78,0.22);
    border-radius: 3px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

#map-world-selector {
    display: flex;
    gap: 4px;
    pointer-events: all;
}

.map-world-btn {
    background: rgba(10,8,16,0.82);
    color: rgba(255,255,255,0.55);
    border: 1px solid rgba(200,168,78,0.22);
    border-radius: 3px;
    padding: 3px 10px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.map-world-btn:hover,
.map-world-btn.active {
    color: #c8a84e;
    border-color: rgba(200,168,78,0.6);
}

#map-player-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: all;
}

.map-player-dot {
    background: rgba(10,8,16,0.82);
    color: #c8a84e;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-left: 2px solid #c8a84e;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s;
    white-space: nowrap;
}

.map-player-dot:hover {
    background: rgba(200,168,78,0.12);
}

/* ── Player markers (Leaflet divIcon) ────────────────────── */
.player-marker-icon {
    background: transparent !important;
    border: none !important;
}

.player-dot {
    width: 10px;
    height: 10px;
    background: #c8a84e;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: 0 0 6px rgba(200,168,78,0.7);
}

.player-name {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,8,16,0.88);
    color: #c8a84e;
    font-size: 0.70rem;
    padding: 1px 5px;
    border-radius: 2px;
    white-space: nowrap;
    border: 1px solid rgba(200,168,78,0.3);
    pointer-events: none;
    letter-spacing: 0.03em;
}

/* ── Loading overlay ─────────────────────────────────────── */
#map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 500;
}

#map-loading.visible {
    opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    #map-globe-section {
        height: 240px;
    }

    #map-canvas-wrapper {
        height: calc(100vh - 430px);
        min-height: 280px;
    }

    #map-ui {
        top: 8px;
        right: 8px;
    }
}
