/* 
   ==========================================================================
   ULTRA-MODERN GLASSMORPHISM MAP DASHBOARD
   Design System for LaporJalan Kab. Demak
   ========================================================================== 
*/

:root {
    --bg-workspace: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --accent-blue: #3b82f6; /* Cerulean Blue */
    --accent-teal: #14b8a6;
    --accent-orange: #f59e0b;
    --accent-red: #f43f5e; /* Coral Red */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius-pill: 50px;
    --radius-card: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.map-page-body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-workspace);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Base Workspace with Gradients */
.workspace-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* Central Map Canvas (The "Dashboard App" Feeling) */
.map-canvas-container {
    flex: 1;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 
   --------------------------------------------------------------------------
   FLOATING UI: HORIZONTAL PILL NAVIGATION (LEFT)
   -------------------------------------------------------------------------- 
*/

.nav-pill-horizontal {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    gap: 8px;
}

.pill-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 8px;
}

/* Icon Buttons (Back, etc.) */
.btn-icon {
    width: 48px;
    border-radius: 50%;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    background: transparent;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

/* Select Containers */
.select-container {
    position: relative;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 180px;
}

.sm-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 10px;
}

.select-container select {
    appearance: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    width: 100%;
    outline: none;
}

/* Main Action Button (Cerulean Blue) */
.btn-action-blue {
    background: var(--accent-blue);
    color: white;
    padding: 0 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: default;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* 
   --------------------------------------------------------------------------
   FLOATING UI: LEGEND CARD (RIGHT)
   -------------------------------------------------------------------------- 
*/

.legend-card-glass {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 240px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
    border-radius: var(--radius-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.legend-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.legend-item-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.indicator.teal { background: var(--accent-teal); box-shadow: 0 0 10px rgba(20, 184, 166, 0.4); }
.indicator.orange { background: var(--accent-orange); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.indicator.red { background: var(--accent-red); box-shadow: 0 0 10px rgba(244, 63, 94, 0.4); }

.indicator-outline {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 2px solid var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.legend-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 16px 0;
}

/* 
   --------------------------------------------------------------------------
   ANIMATIONS
   -------------------------------------------------------------------------- 
*/

.animate-float {
    animation: floatUI 4s ease-in-out infinite;
}

@keyframes floatUI {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 
   --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- 
*/

@media (max-width: 1024px) {
    .workspace-wrapper {
        padding: 15px;
    }
    
    .nav-pill-horizontal {
        top: 20px;
        left: 20px;
        right: 20px;
        width: calc(100% - 40px);
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .pill-item {
        min-width: fit-content;
    }
    
    .legend-card-glass {
        display: none; /* Hide on small screens or move to bottom */
    }
}

/* 
   --------------------------------------------------------------------------
   PUSH-PIN MARKERS (CUSTOM CSS FROM JS)
   -------------------------------------------------------------------------- 
*/

.pushpin-marker {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pushpin-marker:hover {
    transform: scale(1.2) translateY(-5px) rotate(-5deg);
    z-index: 1000 !important;
}

.modern-tooltip {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 10px 16px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.modern-tooltip::before { display: none !important; }

/* 
   --------------------------------------------------------------------------
   SDI CONDITION VARIANTS (Admin Map Compatibility)
   -------------------------------------------------------------------------- 
*/

.modern-tooltip.bagus { border-left: 5px solid #22c55e !important; color: #15803d !important; }
.modern-tooltip.sedang { border-left: 5px solid #eab308 !important; color: #a16207 !important; }
.modern-tooltip.ringan { border-left: 5px solid #f97316 !important; color: #c2410c !important; }
.modern-tooltip.berat { border-left: 5px solid #ef4444 !important; color: #b91c1c !important; }

.line-legend {
    width: 24px;
    height: 6px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.line-legend.bagus { background: #22c55e; }
.line-legend.sedang { background: #eab308; }
.line-legend.ringan { background: #f97316; }
.line-legend.berat { background: #ef4444; }

/* Marker Legend Dots */
.marker-legend {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.marker-legend.verified { background: #22c55e; }
.marker-legend.pending { background: #eab308; }
.marker-legend.rejected { background: #ef4444; }

/* Legacy Legend Card for Admin */
.legend-card {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 180px;
    border: 1px solid #e2e8f0;
}

.legend-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    margin: 10px 0 8px 0;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}


/* 
   --------------------------------------------------------------------------
   GEOJSON LAYER STYLING (Districts & Roads)
   -------------------------------------------------------------------------- 
*/

.district-poly {
    transition: fill-opacity 0.3s ease, stroke-width 0.3s ease;
    cursor: pointer;
}

.district-poly:hover {
    fill-opacity: 0.4 !important;
    stroke: white !important;
    stroke-width: 3px !important;
}

.map-tooltip {
    background: rgba(15, 23, 42, 0.9) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}