body { margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; overflow: hidden; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }

/* Intro Overlay */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
.intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.intro-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.intro-card h2 {
    margin-top: 0;
    color: #3498db;
    font-size: 24px;
}
.intro-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 14px;
}
.intro-sections {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    text-align: left;
}
.intro-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}
.intro-section strong {
    display: block;
    color: #fff;
    margin-bottom: 5px;
    font-size: 13px;
}
.intro-section p {
    margin: 0;
    font-size: 12px;
}
.primary-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.primary-btn:hover {
    background: #2980b9;
}

/* Help Button */
.help-btn {
    position: absolute;
    bottom: 25px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.help-btn:hover {
    background: #3498db;
    transform: scale(1.1);
}

.controls {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 12px;
    top: 20px;
    left: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    position: absolute;
    width: 300px;
    z-index: 1000;
    pointer-events: auto;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 5px;
}
.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-btn.active {
    background: #3498db;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.mode-content {
    display: none;
}
.mode-content.active {
    display: block;
}

/* Explorer Fields */
.explorer-field {
    margin-bottom: 12px;
}
.explorer-field label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* Radio Groups as Segmented Controls */
.radio-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.radio-group input[type="radio"] {
    display: none;
}
.radio-group label {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
    transition: all 0.2s ease;
}
.radio-group input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.radio-group label:hover {
    color: rgba(255, 255, 255, 0.8);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.step-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-align: center;
    flex-grow: 1;
    margin: 0 10px;
}
.nav-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}
.nav-btn:active {
    transform: scale(0.95);
}
.step-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    line-height: 1.5;
}
.stats-box {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin-top: 5px;
    border-left: 4px solid #3498db;
}
#statsLabel { 
    font-size: 10px; 
    text-transform: uppercase; 
    color: rgba(255, 255, 255, 0.5); 
    letter-spacing: 1px;
    font-weight: 600;
}
#statsValue { 
    font-size: 20px; 
    font-weight: 700; 
    color: #fff; 
    margin-top: 4px; 
}
.legend h4 { 
    margin: 15px 0 10px; 
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}
#legendItems {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 15px;
}
.legend div { 
    display: flex; 
    align-items: center; 
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}
.legend div span {
    border-radius: 3px;
    display: inline-block;
    height: 14px;
    margin-right: 8px;
    width: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 20px 0; }

/* Popups */
.maplibregl-popup-content {
    background: rgba(25, 25, 25, 0.95) !important;
    backdrop-filter: blur(8px);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px !important;
    padding: 18px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
}
.maplibregl-popup-close-button {
    color: rgba(255, 255, 255, 0.5);
    padding: 8px;
    font-size: 16px;
}
.maplibregl-popup-close-button:hover {
    color: #fff;
    background: transparent;
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: rgba(25, 25, 25, 0.95) !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: rgba(25, 25, 25, 0.95) !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: rgba(25, 25, 25, 0.95) !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: rgba(25, 25, 25, 0.95) !important;
}

.popup-header {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    color: #3498db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}
.popup-content {
    font-size: 13px;
    line-height: 1.6;
}
.popup-content hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

