/* ==========================================================================
   MODAL DÉPARTEMENT Premium
   ========================================================================== */


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 64, 175, 0.4);
    backdrop-filter: blur(8px);
    animation: modalFadeIn var(--transition-base);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    margin: 3% auto;
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn var(--transition-slow);
    position: relative;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-green), var(--depanneo-orange));
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 3px solid var(--gray-200);
}

.modal-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--depanneo-blue-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.close {
    color: var(--gray-400);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-base);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.close:hover {
    color: var(--depanneo-red);
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.1) rotate(90deg);
}

.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.dept-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.dept-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-blue-primary));
    transform: scaleX(0);
    transition: var(--transition-base);
}

.dept-stat-card:hover::before {
    transform: scaleX(1);
}

.dept-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.dept-stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--depanneo-blue-primary);
    margin-bottom: var(--space-xs);
}

.dept-stat-label {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==========================================================================
   RECHERCHE Premium
   ========================================================================== */

.search-box {
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-xl) var(--space-xl);
    font-size: 1.1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: var(--transition-base);
    background: white;
    box-shadow: var(--shadow-md);
    font-weight: 500;
}

.search-input:focus {
    outline: none;
    border-color: var(--depanneo-blue-secondary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), var(--shadow-lg);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--gray-400);
    font-weight: 500;
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--depanneo-blue-primary), var(--depanneo-blue-secondary));
    color: white;
    border: none;
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-base);
    box-shadow: var(--shadow-md);
    font-size: 1rem;
}

.search-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-50%) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.results {
    margin-top: var(--space-2xl);
    display: none;
}

.commune-result {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.commune-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-green));
}

.commune-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.info-item {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--depanneo-blue-secondary);
    transform: scaleY(0);
    transition: var(--transition-base);
}

.info-item:hover::before {
    transform: scaleY(1);
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.info-label {
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1.4rem;
    color: var(--gray-800);
    font-weight: 700;
    line-height: 1.2;
}

.ranking-info {
    background: linear-gradient(135deg, var(--depanneo-blue-primary), var(--depanneo-blue-secondary));
    color: white;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.ranking-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.ranking-info .info-value {
    color: white;
    font-size: 1.6rem;
}

.danger-level {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: var(--space-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.danger-level:hover {
    transform: scale(1.05);
}

.details-btn {
    background: linear-gradient(135deg, var(--depanneo-blue-primary), var(--depanneo-blue-secondary));
    color: white;
    border: none;
    padding: var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    margin-top: var(--space-xl);
    transition: var(--transition-base);
    box-shadow: var(--shadow-md);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.details-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition-base);
}

.details-btn:hover::before {
    left: 100%;
}

.details-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   CLASSEMENTS Premium
   ========================================================================== */

.classement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.classement-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
}

.classement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-blue-primary));
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-base);
    border-radius: var(--radius-lg);
    margin: 0 calc(-1 * var(--space-sm));
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.ranking-item:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.ranking-position {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    margin-right: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.ranking-position.danger {
    background: linear-gradient(135deg, var(--depanneo-red), #ef4444);
}

.ranking-position.safe {
    background: linear-gradient(135deg, var(--depanneo-green), #10b981);
}

.ranking-item:hover .ranking-position {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.ranking-name {
    flex: 1;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
}

.ranking-value {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
}

.ranking-value.danger { color: var(--depanneo-red); }
.ranking-value.safe { color: var(--depanneo-green); }

/* ==========================================================================
   CHARTS & GRAPHS Premium
   ========================================================================== */

.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    margin: var(--space-2xl) 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-green), var(--depanneo-orange));
}

/* ==========================================================================
   UTILITIES Premium
   ========================================================================== */

.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: var(--depanneo-red);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    margin: var(--space-lg) 0;
    border-left: 4px solid var(--depanneo-red);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    position: relative;
}

.error::before {
    content: '⚠️';
    font-size: 1.2rem;
    margin-right: var(--space-sm);
}

/* ==========================================================================
   FOOTER Premium
   ========================================================================== */

.footer {
    text-align: center;
    margin-top: var(--space-2xl);
    padding: var(--space-2xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-radius: var(--radius-2xl);
    color: var(--gray-500);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-green), var(--depanneo-orange), var(--depanneo-red));
}

