/* ============================================================
   EarthStatus — World Map Styles
   Glassmorphism interactive map with hover effects
   ============================================================ */

/* ── Map Section ──────────────────────────────────────────── */
.map-section {
    max-width: 1320px;
    margin: 0 auto 48px;
    padding: 0 20px;
    position: relative;
}

.map-section-header {
    text-align: center;
    margin-bottom: 24px;
}

.map-section-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #f5f5f7;
    margin-bottom: 6px;
}

.map-section-header p {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
}

/* ── Map Container ────────────────────────────────────────── */
#world-map-container {
    position: relative;
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255,159,10,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255,107,107,0.02) 0%, transparent 50%),
        rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        inset 0 -1px 0 rgba(0,0,0,0.1),
        0 0 80px rgba(255,159,10,0.02),
        0 20px 60px rgba(0,0,0,0.15);
}

.world-map-svg {
    display: block;
}

/* ── Map Loading ──────────────────────────────────────────── */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.25);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.map-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.08);
    border-top-color: #ff9f0a;
    border-radius: 50%;
    animation: mapSpin 0.8s linear infinite;
}

@keyframes mapSpin { to { transform: rotate(360deg); } }

/* ── Country Paths ────────────────────────────────────────── */
.map-country {
    fill: rgba(255,255,255,0.06);
    stroke: rgba(255,255,255,0.1);
    stroke-width: 0.5;
    cursor: pointer;
    transition: fill 300ms ease, stroke 300ms ease, transform 200ms ease;
    transform-origin: center center;
}

.map-country:hover,
.map-country-hover {
    fill: rgba(255,159,10,0.18);
    stroke: rgba(255,159,10,0.5);
    stroke-width: 1.2;
    filter: url(#countryGlow);
}

/* ── Country Labels ───────────────────────────────────────── */
.map-label {
    font-family: 'Inter', sans-serif;
    font-size: 8.5px;
    font-weight: 600;
    fill: rgba(255,255,255,0.45);
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.5px;
    paint-order: stroke;
    stroke: rgba(0,0,0,0.5);
    stroke-width: 2.5px;
    stroke-linejoin: round;
}

/* ── Tooltip Card ─────────────────────────────────────────── */
.map-tooltip {
    position: absolute;
    width: 220px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(30,30,35,0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.4),
        0 4px 12px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.08);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity 200ms ease, transform 200ms ease;
    z-index: 100;
}

.map-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.map-tt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.map-tt-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.map-tt-name {
    font-size: 14px;
    font-weight: 700;
    color: #f5f5f7;
    letter-spacing: -0.2px;
}

.map-tt-region {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-top: 1px;
}

.map-tt-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.map-tt-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-tt-label {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.3);
}

.map-tt-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #f5f5f7;
}

.map-tt-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 10px;
    color: #ff9f0a;
    font-weight: 500;
    text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    #world-map-container {
        border-radius: 18px;
    }
    .map-label {
        font-size: 5px;
    }
    .map-tooltip {
        width: 180px;
        padding: 12px;
    }
    .map-tt-name {
        font-size: 12px;
    }
    .map-tt-value {
        font-size: 11px;
    }
    .map-section-header h2 {
        font-size: 20px;
    }
}
