/* Reset et base styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Liens */
a {
    color: #0ea5e9;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #E9520E;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #374151;
    background: #f8fafc;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container principal */
.container {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;
    padding: 2rem 2rem;
    max-width: 1200px;
}

/* Header et logo */
.logo_kelpopulation {
    margin: 0 auto;
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: none;
}

.logo_kelpopulation img {
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.logo_kelpopulation img:hover {
    opacity: 0.85;
}

/* Titres */
h1 {
    font-size: 2.25rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 2.5rem 0 1.25rem;
    text-align: center;
    letter-spacing: -0.02em;
}

p {
    font-size: 1rem;
    text-align: center;
    color: #64748b;
    max-width: 540px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

/* Formulaire de recherche */
.form-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 9998;
}

.form-group.flex-grow-1 {
    flex: 1;
}

.form-group {
    margin-bottom: 0;
}

.autocomplete-container {
    position: relative;
    width: 100%;
    isolation: isolate;
}

/* Input de recherche */
.form-control {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: none;
    background: #ffffff;
}

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

.form-control::placeholder {
    color: #94a3b8;
}

/* Bouton de recherche */
.btn-green {
    background: #0ea5e9;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    color: white;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s ease;
    box-shadow: none;
    cursor: pointer;
}

.btn-green:hover {
    background: #2563eb;
    transform: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Tableau des résultats */
.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    color: #2c3e50;
}

.table td, .table th {
    padding: 1rem;
    border: none;
    vertical-align: middle;
    color: #2c3e50;
}

.thead-dark {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.thead-dark th {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.table tbody tr {
    transition: all 0.3s ease;
    color: #2c3e50;
}

.table tbody tr td {
    color: #2c3e50 !important;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Carte */
#map {
    height: 450px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#map2 {
    height: 450px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Autocompletion styles */
.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-suggestion {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: #f8fafc;
    color: #1e293b;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.suggestion-main {
    font-weight: 500;
    margin-bottom: 0.125rem;
    color: #1e293b;
}

.suggestion-info {
    font-size: 0.8rem;
    color: #64748b;
}

.loading {
    padding: 1rem 1.25rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #1e293b;
    color: white;
    margin-top: 4rem;
    border-radius: 0;
}

footer .container {
    background: transparent;
    box-shadow: none;
    padding: 3rem 4rem;
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Stats grid responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0ea5e9;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    display: block;
}

/* Cartes spécialisées */
.stat-card.ranking-card {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: white !important;
    border: none !important;
}

.stat-card.ranking-card * {
    color: white !important;
}

.stat-card.ranking-card .stat-value {
    color: white !important;
    font-size: 2.5rem;
}

.stat-card.ranking-card .stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

.ranking-detail {
    background: rgba(0, 0, 0, 0.3);
    color: white !important;
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cartes des communes voisines */
.neighbor-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    border: 2px solid #dee2e6;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.neighbor-card.neighbor-clickable {
    cursor: pointer;
}

.neighbor-card:hover {
    opacity: 1;
    border-color: #0ea5e9;
    transform: translateY(-3px);
}

.neighbor-clickable:hover {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.2);
}

.neighbor-card .stat-value {
    color: #6c757d;
    font-size: 1.8rem;
}

.neighbor-card .stat-label {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
}

.neighbor-detail {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9 !important;
    border-radius: 12px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.4rem;
    display: inline-block;
}

.neighbor-before {
    border-left: 4px solid #E9520E;
}

.neighbor-after {
    border-left: 4px solid #dc3545;
}

/* Cartes d'évolution */
.evolution-card.positive {
    background: linear-gradient(135deg, #E9520E, #c74409);
    color: white;
}

.evolution-card.negative {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.evolution-card.neutral {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.evolution-card .stat-value {
    color: white;
}

.evolution-card .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.evolution-detail {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border-radius: 15px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Animation de chargement */
.loading-stats {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Animation d'apparition des cartes avancées */
.advanced-stats-container {
    animation: slideInUp 0.6s ease-out;
}

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

/* Graphique de population */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    height: 400px;
}

.chart-title {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

#populationChart {
    max-height: 300px;
    width: 100% !important;
    height: 300px !important;
}

/* Search hero section */
.search-hero {
    background: transparent;
    border-radius: 0;
    padding: 2rem 0;
    margin: 1rem 0 2rem;
}

.search-title {
    color: #1e293b;
    font-weight: 600;
    font-size: 2rem;
    text-align: center;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.search-subtitle {
    color: #64748b;
    font-size: 1rem;
    text-align: center;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.results-section {
    /* margin-top: 3rem; */
    position: relative;
    z-index: 1;
}

.results-header {
    background: white;
    color: #2c3e50;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #E9520E;
    position: relative;
    overflow: hidden;
    transform: translateZ(-1px);
}

.results-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E9520E, #c74409);
}

.results-header h2 {
    margin: 0;
    color: #2c3e50;
    text-align: left;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-header h2 i {
    color: #E9520E;
    font-size: 1.5rem;
}

/* Animation loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive design */
@media (max-width: 992px) {
    .fact-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
    
    footer .col-md-4 {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
        background-attachment: fixed;
    }
    
    .container {
        margin: 0.5rem;
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .search-hero {
        /* padding: 1.5rem;
        margin: 1rem 0; */
    }
    
    .search-title {
        font-size: 1.8rem;
    }
    
    .search-subtitle {
        font-size: 1rem;
        /* margin-bottom: 1.5rem; */
    }
    
    .form-row {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
    }
    
    .logo_kelpopulation img {
        max-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .table td, .table th {
        padding: 0.75rem 0.5rem;
        min-width: 120px;
    }
    
    .results-header h2 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    #map {
        height: 300px;
        margin-top: 1rem;
    }
    
    /* Footer responsive */
    footer .container {
        padding: 2rem 1rem;
    }
    
    footer div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center !important;
        text-align: center;
    }
    
    footer .row {
        text-align: center;
    }
    
    footer .col-md-4 {
        margin-bottom: 2rem;
    }
    
    footer h4, footer h5 {
        font-size: 1.1rem !important;
    }
    
    footer p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* GEO content responsive */
    .geo-optimized-content {
        margin-top: 2rem !important;
    }
    
    .commune-faq, .essential-facts, .data-sources {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .fact-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .fact-card {
        padding: 1rem !important;
    }
    
    /* Contact page responsive */
    .contact-page {
        margin: 0.5rem auto !important;
        padding: 1rem !important;
    }
    
    .contact-form-container {
        padding: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .contact-info {
        padding: 1.5rem !important;
    }
    
    /* Legal pages responsive */
    .legal-page {
        margin: 0.5rem auto !important;
        padding: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 0.25rem;
        padding: 1rem;
    }
    
    .search-hero {
        /* padding: 1rem; */
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-subtitle {
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        /* Évite le zoom automatique sur iOS */
        font-size: max(1rem, 16px);
    }
    
    /* Suggestions autocomplete mobile */
    .suggestions-container {
        position: absolute !important;
        z-index: 1000 !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
    
    .suggestion-item {
        padding: 1rem !important;
        font-size: 1rem !important;
        border-bottom: 1px solid #eee !important;
        cursor: pointer !important;
        /* Zone tactile suffisante */
        min-height: 44px !important;
    }
    
    .btn-green {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .logo_kelpopulation img {
        max-width: 180px;
    }
    
    /* Table mobile optimization */
    .table thead {
        display: none;
    }
    
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    
    /* GEO content très petit écran */
    .commune-faq, .essential-facts, .data-sources {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .faq-item h3 {
        font-size: 1rem !important;
    }
    
    .fact-card h4 {
        font-size: 0.9rem !important;
    }
    
    /* Contact très petit écran */
    .contact-page {
        padding: 0.5rem !important;
    }
    
    .contact-form-container {
        padding: 1rem !important;
    }
    
    .contact-header h1 {
        font-size: 1.8rem !important;
    }
    
    .contact-header p {
        font-size: 1rem !important;
    }
    
    /* Legal pages très petit écran */
    .legal-page {
        padding: 1rem !important;
    }
    
    .legal-page h1 {
        font-size: 1.8rem !important;
    }
    
    .legal-page h2 {
        font-size: 1.3rem !important;
    }
    
    .table tr {
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        border-radius: 8px;
        padding: 1rem;
        background: white;
    }
    
    .table td {
        text-align: left;
        padding: 0.5rem 0;
        border: none;
        position: relative;
        padding-left: 50%;
    }
    
    .table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #0ea5e9;
    }
}

/* CSS déplacé depuis commune/index.html.twig */
.search-hero {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(2, 132, 199, 0.08));
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
}

.commune-search-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
}

.commune-search-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.commune-results-section {
    margin-top: 3rem;
}

.commune-results-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    margin-bottom: 0;
}

.commune-results-header h2 {
    margin: 0;
    color: white;
    text-align: left;
}

.commune-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.commune-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.commune-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0ea5e9;
    display: block;
}

.commune-stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commune-stat-positive {
    color: #28a745 !important;
}

.commune-stat-negative {
    color: #dc3545 !important;
}

.commune-results-header .location-info {
    font-size: 1rem;
    font-weight: 300;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* Classes dupliquées supprimées - utilisation des classes principales ci-dessous */

/* CSS déplacé depuis ranking/index.html.twig */
.ranking-hero {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(2, 132, 199, 0.08));
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.ranking-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
}

.ranking-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.ranking-stats {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ranking-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.ranking-table-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 1rem;
    font-weight: 600;
    display: grid;
    grid-template-columns: 60px 1fr 180px 180px 120px 100px;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.9rem;
}

.ranking-table-header > div:nth-child(5),
.ranking-table-header > div:nth-child(6) {
    text-align: right;
}

.ranking-row {
    display: grid;
    grid-template-columns: 60px 1fr 180px 180px 120px 100px;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ranking-dept {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-align: left;
}

.ranking-region {
    color: #6c757d;
    font-size: 0.85rem;
    text-align: left;
}

.dept-badge {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
    white-space: nowrap;
}

.dept-name {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Valeurs mises en évidence */
.ranking-value {
    text-align: right;
}

.ranking-secondary {
    text-align: right;
}

.ranking-highlight {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-align: right;
    display: inline-block;
    margin-left: auto;
}

.ranking-highlight small {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Styles spécifiques par type de classement */
.ranking-highlight {
    background: none;
    color: #1e293b !important;
    font-weight: 700;
}

.ranking-highlight small {
    color: #64748b;
}

.ranking-progression-value {
    color: #28a745 !important;
}

.ranking-altitude-value {
    color: #6f42c1 !important;
}

.ranking-micro-value {
    color: #fd7e14 !important;
}

.ranking-densite-faible-value {
    color: #20c997 !important;
}

.ranking-noms-value {
    color: #17a2b8 !important;
}

.ranking-geo-value {
    color: #007bff !important;
}

.ranking-row:hover {
    background: #f8f9fa;
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-position {
    background: #f1f5f9;
    color: #64748b;
    min-width: 2rem;
    height: 2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 0.75rem;
}

.ranking-position.top-1 { background: #fef3c7; color: #92400e; }
.ranking-position.top-2 { background: #f1f5f9; color: #475569; }
.ranking-position.top-3 { background: #fed7aa; color: #9a3412; }

.ranking-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.ranking-value {
    font-weight: 600;
    color: #0ea5e9;
    text-align: right;
    font-size: 0.85rem;
}

.ranking-secondary {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: right;
}

/* Pagination */
.pagination-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.pagination-item {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #0ea5e9;
    transition: all 0.3s ease;
}

.pagination-item:hover {
    background: #0ea5e9;
    color: white;
    text-decoration: none;
}

.pagination-item.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.pagination-item.disabled {
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-item.disabled:hover {
    background: transparent;
    color: #6c757d;
}

.pagination-info {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Navigation breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.breadcrumb a {
    color: #0ea5e9;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #E9520E;
    text-decoration: underline;
}

/* Responsive ranking */
@media (max-width: 768px) {
    .ranking-table-header,
    .ranking-row {
        grid-template-columns: 45px 1fr auto;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .ranking-table-header > div:nth-child(3),
    .ranking-table-header > div:nth-child(4),
    .ranking-dept,
    .ranking-region {
        display: none;
    }

    .ranking-secondary {
        display: none;
    }

    .ranking-highlight {
        font-size: 0.95rem;
        padding: 0.3rem 0.5rem;
    }

    .ranking-position {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.9rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pagination-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .ranking-hero {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
}

/* Classes pour remplacer les styles inline */
.evolution-positive {
    color: #28a745;
}

.evolution-negative {
    color: #dc3545;
}

.evolution-neutral {
    color: #6c757d;
}

.ranking-progression-value {
    color: #28a745;
}

.other-rankings-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.other-rankings-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
}

.other-rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ranking-link {
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    color: white;
    display: block;
}

.ranking-link:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ranking-link.population {
    background: #0ea5e9;
    color: white;
}

.ranking-link.superficie {
    background: #E9520E;
    color: white;
}

.ranking-link.densite {
    background: #ffc107;
    color: #2c3e50;
}

.ranking-link.progression {
    background: #17a2b8;
    color: white;
}

.ranking-link.altitude {
    background: #6c757d;
    color: white;
}

.ranking-link.micro {
    background: #e91e63;
    color: white;
}

.ranking-link.densite-faible {
    background: #c74409;
    color: white;
}

.ranking-link.noms {
    background: #9c27b0;
    color: white;
}

.ranking-link.extremes {
    background: #00bcd4;
    color: white;
}

.ranking-link.departements {
    background: #E9520E;
    color: white;
}

.ranking-link.regions {
    background: #3f51b5;
    color: white;
}

/* Styles pour classement par département/région */
.ranking-departements,
.ranking-regions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.departement-section,
.region-section {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.departement-title,
.region-title {
    color: #0ea5e9;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0ea5e9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.departement-code {
    background: #E9520E;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.departement-communes .ranking-row,
.region-communes .ranking-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.departement-communes .ranking-row:hover,
.region-communes .ranking-row:hover {
    background: #e9ecef;
}

.departement-communes .ranking-position,
.region-communes .ranking-position {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
    margin-right: 0.75rem;
}

.departement-communes .ranking-name,
.region-communes .ranking-name {
    flex: 1;
    font-size: 0.95rem;
}

.departement-communes .ranking-value,
.region-communes .ranking-value {
    font-size: 0.85rem;
    color: #6c757d;
}

.ranking-link:hover {
    color: white;
}

.ranking-link.densite:hover {
    color: #2c3e50;
}

/* Classes pour commune/index.html.twig */
.error-message {
    color: red;
}

.homepage-rankings {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 3rem 0;
}

.homepage-rankings-title {
    text-align: center;
    color: #1e293b;
    margin-bottom: 2rem;
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ranking-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ranking-section:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ranking-title {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0ea5e9;
    text-align: center;
}

.ranking-title i {
    margin-right: 0.5rem;
}

.ranking-list {
    margin-bottom: 1.25rem;
}

/* Section large sur 2 colonnes */
.ranking-section-wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .ranking-section-wide {
        grid-column: span 1;
    }
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0;
    margin-bottom: 0;
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
}

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

.ranking-item:hover {
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}

.ranking-position {
    background: #0ea5e9;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.ranking-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-name {
    font-weight: 600;
    color: #2c3e50;
}

.ranking-value {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.ranking-more {
    display: inline-block;
    text-align: left;
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0;
    border-radius: 0;
    transition: color 0.15s ease;
}

.ranking-more:hover {
    background: transparent;
    color: #E9520E;
    text-decoration: underline;
}

/* Custom scrollbar pour les listes de classement */
.ranking-list::-webkit-scrollbar {
    width: 4px;
}

.ranking-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 4px;
}

.ranking-list::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.loading-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 1rem;
}

.ranking-evolution-positive {
    color: #28a745;
}

.commune-header-code {
    font-weight: 400;
    color: white;
    font-size: 0.8em;
}

.commune-header-location {
    font-size: 1rem;
    font-weight: 300;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.share-section {
    margin-top: 1rem;
}

.share-button {
    background-color: #0ea5e9;
    color: white;
    border: 1px solid #0ea5e9;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.copy-feedback {
    color: white;
    margin-left: 10px;
    display: none;
    font-weight: bold;
}

.evolution-na {
    color: #6c757d;
}

.advanced-stats-hidden {
    display: none;
}

.loading-stats {
    text-align: center;
    margin: 2rem 0;
    display: none;
}

.loading-spinner {
    font-size: 2rem;
    color: #0ea5e9;
}

.loading-text {
    margin-top: 1rem;
    color: #6c757d;
}

.hidden-coordinates {
    display: none;
}

.geo-optimized-content {
    margin-top: 3rem;
}

.commune-faq {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.commune-faq-title {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-question {
    color: #0ea5e9;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.faq-answer {
    margin-bottom: 0;
}

.essential-facts {
    background: white;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.essential-facts-title {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.fact-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

.fact-card-title {
    color: #0ea5e9;
    margin-bottom: 0.5rem;
}

.fact-card-content {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.fact-card-content-normal {
    margin: 0;
}

.data-sources {
    background: #fef7f4;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #E9520E;
}

.data-sources-title {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.data-sources-intro {
    margin-bottom: 0.5rem;
}

.data-sources-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.data-sources-footer {
    margin-top: 1rem;
    margin-bottom: 0;
    font-style: italic;
    color: #6c757d;
}

/* Responsive pour les listes Top homepage */
@media (max-width: 768px) {
    .rankings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .homepage-rankings {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .ranking-section {
        padding: 1rem;
    }

    .ranking-list {
        max-height: 250px;
    }

    .ranking-item {
        padding: 0.4rem 0.6rem;
    }

    .ranking-position {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.8rem;
        margin-right: 0.8rem;
    }
}

/* Cartes d'exploration géographique */
.geographic-exploration {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.geographic-exploration h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.geo-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.geo-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: #1e293b !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.geo-card:hover {
    transform: none;
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    color: #1e293b !important;
    text-decoration: none;
}

.geo-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #0ea5e9;
}

.geo-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.geo-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b !important;
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .geo-cards-grid {
        grid-template-columns: 1fr;
    }

    .geo-card {
        padding: 1.25rem;
    }

    .geo-card i {
        font-size: 1.75rem;
    }
}