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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

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

/* Header Styles */
.dashboard-header {
    background: linear-gradient(135deg, #1a2a36 0%, #1a2a36 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-section i {
    font-size: 1.5rem;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Dark Mode Styles */
.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode .dashboard-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-mode .control-panel {
    background: #2d2d2d;
    border-right: 1px solid #404040;
    color: #e0e0e0;
}

.dark-mode .panel-section {
    border-bottom: 1px solid #404040;
}

.dark-mode .panel-section h3 {
    color: #f0f0f0;
}

.dark-mode .form-group label {
    color: #d0d0d0;
}

.dark-mode .form-control {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
}

.dark-mode .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark-mode .btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.dark-mode .tool-instructions {
    background: #3a3a3a;
    border-left: 3px solid #3b82f6;
}

.dark-mode .tool-instructions p {
    color: #b0b0b0;
}

.dark-mode .map-container {
    background: #2a2a2a;
}

.dark-mode .legend-container {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .legend-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-mode .legend-item {
    color: #e0e0e0;
}

.dark-mode .legend-color {
    border: 1px solid #555;
}

.dark-mode #stats-content {
    background: #3a3a3a;
    border: 1px solid #555;
}

.dark-mode .stat-label {
    color: #b0b0b0;
}

.dark-mode .stat-value {
    color: #f0f0f0;
}

.dark-mode .loader-overlay {
    background: rgba(26, 26, 26, 0.95);
}

.dark-mode .loader-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .spinner {
    border: 4px solid #555;
    border-top: 4px solid #3b82f6;
}

.dark-mode #loader-text {
    color: #e0e0e0;
}

.dark-mode .progress-container {
    background: #555;
}

.dark-mode .progress-bar {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
}

/* Main Layout */
.dashboard-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Control Panel */
.control-panel {
    width: 320px;
    background: white;
    border-right: 1px solid #e0e6ed;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.panel-section {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f4f8;
}

.panel-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #1a2a36;
    box-shadow: 0 0 0 3px rgba(26, 42, 54, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #1a2a36 0%, #1a2a36 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(26, 42, 54, 0.3);
}

.tool-instructions {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #1a2a36;
}

.tool-instructions p {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: #f8f9fa;
}

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

/* Legend Styles */
.legend-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    max-width: 350px;
    z-index: 1000;
    overflow: hidden;
}

.legend-header {
    background: linear-gradient(135deg, #1a2a36 0%, #1a2a36 100%);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.legend-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.legend-content {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    margin-right: 0.5rem;
    border: 1px solid #ddd;
}

.legend-label {
    color: #2c3e50;
    font-weight: 500;
}

/* Statistics Panel */
#stats-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.875rem;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loader-content {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a2a36;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loader-text {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.progress-container {
    width: 200px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a2a36, #1a2a36);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Leaflet Control Customization */
.leaflet-control-container .leaflet-top.leaflet-right {
    top: 20px;
    right: 20px;
}

.filter-control {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-panel {
        width: 100%;
        height: auto;
        position: absolute;
        top: 0;
        left: -100%;
        z-index: 1001;
        transition: left 0.3s ease;
    }
    
    .control-panel.open {
        left: 0;
    }
    
    .legend-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 0.875rem;
}

/* Animations */
.panel-section {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.legend-container {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
