@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-nav: rgba(11, 15, 25, 0.85);
    --bg-sidebar: linear-gradient(180deg, rgba(16,33,48,0.9) 0%, rgba(11,15,25,0.95) 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --color-primary: #3b82f6;
    --color-primary-glow: rgba(59, 130, 246, 0.4);
    
    --color-safe: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); overflow: hidden; height: 100vh; }

.app-container { display: flex; flex-direction: column; height: 100vh; }

/* Top Navbar */
.top-navbar {
    display: flex; justify-content: space-between; align-items: center;
    height: 60px; padding: 0 24px;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 2000;
}
.nav-left { display: flex; align-items: baseline; gap: 12px; }
.nav-left h1 { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.nav-subtitle { font-size: 13px; color: var(--text-muted); }

.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-link { color: var(--text-main); text-decoration: none; font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 500; transition: color 0.3s; }
.nav-link:hover { color: var(--color-primary); }

/* Theme Switch Pill */
.theme-switch {
    width: 44px; height: 24px; background: rgba(255,255,255,0.2); border-radius: 12px; position: relative; cursor: pointer; border: 1px solid var(--glass-border);
}
.switch-thumb {
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    position: absolute; top: 2px; right: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.light-theme .switch-thumb { right: auto; left: 3px; }

/* Main Layout */
.main-layout { display: flex; height: calc(100vh - 60px); position: relative; }

/* Sidebar */
.sidebar {
    width: 380px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    position: relative;
    z-index: 1000;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
}

/* Sidebar glowing orb behind */
.sidebar::before {
    content: ''; position: absolute; top: 30%; left: -50px; width: 250px; height: 250px;
    background: rgba(6, 182, 212, 0.15); filter: blur(70px); border-radius: 50%; z-index: -1;
}

.sidebar-scroll {
    height: 100%; overflow-y: auto; padding: 20px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.02), 0 8px 20px rgba(0,0,0,0.2);
}
.glass-card h3 { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* Form Grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; color: var(--text-muted); }
.form-group input, .form-group select {
    background: #ffffff; color: #111;
    border: 1px solid transparent; border-radius: 6px; padding: 10px; font-size: 13px; font-weight: 500; font-family: 'Inter';
    transition: all 0.3s; width: 100%;
}
.form-group input:focus, .form-group select:focus {
    outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* Predict Button */
.btn-predict {
    width: 100%; padding: 14px; border: none; border-radius: 8px;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6); color: #fff;
    font-weight: 600; font-size: 13px; cursor: pointer;
    box-shadow: 0 4px 15px var(--color-primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-predict:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.6); }

/* Result Panel */
.result-panel { background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.2); }
.result-score-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.score-main { display: flex; align-items: center; gap: 12px; }
.score-percent { font-family: 'Outfit', sans-serif; font-size: 52px; font-weight: 800; color: var(--color-safe); line-height: 1; letter-spacing: -1px; }
.score-badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 800; border: 1px solid; }
.score-badge.safe { color: var(--color-safe); border-color: var(--color-safe); background: rgba(16,185,129,0.1); }
.score-badge.warning { color: var(--color-warning); border-color: var(--color-warning); background: rgba(245,158,11,0.1); }
.score-badge.danger { color: var(--color-danger); border-color: var(--color-danger); background: rgba(239,68,68,0.1); }

/* XGBoost Badge */
.xgboost-badge { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--glass-border); }
.xgboost-badge i { font-size: 24px; color: #a855f7; }
.xgb-text { display: flex; flex-direction: column; line-height: 1.2; }
.xgb-text small { font-size: 10px; color: var(--text-muted); }
.xgb-text strong { font-size: 13px; font-weight: 700; }

.result-details { font-size: 12px; color: #e2e8f0; line-height: 1.6; }
.result-details strong { color: #fff; display: block; margin-bottom: 4px; font-size: 13px; }

/* Alert Card */
.alert-card {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    display: flex; gap: 16px; align-items: flex-start;
}
.alert-icon { font-size: 32px; color: var(--color-danger); margin-top: 2px; }
.alert-content h4 { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.alert-content p { font-size: 12px; color: #f87171; line-height: 1.4; font-weight: 500; }

/* Sidebar Footer */
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding: 0 4px; }
.rekomendasi-link { color: #cbd5e1; text-decoration: underline; font-size: 12px; display: flex; align-items: center; gap: 6px; transition: color 0.3s; }
.rekomendasi-link:hover { color: #fff; }
.btn-panel-admin { background: #fff; color: #111; text-decoration: none; padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.2s; }
.btn-panel-admin:hover { transform: translateY(-2px); }

/* Map View */
.map-view { flex: 1; position: relative; }
#map { width: 100%; height: 100%; background-color: #0b0f19 !important; }

/* Leaflet Dark Overrides */
.leaflet-container { background: #0b0f19 !important; font-family: 'Inter', sans-serif; }
.leaflet-bar { border: 1px solid var(--glass-border) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { background: rgba(31,41,55,0.9) !important; color: #fff !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
.leaflet-bar a:hover { background: #374151 !important; color: var(--color-primary) !important; }

/* Map Legend */
.map-legend { position: absolute; bottom: 24px; right: 24px; z-index: 1000; width: 180px; padding: 16px; border-radius: 12px; }
.map-legend h4 { font-family: 'Outfit', sans-serif; font-size: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--glass-border); padding-bottom: 6px; }
.legend-item { font-size: 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #e2e8f0; font-weight: 500; }
.legend-item:last-child { margin-bottom: 0; }
.legend-color { width: 14px; height: 14px; border-radius: 3px; }
.legend-color.risk { background: #ef4444; }
.legend-color.kamp-zone { background: #f97316; }
.legend-color.kamp-tsunami { background: #f59e0b; }
.legend-color.keamanan { background: #eab308; }
.legend-color.aman { background: #84cc16; }

/* Shelter Recommendations */
.shelter-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.shelter-card {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 8px; padding: 12px;
    display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s;
}
.shelter-card:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); }
.shelter-info { display: flex; flex-direction: column; }
.shelter-name { font-weight: 600; font-size: 13px; color: #fff; margin-bottom: 4px; }
.shelter-meta { font-size: 11px; color: var(--text-muted); }
.shelter-dist { font-size: 13px; font-weight: 700; color: var(--color-safe); background: rgba(16,185,129,0.1); padding: 4px 8px; border-radius: 6px; }

/* Hide helper classes */
.hidden { display: none !important; }