.footer strong {
    color: var(--depanneo-blue-primary);
    font-weight: 700;
}

.footer p {
    line-height: 1.6;
}

.footer p:first-child {
    margin-bottom: var(--space-sm);
}

/* ==========================================================================
   RESPONSIVE PREMIUM - Niveau 2
   ========================================================================== */

@media (max-width: 640px) {
    .search-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .classement-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .commune-info {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: var(--space-xl);
    }
    
    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }
    
    .ranking-position {
        margin-right: 0;
        margin-bottom: var(--space-sm);
    }
}

/* ==========================================================================
   PERFORMANCE & ACCESSIBILITY
   ========================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--gray-800);
    }
    
    .stat-card:hover {
        border: 2px solid var(--depanneo-blue-primary);
    }
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--depanneo-blue-secondary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header-brand,
    .depanneo-badge,
    .search-box,
    .details-btn {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}/* ==========================================================================
   STYLE.CSS - Statistiques Cambriolages France - Design Depanneo Premium
   ========================================================================== */

:root {
    /* Couleurs Depanneo officielles */
    --depanneo-blue-primary: #1e3a8a;
    --depanneo-blue-secondary: #3b82f6;
    --depanneo-blue-light: #60a5fa;
    --depanneo-orange: #f59e0b;
    --depanneo-red: #dc2626;
    --depanneo-green: #059669;
    
    /* Couleurs système */
    --color-success: #10b981;
    --color-warning: #f59e0b;  
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 25%, #0369a1 50%, var(--depanneo-blue-primary) 75%, #1e3a8a 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ==========================================================================
   CARDS & LAYOUT
   ========================================================================== */

.card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-blue-primary));
    opacity: 0;
    transition: var(--transition-base);
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2xl);
}

/* ==========================================================================
   HEADER avec Logo Depanneo
   ========================================================================== */

.header {
    text-align: center;
    background: linear-gradient(135deg, var(--depanneo-blue-primary), #0369a1);
    color: white;
    margin-bottom: var(--space-2xl);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1.5" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.8" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-brand {
    position: absolute;
    top: var(--space-lg);
    left: var(--space-lg);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    opacity: 0.9;
    transition: var(--transition-base);
}

.header-brand:hover {
    opacity: 1;
    transform: scale(1.02);
}

.depanneo-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-content {
    position: relative;
    z-index: 5;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.header p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.95;
    font-weight: 500;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.depanneo-badge {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-base);
}

.depanneo-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ==========================================================================
   STATS GRID Premium
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
    border: 1px solid rgba(59, 130, 246, 0.08);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-blue-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-base);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--depanneo-blue-secondary);
}

.stat-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: var(--transition-base);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-number {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--depanneo-red);
    margin-bottom: var(--space-sm);  
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: var(--transition-base);
    line-height: 1.1;
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
}

.stat-label {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.stat-evolution {
    font-size: 0.875rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 12px;
    margin-top: var(--space-xs);
    display: inline-block;
    transition: var(--transition-base);
}

.stat-evolution.positive {
    color: var(--depanneo-red);
    background: rgba(220, 38, 38, 0.1);
}

.stat-evolution.negative {
    color: var(--depanneo-green);
    background: rgba(5, 150, 105, 0.1);
}

.stat-evolution.neutral {
    color: var(--gray-500);
    background: rgba(107, 114, 128, 0.1);
}

.stat-card:hover .stat-evolution {
    transform: scale(1.05);
}

/* ==========================================================================
   CARTE DE FRANCE avec D3.js Premium
   ========================================================================== */

.france-map-container {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    min-height: 650px;
    overflow: hidden;
}

.france-map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--depanneo-blue-secondary), var(--depanneo-green), var(--depanneo-orange), var(--depanneo-red));
}

.france-map-container h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: var(--gray-800);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

#france-map svg {
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    transition: var(--transition-base);
}

#france-map:hover svg {
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.2));
}

.departement {
    fill: var(--gray-200);
    stroke: #ffffff;
    stroke-width: 1;
    cursor: pointer;
    transition: var(--transition-fast);
}

