/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Container principal */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 120px);
    gap: 1rem;
    padding: 1rem;
}

/* Panneau de filtres */
.filters-panel {
    width: 300px;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.filters-panel h3 {
    margin-bottom: 1rem;
    color: #2a5298;
}

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

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-group select[multiple] {
    height: 120px;
    border: 1px solid #2a5298;
    background-color: #f0f4ff;
    color: #1e3c72;
    font-weight: 600;
    padding: 0.25rem;
    border-radius: 6px;
}

button {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

#apply-filters {
    background-color: #2a5298;
    color: white;
}

#apply-filters:hover {
    background-color: #1e3c72;
}

#reset-filters {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ddd;
}

#reset-filters:hover {
    background-color: #e9ecef;
}

/* Zone principale */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Indicateurs clés */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.kpi-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.kpi-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.kpi-card span {
    font-size: 2rem;
    font-weight: bold;
    color: #2a5298;
}

/* Carte */
.map-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#map-container {
    height: 500px;
    width: 100%;
}

/* Graphiques */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-container canvas {
    max-height: 300px;
}

/* Tableau de données */
.data-table-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table-section h3 {
    margin-bottom: 1rem;
    color: #2a5298;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .filters-panel {
        width: 100%;
        position: static;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
}

/* Popup styles */
.leaflet-popup-content {
    font-size: 0.9rem;
}

.popup-content h4 {
    margin-bottom: 0.5rem;
    color: #2a5298;
}

.popup-content p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.popup-content strong {
    color: #555;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}
