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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f0f0;
    color: #333;
}

.source-banner {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    font-size: 12px;
    color: #555;
}

.source-banner a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.source-banner a:hover {
    text-decoration: underline;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 22px;
    margin-bottom: 0;
    flex: 1;
}

.header p {
    font-size: 12px;
    opacity: 0.9;
    display: none;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-toggle {
    background: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    transition: all 0.2s;
}

.language-toggle:hover {
    background: #f0f0f0;
}

.language-toggle.active {
    background: #667eea;
    color: white;
}

.menu-toggle {
    background: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    display: none;
    z-index: 1001;
}

.menu-toggle:active {
    background: #f0f0f0;
}

.container {
    display: flex;
    height: calc(100vh - 70px);
    gap: 0;
}

.sidebar {
    width: 340px;
    background: white;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: #667eea;
    width: 0%;
    transition: width 0.2s;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 6px;
}

.filter-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    background: white;
}

.filter-option {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.filter-option label {
    cursor: pointer;
    font-size: 12px;
    flex: 1;
}

.filter-option input[type="checkbox"]:checked + label {
    font-weight: 600;
    color: #667eea;
}

.toggle-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: #f0f0f0;
}

.toggle-btn:active {
    background: #e8e8e8;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
}

.stats-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    color: #667eea;
    font-weight: 700;
}

.color-legend {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    font-size: 11px;
}

.color-legend h4 {
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #999;
    flex-shrink: 0;
}

.legend-text {
    font-size: 11px;
}

.reset-btn {
    width: 100%;
    padding: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 12px;
    font-size: 12px;
}

.reset-btn:active {
    background: #c82333;
}

.filter-checkbox-list {
    max-height: 140px;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.filter-checkbox-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-checkbox-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.filter-checkbox-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.filter-btn {
    flex: 1;
    padding: 5px;
    font-size: 11px;
    border: 1px solid #667eea;
    border-radius: 3px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.deselect {
    border-color: #dc3545;
    color: #dc3545;
}

.filter-btn.deselect:hover {
    background: #fff5f5;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
    
    .header p {
        display: block;
        position: absolute;
        bottom: -20px;
        font-size: 11px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .container {
        height: calc(100vh - 62px);
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 62px;
        bottom: 0;
        width: 85vw;
        max-width: 340px;
        transform: translateX(-100%);
        z-index: 1000;
        border-radius: 0;
        padding: 15px;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .map-container {
        width: 100%;
    }
    
    .filter-section {
        margin-bottom: 18px;
    }
    
    .filter-section h3 {
        font-size: 13px;
        margin-bottom: 9px;
    }
    
    .toggle-btn {
        padding: 9px;
        font-size: 11px;
        margin-bottom: 7px;
    }
    
    .stats-panel {
        padding: 10px;
        margin-top: 12px;
    }
    
    .stat-item {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .color-legend {
        padding: 10px;
        margin-top: 10px;
        font-size: 10px;
    }
    
    .color-legend h4 {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .legend-item {
        margin-bottom: 5px;
    }
    
    .reset-btn {
        padding: 9px;
        font-size: 11px;
        margin-top: 10px;
    }
    
    .filter-checkbox-list {
        max-height: 120px;
    }

    .language-toggle {
        padding: 5px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .menu-toggle {
        padding: 6px 10px;
        font-size: 18px;
    }
    
    .container {
        height: calc(100vh - 58px);
    }
    
    .sidebar {
        top: 58px;
    }
    
    .filter-section {
        margin-bottom: 15px;
    }
    
    .filter-section h3 {
        font-size: 12px;
    }
    
    .toggle-btn {
        padding: 8px;
        font-size: 10px;
    }

    .language-toggle {
        padding: 4px 6px;
        font-size: 10px;
    }
}