.departement:hover {
    stroke: var(--depanneo-blue-primary);
    stroke-width: 2.5;
    filter: brightness(0.9);
    transform: scale(1.01);
    transform-origin: center;
}

/* Couleurs par niveau de risque - Style Depanneo Premium */
.risk-very-low { fill: var(--depanneo-green); }
.risk-low { fill: #22c55e; }
.risk-medium { fill: #84cc16; }
.risk-high { fill: var(--depanneo-orange); }
.risk-very-high { fill: var(--depanneo-red); }

/* Tooltip Premium */
.tooltip {
    position: absolute;
    text-align: center;
    padding: var(--space-lg) var(--space-xl);
    font-size: 14px;
    font-weight: 600;
    background: rgba(30, 64, 175, 0.95);
    color: white;
    border-radius: var(--radius-lg);
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(30, 64, 175, 0.95) transparent transparent transparent;
}

/* Légende Premium */
.map-legend {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
    padding: var(--space-xl);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    cursor: pointer;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.legend-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* ==========================================================================
   LOADING STATES Premium
   ========================================================================== */

.loading {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-500);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--depanneo-blue-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

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

/* Skeleton loading pour les cards */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   RESPONSIVE PREMIUM
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        padding: var(--space-lg);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }
    
    .header {
        min-height: 180px;
        padding: var(--space-lg);
    }
    
    .header-brand {
        position: static;
        justify-content: center;
        margin-bottom: var(--space-lg);
    }
    
    .depanneo-badge {
        position: static;
        display: inline-block;
        margin-top: var(--space-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .stat-card {
        padding: var(--space-xl);
    }
    
    .card {
        padding: var(--space-xl);
        margin-bottom: var(--space-lg);
    }
    
    .france-map-container {
        padding: var(--space-xl);
        min-height: 500px;
    }
    
    .map-legend {
        gap: var(--space-md);
        padding: var(--space-lg);
    }
    
    .legend-item {
        font-size: 0.8rem;
        padding: var(--space-sm) var(--space-md);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        gap: var(--space-md);
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .map-legend {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   CARTE DE FRANCE avec D3.js
   ========================================================================== */

.france-map-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    min-height: 600px;
}

.france-map-container h2 {
    text-align: center;
    margin-bottom: 32px;
    color: #1f2937;
    font-size: 2.2rem;
    font-weight: 700;
}

#france-map svg {
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

.departement {
    fill: #e5e7eb;
    stroke: #ffffff;
    stroke-width: 0.8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.departement:hover {
    stroke: #1e40af;
    stroke-width: 2;
    filter: brightness(0.9);
}

/* Couleurs par niveau de risque - Style Depanneo */
.risk-very-low { fill: #059669; }
.risk-low { fill: #10b981; }
.risk-medium { fill: #f59e0b; }
.risk-high { fill: #ef4444; }
.risk-very-high { fill: #dc2626; }

/* Tooltip */
.tooltip {
    position: absolute;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(30, 64, 175, 0.95);
    color: white;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

/* Légende */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

/* ==========================================================================
   MODAL DÉPARTEMENT
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 64, 175, 0.4);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 3% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 3px solid #e5e7eb;
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e40af;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.close {
    color: #9ca3af;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.dept-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.dept-stat-card:hover {
    transform: translateY(-2px);
}

.dept-stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 4px;
}

.dept-stat-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==========================================================================
   RECHERCHE
   ========================================================================== */

.search-box {
    max-width: 600px;
    margin: 0 auto 32px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.results {
    margin-top: 32px;
    display: none;
}

.commune-result {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.commune-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
}

.info-label {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.4rem;
    color: #1f2937;
    font-weight: 700;
}

.ranking-info {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
}

.ranking-info .info-value {
    color: white;
    font-size: 1.6rem;
}

.danger-level {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.details-btn {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
}

.details-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

/* ==========================================================================
   CLASSEMENTS
   ========================================================================== */

.classement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.classement-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.3s ease;
}

.ranking-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    margin: 0 -8px;
    padding: 16px 8px;
}

.ranking-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    margin-right: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ranking-position.danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.ranking-position.safe {
    background: linear-gradient(135deg, #059669, #10b981);
}

.ranking-name {
    flex: 1;
    font-weight: 600;
    color: #1f2937;
}

.ranking-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.ranking-value.danger { color: #dc2626; }
.ranking-value.safe { color: #059669; }

/* ==========================================================================
   CHARTS & GRAPHS
   ========================================================================== */

.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    border-left: 4px solid #dc2626;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.loading {
    text-align: center;
    padding: 48px;
    color: #6b7280;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    text-align: center;
    margin-top: 48px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-radius: 16px;
    color: #6b7280;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.footer strong {
    color: #1e40af;
    font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }
    
    .depanneo-badge {
        position: static;
        display: inline-block;
        margin-top: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .commune-info {
        grid-template-columns: 1fr;
    }
    
    .search-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 12px;
    }
    
    .classement-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 24px;
    }
    
    .map-legend {
        gap: 12px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   STYLES AJOUTÉS pour les redirections départements
   ========================================================================== */

/* Styles pour les éléments cliquables - départements */
.clickable-dept {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.clickable-dept:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.clickable-dept:hover .ranking-name {
    color: #3b82f6;
    font-weight: 700;
}

.clickable-dept::after {
    content: '→';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: bold;
    color: #3b82f6;
    font-size: 1.2rem;
}

.clickable-dept:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

/* Styles pour les communes cliquables */
.clickable-commune {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.clickable-commune:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.clickable-commune:hover .ranking-name strong {
    color: #3b82f6;
}

.clickable-commune::after {
    content: '🏛️';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.clickable-commune:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

/* Amélioration des tooltips de carte */
.tooltip {
    position: absolute;
    text-align: left;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(30, 64, 175, 0.95);
    color: white;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 220px;
    max-width: 300px;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(30, 64, 175, 0.95) transparent transparent transparent;
}

/* Style pour les départements sur la carte */
.departement {
    fill: #e5e7eb;
    stroke: #ffffff;
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.departement:hover {
    stroke: #3b82f6;
    stroke-width: 3;
    filter: brightness(0.9) drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3));
    transform: scale(1.02);
    transform-origin: center;
}

/* Améliorations pour les liens dans les résultats de recherche */
.commune-result a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.commune-result a:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

/* Animations pour les cartes de statistiques cliquables */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Amélioration des boutons de détails */
.details-btn {
    position: relative;
    overflow: hidden;
}

.details-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: all 0.6s ease;
}

.details-btn:hover::before {
    left: 100%;
}

/* Messages d'information pour les redirections */
.redirect-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.redirect-info strong {
    color: #3b82f6;
}

/* Responsive pour les éléments cliquables */
@media (max-width: 768px) {
    .clickable-dept:hover,
    .clickable-commune:hover {
        transform: none;
    }
    
    .clickable-dept::after,
    .clickable-commune::after {
        display: none;
    }
    
    .tooltip {
        min-width: 180px;
        font-size: 12px;
        padding: 12px 16px;
    }
}

/* Animation de chargement améliorée */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    margin: 0 auto 16px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Focus visible pour l'accessibilité */
.clickable-dept:focus-visible,
.clickable-commune:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* États actifs pour mobile */
.clickable-dept:active,
.clickable-commune:active {
    transform: scale(0.98);
}

/* Amélioration de la légende de carte */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.2);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.legend-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

/* Messages d'état améliorés */
.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    border-left: 4px solid #dc2626;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    position: relative;
}

.error::before {
    content: '⚠️';
    font-size: 1.2rem;
    margin-right: 8px;
}

/* Breadcrumb amélioré */
.breadcrumb {
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    background: rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

/* Bouton retour amélioré */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* AJOUTER ces styles CSS */
.header-compact {
    min-height: 120px !important;
    padding: 20px 30px !important;
}

.header-compact .header-content h1 {
    font-size: 2.5rem !important;
    margin-bottom: 8px !important;
}

.header-compact .header-content p {
    font-size: 1rem !important;
}

.header-compact .header-brand {
    top: 15px !important;
    left: 20px !important;
}

.header-compact .header-brand span {
    font-size: 0.8rem !important;
}

.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stats-grid-compact .stat-card {
    padding: 20px;
}

.stats-grid-compact .stat-number {
    font-size: 2.2rem;
}

/* Supprimer le badge version pro */
.depanneo-badge {
    display: none !important;
}

/* AJOUTER ces styles CSS pour une meilleure légende */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    min-width: 140px;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.2);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

/* Responsive pour la légende */
@media (max-width: 768px) {
    .map-legend {
        gap: 12px;
        padding: 16px;
    }
    
    .legend-item {
        font-size: 0.85rem;
        padding: 8px 12px;
        min-width: 120px;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
}
    .breadcrumb {
            margin-bottom: 20px;
            color: #718096;
            font-size: 0.9rem;
        }
        .breadcrumb a {
            color: #667eea;
            text-decoration: none;
        }
        .breadcrumb a:hover {
            text-decoration: underline;
        }
        .dept-header {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            text-align: center;
            padding: 40px 30px;
            border-radius: 20px;
            margin-bottom: 30px;
        }
        .dept-header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            font-weight: 800;
        }
        .dept-header p {
            font-size: 1.1rem;
            opacity: 0.9;
        }
        .back-btn {
            display: inline-block;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 10px 20px;
            border-radius: 8px;
            text-decoration: none;
            margin-bottom: 20px;
            font-weight: 600;
            transition: background 0.3s;
        }
        .back-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }
        .section-title {
            font-size: 1.5rem;
            color: #2d3748;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .commune-list {
            display: grid;
            gap: 15px;
        }
        .commune-item {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: between;
            align-items: center;
            transition: transform 0.2s;
        }
        .commune-item:hover {
            transform: translateY(-2px);
        }
        .commune-info {
            flex: 1;
        }
        .commune-name {
            font-weight: 600;
            color: #2d3748;
            font-size: 1.1rem;
            margin-bottom: 5px;
        }
        .commune-details {
            color: #718096;
            font-size: 0.9rem;
        }
        .commune-stats {
            text-align: right;
        }
        .commune-taux {
            font-size: 1.3rem;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .commune-taux.danger { color: #e53e3e; }
        .commune-taux.safe { color: #38a169; }
        .commune-nb {
            color: #718096;
            font-size: 0.9rem;
        }
        .chart-section {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 30px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        <style>
    /* Ajoutez ces styles pour les cartes de classement */
    .classement-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .classement-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .classement-card h3 {
        margin-bottom: 20px;
        text-align: center;
        color: #2d3748;
    }

    .commune-item {
        background: white;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        transition: transform 0.2s;
    }

    .commune-item:hover {
        transform: translateY(-2px);
    }

    .commune-info {
        flex: 1;
    }

    .commune-name {
        font-weight: 600;
        color: #2d3748;
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    .commune-details {
        color: #718096;
        font-size: 0.9rem;
    }

    .commune-stats {
        text-align: right;
    }

    .commune-taux {
        font-size: 1.3rem;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .commune-taux.danger {
        color: #e53e3e;
    }

    .commune-taux.safe {
        color: #38a169;
    }

    .commune-nb {
        color: #718096;
        font-size: 0.9rem;
    }

    .stats-grid-compact {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
        justify-content: space-between;
        margin-bottom: 20px;
    }

    .stat-card {
        flex: 1;
        background: white;
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        text-align: center;
        min-width: 0; /* Permet aux cartes de se rétrécir correctement */
    }

    .stat-icon {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .stat-number {
        font-size: 1.5rem;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .stat-label {
        font-size: 0.9rem;
        color: #718096;
    }

    .stat-evolution {
        font-size: 0.8rem;
        color: #4b5563;
    }

    .analysis-complete-section {
    margin-top: 40px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.revelations-section {
    margin-bottom: 50px;
}

.revelation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.revelation-card {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.revelation-card:hover {
    transform: translateY(-5px);
}

.revelation-card.red {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), #ffffff);
    border: 2px solid rgba(220, 38, 38, 0.2);
}

.revelation-card.green {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05), #ffffff);
    border: 2px solid rgba(5, 150, 105, 0.2);
}

.revelation-card.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), #ffffff);
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.revelation-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.revelation-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.revelation-stat {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.revelation-card.red .revelation-stat { color: #dc2626; }
.revelation-card.green .revelation-stat { color: #059669; }
.revelation-card.orange .revelation-stat { color: #f59e0b; }

.revelation-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4b5563;
}

.data-analysis-section {
    margin-bottom: 50px;
}

.analysis-block {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border-left: 4px solid #3b82f6;
}

.champions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.champion-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.champion-dept {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.champion-evolution {
    font-size: 1.4rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 5px;
}

.champion-detail {
    font-size: 0.9rem;
    color: #6b7280;
}

.departement-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 20px 0;
}

.dept-list {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.critical-list {
    border-left: 4px solid #7f1d1d;
}

.safe-list {
    border-left: 4px solid #059669;
}

.dept-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.dept-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.dept-tag.critical {
    background: rgba(127, 29, 29, 0.1);
    color: #7f1d1d;
    border: 1px solid rgba(127, 29, 29, 0.2);
}

.dept-tag.safe {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.insight-box {
    margin-top: 20px;
}

.concentration-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.concentration-item {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.concentration-item.critical {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.1), #ffffff);
    border: 2px solid rgba(127, 29, 29, 0.3);
}

.concentration-item.high {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), #ffffff);
    border: 2px solid rgba(220, 38, 38, 0.3);
}

.concentration-item.safe {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), #ffffff);
    border: 2px solid rgba(5, 150, 105, 0.3);
}

.concentration-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.concentration-item.critical .concentration-number { color: #7f1d1d; }
.concentration-item.high .concentration-number { color: #dc2626; }
.concentration-item.safe .concentration-number { color: #059669; }

.concentration-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.concentration-detail {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.extreme-communes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.extreme-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    border-top: 4px solid #f59e0b;
}

.extreme-rate {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 10px;
}

.extreme-info {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.context-section {
    margin-bottom: 40px;
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.context-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #e5e7eb;
}

.context-item h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.faq-section-simple {
    margin-bottom: 40px;
}

.faq-simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.faq-simple-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #3b82f6;
}

.faq-simple-question {
    color: #1e40af;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.faq-simple-answer {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.conclusion-section {
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .revelation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .champions-grid {
        grid-template-columns: 1fr;
    }
    
    .departement-lists {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .concentration-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .extreme-communes {
        grid-template-columns: 1fr;
    }
    
    .context-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-simple-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .revelation-card {
        padding: 20px;
    }
    
    .revelation-stat {
        font-size: 2rem;
    }
    
    .concentration-number {
        font-size: 2rem;
    }
    
    .extreme-rate {
        font-size: 1.6rem;
    }
}


.close-search-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-search-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Styles pour les villes (sans clic) */
.ville-item {
    cursor: default !important;
}

.ville-item:hover {
    background-color: rgba(59, 130, 246, 0.03) !important;
    transform: none !important;
    transition: background-color 0.2s ease;
}

.ville-item::after {
    display: none !important;


/* CSS pour le bloc des villes Depanneo */
.depanneo-cities-section {
    margin: 50px 0 40px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.cities-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #3b82f6;
}

.depanneo-logo-cities {
    height: 50px;
    margin-bottom: 20px;
}

.cities-title {
    font-size: 2.2rem;
    color: #1f2937;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.cities-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.city-category {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
    text-align: center;
}

.cities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.city-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.city-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.city-link:hover::before {
    left: 100%;
}

.city-link:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.city-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    transition: color 0.3s ease;
}

.city-link:hover .city-name {
    color: white;
}

.city-info {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s ease;
}

.city-link:hover .city-info {
    color: #e5e7eb;
}

.cities-cta {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
    margin-top: 20px;
}

.cta-text {
    font-size: 1.1rem;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.highlight-text {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.cta-button {
    display: inline-block;
    background: white;
    color: #3b82f6;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .cities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cities-title {
        font-size: 1.8rem;
    }
    
    .cities-subtitle {
        font-size: 1rem;
    }
    
    .city-category {
        padding: 20px;
    }
    
    .city-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cities-cta {
        padding: 20px;
    }
    
    .cta-text {
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .depanneo-cities-section {
        margin: 30px 0;
        padding: 20px;
    }
    
    .cities-title {
        font-size: 1.5rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .city-name {
        font-size: 0.95rem;
    }
    
    .city-info {
        font-size: 0.8rem;
    }
}

