* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background-color: #121212; font-family: 'Segoe UI', sans-serif; }
#map { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; z-index: 1; }

.header-bar {
    position: absolute; top: 15px; left: 50px; z-index: 1000;
    background: rgba(18, 18, 18, 0.9); color: #fff; padding: 10px 20px;
    border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.header-bar h1 { font-size: 15px; letter-spacing: 1px; }

.stats-panel {
    position: absolute; top: 75px; left: 50px; z-index: 1000;
    background: rgba(18, 18, 18, 0.9); color: #00ffcc; padding: 8px 15px;
    border-radius: 6px; border: 1px solid rgba(0, 255, 204, 0.3);
    font-size: 12px; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Log errori: nascosto finché non c'è almeno un problema */
.error-log {
    position: absolute; top: 125px; left: 50px; z-index: 1000;
    display: none; max-width: 280px;
    background: rgba(40, 0, 0, 0.85); color: #ffb3b3; padding: 6px 10px;
    border-radius: 6px; border: 1px solid rgba(255, 77, 77, 0.4);
    font-size: 11px; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.error-item { padding: 2px 0; }

.filter-panel {
    position: absolute; top: 15px; right: 20px; z-index: 1000;
    background: rgba(18, 18, 18, 0.9); padding: 10px 15px; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2); display: flex; gap: 8px; flex-wrap: wrap; max-width: 580px; justify-content: flex-end;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.filter-btn {
    background: #2a2a2a; color: #888; border: 1px solid #444;
    padding: 6px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: bold;
    transition: all 0.2s ease;
}
.filter-btn.active { background: #ff4d4d; color: #fff; border-color: #ff4d4d; }

/* Stile Popup */
.leaflet-popup-content-wrapper { background: #1e1e1e; color: #fff; border: 1px solid #444; border-radius: 8px; }
.leaflet-popup-tip { background: #1e1e1e; }
.popup-title { font-size: 14px; font-weight: bold; margin-bottom: 5px; border-bottom: 1px solid #444; padding-bottom: 4px; }
.popup-detail { font-size: 12px; margin: 3px 0; color: #ccc; }
.popup-badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; margin-top: 5px; }

.popup-link-btn {
    display: block; width: 100%; text-align: center; background: #0088cc; color: #fff !important;
    padding: 5px 0; margin-top: 8px; border-radius: 4px; font-size: 11px; font-weight: bold;
    text-decoration: none; transition: background 0.2s ease;
}
.popup-link-btn:hover { background: #00aaff; }

.badge-ingv { background: #00cc66; color: #000; }
.badge-usgs { background: #ff9900; color: #000; }
.badge-emsc { background: #9933ff; color: #fff; }
.badge-nasa { background: #ff3333; color: #fff; }
.badge-volcano { background: #d9534f; color: #fff; }
.badge-flood { background: #0099ff; color: #fff; }
.badge-war { background: #800000; color: #fff; }
.badge-famine { background: #d4af37; color: #000; }
.badge-news { background: #ffcc00; color: #000; }

.emoji-icon { font-size: 20px; text-shadow: 0 0 6px #000; cursor: pointer; }

.national-links {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 1000;
    background: rgba(18, 18, 18, 0.9); padding: 8px 16px; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2); display: flex; gap: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.national-links a {
    color: #ccc; font-size: 12px; font-weight: bold; text-decoration: none;
    transition: color 0.2s ease;
}
.national-links a:hover { color: #00ffcc; }
.link-placeholder { color: #888; font-size: 12px; font-style: italic; }

.country-tooltip {
    background: rgba(0, 191, 255, 0.9);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}
