:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --success-color: #00b45d;
    --danger-color: #ff5c00;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --gray-color: #6b7280;
    --border-radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #ff5c00 0%, #00b45d 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Layout */
.container-fluid {
    padding: 0;
}

.row {
    margin: 0;
    min-height: 100vh;
}

/* Sidebar Modern */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    padding: 2rem 1.5rem;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success-color), var(--danger-color));
}

.sidebar h2 {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--danger-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.filter-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.filter-section h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section h5::before {
    content: '🔍';
    font-size: 1.2em;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-select {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: white;
}

.form-select:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Stats Section */
.stats-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.stats-section:hover {
    transform: translateY(-2px);
}

.stats-section h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-section h5::before {
    content: '📈';
    font-size: 1.2em;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.stats-item:hover {
    background: #f8fafc;
    border-radius: 6px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.stats-item:last-child {
    border-bottom: none;
}

.stats-value {
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, var(--success-color), var(--danger-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Map Container */
#map {
    height: 100vh;
    width: 100%;
    border-radius: 0;
    position: relative;
}

/* Modern Legend */
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
    transition: var(--transition);
}

.legend:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.legend h6 {
    margin: 0 0 12px 0;
    font-weight: 700;
    color: var(--success-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend h6::before {
    content: '🎨';
    font-size: 1.1em;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.legend-color {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.legend-color:hover {
    transform: scale(1.1);
}

/* Loading Spinner Modern */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 3px;
    margin-bottom: 1rem;
}

/* Custom Tooltip */
.custom-tooltip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

/* Icon Styles untuk Statistics */
.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.stats-item:hover {
    background: #f8fafc;
    border-radius: 6px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.stats-item:last-child {
    border-bottom: none;
}

.stats-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Icon colors */
.stats-item .fa-users { color: #6366f1; }
.stats-item .fa-shipping-fast { color: #10b981; }
.stats-item .fa-store { color: #ff5c00; }
.stats-item .fa-money-bill-wave { color: #06b6d4; }
.stats-item .fa-truck { color: #6b7280; }

/* Stat card icons */
.stat-card i {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Top kelurahan icons */
.top-kelurahan-list i {
    font-size: 0.8rem;
    opacity: 0.7;
}
/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        height: auto;
        max-height: 50vh;
    }
    
    #map {
        height: 50vh;
    }
    
    .legend {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .row {
        flex-direction: column;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar, .legend, .filter-section, .stats-section {
    animation: fadeIn 0.6s ease-out;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--success-color), var(--danger-color));
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--success-color), var(--danger-color));
}


/* Statistics Specific Styles */
.stat-card {
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-kelurahan-list {
    max-height: 200px;
    overflow-y: auto;
}

.top-kelurahan-list::-webkit-scrollbar {
    width: 4px;
}

.top-kelurahan-list::-webkit-scrollbar-thumb {
    background: var(--light-color);
    border-radius: 2px;
}

/* Alert Styles */
.alert {
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
}

/* Progress Bar Animation */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Badge Styles */
.badge {
    font-size: 0.7em;
    padding: 0.25em 0.5em;
}

/* Data Type Selector Styling */
#dataType {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
}

#dataType option {
    background: white;
    color: var(--dark-color);
}

/* Gradient Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
}