/**
 * ================================================================
 * ObSAT.org - Feuille de style principale
 * Observatoire des systèmes alimentaires territorialisés
 * ================================================================
 */

/* =================================================================
   Polices Google Fonts - À inclure dans le HTML
   ================================================================= */
/* 
Dans chaque page HTML, ajoutez dans le <head> :
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
*/

/* =================================================================
   Styles de base
   ================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #eef4f1;
    color: #002932;
    line-height: 1.6;
}

/* Typographie */
h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
}

/* =================================================================
   Header et Navigation
   ================================================================= */
.header {
    background-color: #eef4f1;
    position: sticky;
    top: 0;
    z-index: 5000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: #002932;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #002932;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: #c5d9d2;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #f5faf8;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 41, 50, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 280px;
    border: 1px solid #c5d9d2;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #002932;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #c5d9d2;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #002932;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* =================================================================
   Container et grilles
   ================================================================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.observatoire-container {
    padding-top: 20px;
}

.grid-2-thirds {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 80px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    margin-bottom: 60px;
}

.grid-3-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: start;
}

.grid-1-3 {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: start;
}

/* =================================================================
   Breadcrumb
   ================================================================= */
.breadcrumb {
    margin-bottom: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #002932;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #999;
}

/* =================================================================
   Hero Section
   ================================================================= */
.hero {
    text-align: left;
    margin-bottom: 60px;
}

.observatoire-hero {
    margin-bottom: 50px;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: #002932;
    line-height: 1.2;
}

.hero-subtitle, .hero-tagline {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
}
.hero-tagline:empty { display: none; }

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 2rem;
}

.hero-stat-card {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #002932;
    margin-bottom: 0.5rem;
}
#heroCurrentYear {
    font-size: 1rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* =================================================================
   Cards principales
   ================================================================= */
.card {
    background: #c5d9d2;
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 41, 50, 0.1);
}

.card:nth-child(1) {
    background: #c5d9d2;
}

.card:nth-child(2) {
    background: #f2dcb6;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 41, 50, 0.15);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #002932;
}

.card p {
    margin-bottom: 1.5rem;
    color: #002932;
}

.card .subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* =================================================================
   Boutons
   ================================================================= */
.btn {
    display: inline-block;
    background-color: #002932;
    color: #f5faf8;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #002932;
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: #002932;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: #002932;
    border: 2px solid #002932;
}

.btn-outline:hover {
    background-color: #002932;
    color: #f5faf8;
}

.btn-reset {
    width: 100%;
    padding: 12px 24px;
    background-color: #002932;
    color: #f5faf8;
    border: 2px solid #002932;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: transparent;
    color: #002932;
    transform: translateY(-2px);
}

/* =================================================================
   Sections spécialisées
   ================================================================= */
.sat-section {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 60px;
    border: 1px solid #c5d9d2;
}

.sat-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #002932;
}

.sat-section ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.sat-section li {
    margin-bottom: 0.8rem;
}

.citation {
    font-style: italic;
    color: #666;
    text-align: right;
    margin-top: 1rem;
}

/* =================================================================
   Section Observatoires
   ================================================================= */
.observatoires-section {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 60px;
}

.observatoires-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #002932;
}

/* Liens des observatoires (cartes entièrement cliquables) */
.observatoire-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border-radius: 15px;
}

.observatoire-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 41, 50, 0.1);
}

.observatoire-card {
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(0, 41, 50, 0.1);
}

.observatoire-card-link:nth-child(1) .observatoire-card {
    background: #d3e0da;
}

.observatoire-card-link:nth-child(2) .observatoire-card {
    background: #c5e0f0;
}

.observatoire-card-link:nth-child(3) .observatoire-card {
    background: #f2dcb6;
}

.observatoire-card-link:nth-child(4) .observatoire-card {
    background: #c5d9d2;
}

.observatoire-card-link:nth-child(5) .observatoire-card {
    background: #d6e9da;
}

.observatoire-card-link:nth-child(6) .observatoire-card {
    background: #eaedd2;
}

.observatoire-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
    color: #002932;
}

.observatoire-card a {
    color: #002932;
    text-decoration: none;
}

/* Images des observatoires */
.observatoire-image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.observatoire-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.observatoire-card-link:hover .observatoire-image img {
    opacity: 1;
    transform: scale(1.05);
}

/* =================================================================
   Pages Observatoires - Filtres et cartes
   ================================================================= */
.observatoire-filters {
    background: #c5d9d2;
    border-radius: 20px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-header h2 {
    font-size: 1.5rem;
    color: #002932;
    margin: 0;
}

.filters-mobile-toggle {
    display: none;
    background: #002932;
    color: #f5faf8;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters-mobile-toggle:hover {
    background: transparent;
    color: #002932;
}

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

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #002932;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 41, 50, 0.2);
    border-radius: 8px;
    background: #f5faf8;
    color: #002932;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #002932;
    box-shadow: 0 0 0 3px rgba(0, 41, 50, 0.1);
}

/* =================================================================
   Section carte
   ================================================================= */
.observatoire-map-section {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(0, 41, 50, 0.1);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.map-header h3 {
    font-size: 1.5rem;
    color: #002932;
    margin: 0;
}

.map-counter {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #666;
}

.map-container {
    position: relative;
}

#observatoireMap {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* =================================================================
   Cartes graphiques et statistiques
   ================================================================= */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #002932;
}

.section-header p {
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.chart-card {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 41, 50, 0.1);
    text-align: center;
}

.chart-card:nth-child(1) {
    background: #c5d9d2;
}

.chart-card:nth-child(2) {
    background: #c5e0f0;
}

.chart-card:nth-child(3) {
    background: #d3e0da;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 41, 50, 0.15);
}

.chart-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #002932;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.stat-card {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 41, 50, 0.1);
    cursor: pointer;
}

.stat-card:nth-child(1) { background: #c5d9d2; }
.stat-card:nth-child(2) { background: #c5e0f0; }
.stat-card:nth-child(3) { background: #d3e0da; }
.stat-card:nth-child(4) { background: #f2dcb6; }
.stat-card:nth-child(5) { background: #c5d9d2; }
.stat-card:nth-child(6) { background: #c5e0f0; }
.stat-card:nth-child(7) { background: #d3e0da; }
.stat-card:nth-child(8) { background: #f2dcb6; }
.stat-card:nth-child(9) { background: #c5d9d2; }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 41, 50, 0.15);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #002932;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: #002932;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* =================================================================
   Tableau
   ================================================================= */
.observatoire-table-section {
    margin-bottom: 60px;
}

.table-card {
    background: #f5faf8;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(0, 41, 50, 0.1);
}

.table-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #002932;
    text-align: center;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #c5d9d2;
}

.data-table th {
    background: #c5d9d2;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #002932;
}

.data-table tr:hover {
    background: rgba(128, 166, 150, 0.3);
    transition: background-color 0.2s ease;
}

/* =================================================================
   Éléments utilitaires
   ================================================================= */
.export-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #002932;
    color: #f5faf8;
    border: 2px solid #002932;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 41, 50, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.export-btn:hover {
    background: transparent;
    color: #002932;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 41, 50, 0.3);
}

/* =================================================================
   Footer
   ================================================================= */
.footer {
    background-color: #002932;
    color: #f5faf8;
    padding: 40px 20px 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: #f5faf8;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 0.8;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.footer-logos img {
    height: 44px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.footer-logos img:hover { opacity: 1; }
.footer-logos img[alt="INRAE"] {
    filter: brightness(0) invert(1);
}

/* Modal mentions légales */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: #fff;
    color: #222;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
    line-height: 1.65;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.modal-close:hover { color: #000; }
.modal-box h3 {
    color: #002932;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e0e0e0;
}
.modal-box h3:first-child { margin-top: 0; }
.modal-box p { margin: 0.4rem 0; font-size: 0.9rem; }
.modal-box a { color: #1a7a5e; }

/* =================================================================
   Animations
   ================================================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================
   Responsive Design
   ================================================================= */
@media (max-width: 1200px) {
    .grid-1-3 {
        grid-template-columns: 300px 1fr;
        gap: 30px;
    }
    
    .observatoire-filters {
        padding: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .grid-2-thirds, .grid-1-2, .grid-1-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-2-thirds div:empty {
        display: none;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .grid-3-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .observatoire-filters {
        position: static;
        order: 2;
    }
    
    .observatoire-map-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 20px 15px;
    }

    .observatoire-container {
        padding-top: 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .filters-mobile-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .filters-content {
        display: none;
        animation: slideDown 0.3s ease;
    }

    .filters-content.active {
        display: block;
    }

    .card, .sat-section, .observatoires-section,
    .observatoire-filters, .observatoire-map-section,
    .chart-card, .stat-card, .table-card {
        padding: 1.5rem;
    }

    #observatoireMap {
        height: 400px;
    }

    .chart-wrapper {
        height: 250px;
    }

    .grid-3-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem;
    }

    .export-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-logos {
        flex-direction: column;
        gap: 1rem;
    }

    .observatoire-image img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .chart-wrapper {
        height: 200px;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
}

/* =================================================================
   États focus pour l'accessibilité
   ================================================================= */
button:focus,
select:focus,
input:focus,
.nav-link:focus,
.btn-reset:focus,
.export-btn:focus,
.observatoire-card-link:focus {
    outline: 2px solid #002932;
    outline-offset: 2px;
}

/* =================================================================
   Animation pour l'accordéon mobile
   ================================================================= */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1000px;
    }
}

/* Affichage des filtres sur desktop */
@media (min-width: 769px) {
    .filters-mobile-toggle {
        display: none !important;
    }

    .filters-content {
        display: block !important;
    }
}

/* =================================================================
   Réduction des mouvements pour les utilisateurs sensibles
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-in {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
}

/**
 * ================================================================
 * CSS pour les graphiques - Phase 2
 * Intégré à la charte graphique ObSAT
 * ================================================================
 */

/* Section des graphiques */
.observatoire-charts-section {
    margin: 4rem 0;
    padding: 3rem 0;
    border-top: 2px solid rgba(128, 166, 150, 0.3);
    background: linear-gradient(135deg, rgba(245, 250, 248, 0.5) 0%, rgba(241, 233, 224, 0.3) 100%);
}

.observatoire-charts-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.observatoire-charts-section .section-header h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #002932;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    position: relative;
}

.observatoire-charts-section .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #80a696;
    border-radius: 2px;
}

.observatoire-charts-section .section-header p {
    font-family: 'Poppins', sans-serif;
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grille des graphiques */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        padding: 0 0.5rem;
    }
}

/* Cartes de graphiques */
.chart-card {
    background: #f5faf8;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 41, 50, 0.08);
    border: 1px solid rgba(0, 41, 50, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #80a696 0%, #c5e0f0 50%, #d3e0da 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 41, 50, 0.12);
}

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

/* En-têtes des graphiques */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 41, 50, 0.08);
}

.chart-header h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #002932;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    max-width: 80%;
}

.chart-refresh-btn {
    background: none;
    border: 2px solid rgba(128, 166, 150, 0.3);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #80a696;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-refresh-btn:hover {
    background: rgba(128, 166, 150, 0.1);
    border-color: #80a696;
    transform: rotate(90deg);
}

.chart-refresh-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Conteneurs des graphiques */
.chart-container {
    height: 350px;
    position: relative;
    margin-bottom: 1rem;
}

/* Assurer que les canvas prennent toute la place */
.chart-container canvas {
    max-width: 100% !important;
    height: 100% !important;
}

/* Messages d'erreur des graphiques */
.chart-error {
    text-align: center;
    padding: 2rem;
    background: rgba(231, 76, 60, 0.05);
    border: 2px dashed rgba(231, 76, 60, 0.2);
    border-radius: 12px;
    margin: 1rem 0;
}

.chart-error-content h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.chart-error-content p {
    color: #666;
    margin-bottom: 1.5rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.4;
}

.btn-retry {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.btn-retry:active {
    transform: translateY(0);
}

/* Section d'informations sur les données */
.charts-info {
    background: rgba(128, 166, 150, 0.15);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(128, 166, 150, 0.3);
}

.info-card h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #002932;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card h4::before {
    content: 'ℹ️';
    font-size: 1.2rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.info-card li {
    padding: 1rem;
    position: relative;
    color: #555;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
    background: rgba(245, 250, 248, 0.7);
    border-radius: 8px;
    border-left: 4px solid #80a696;
    transition: all 0.3s ease;
}

.info-card li:hover {
    background: rgba(245, 250, 248, 1);
    transform: translateX(4px);
}

.info-card li::before {
    content: "•";
    position: absolute;
    left: -12px;
    top: 1rem;
    color: #80a696;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .observatoire-charts-section {
        margin: 2rem 0;
        padding: 2rem 0;
    }
    
    .observatoire-charts-section .section-header h2 {
        font-size: 1.8rem;
    }
    
    .chart-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .chart-container {
        height: 280px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .chart-header h3 {
        max-width: 100%;
        font-size: 1.1rem;
    }
    
    .chart-refresh-btn {
        align-self: flex-end;
    }
    
    .charts-info {
        padding: 1.5rem;
    }
    
    .info-card ul {
        grid-template-columns: 1fr;
    }
}

/* Animation d'apparition des graphiques */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-card.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.chart-card:nth-child(2) {
    animation-delay: 0.2s;
}

/* Styles pour les tooltips Chart.js (surcharge) */
.chartjs-tooltip {
    font-family: 'Poppins', sans-serif !important;
}

/* Amélioration de l'accessibilité */
.chart-refresh-btn:focus {
    outline: 2px solid #80a696;
    outline-offset: 2px;
}

.btn-retry:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Loading state pour les graphiques */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    background: rgba(245, 250, 248, 0.5);
    border-radius: 8px;
    flex-direction: column;
    gap: 1rem;
}

.chart-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(128, 166, 150, 0.3);
    border-top: 3px solid #80a696;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.chart-loading-text {
    font-family: 'Poppins', sans-serif;
    color: #666;
    font-weight: 500;
}

/* Styles pour les légendes personnalisées */
.chart-legend-custom {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #002932;
}

.legend-color-custom {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .observatoire-charts-section {
        background: linear-gradient(135deg, rgba(0, 41, 50, 0.5) 0%, rgba(0, 41, 50, 0.3) 100%);
    }
    
    .chart-card {
        background: rgba(0, 41, 50, 0.8);
        border-color: rgba(245, 250, 248, 0.1);
    }
    
    .chart-header h3 {
        color: #f5faf8;
    }
    
    .charts-info {
        background: rgba(0, 41, 50, 0.6);
        border-color: rgba(128, 166, 150, 0.3);
    }
    
    .info-card h4 {
        color: #f5faf8;
    }
    
    .info-card li {
        background: rgba(0, 41, 50, 0.5);
        color: #ccc;
    }
}

/* ================================================================
   Ajouts ObSAT refonte — notifications, dropdown disabled, badge
   ================================================================ */

.observatoire-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: .75rem 1.5rem;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 41, 50, .2);
    transition: opacity .3s ease;
}
.observatoire-notification.success { background: #c5e0f0; color: #002932 }
.observatoire-notification.error   { background: #e74c3c; color: #fff }
.observatoire-notification.warning { background: #db9c2d; color: #002932 }

/* Dropdown items désactivés */
.dropdown-item.disabled {
    opacity: .5;
    cursor: default;
    pointer-events: none;
}

/* Badge "En développement" dans le dropdown */
.badge-dev {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 1px 6px;
    border-radius: 8px;
    background: #f39c12;
    color: #191816;
    margin-left: 6px;
    vertical-align: middle;
}

/* Badge "Bientôt disponible" dans le dropdown */
.badge-soon {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(0, 41, 50, .12);
    color: #888;
    margin-left: 6px;
    vertical-align: middle;
}

/* Filtre actif mobile */
.filters-content.active {
    display: block !important;
}

/* Carte cliquable (ex: Pricco) */
a.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
}
a.card-link:hover {
    box-shadow: 0 6px 20px rgba(25,24,22,.15);
    transform: translateY(-2px);
}

/* Département filter peuplé dynamiquement */
#observatoireDeptFilter option { font-family: 'Poppins', sans-serif }

/* ── Partenaires ────────────────────────────────────────────────────────── */
.partners-section { margin-bottom: 60px }
.partners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 1.5rem;
}
.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid rgba(25,24,22,.1);
    border-radius: 12px;
    text-decoration: none;
    color: #002932;
    min-width: 130px;
    max-width: 180px;
    transition: box-shadow .2s, transform .2s;
}
.partner-card:hover {
    box-shadow: 0 4px 15px rgba(25,24,22,.12);
    transform: translateY(-2px);
}
.partner-card-no-link { cursor: default }
.partner-card-no-link:hover { box-shadow: none; transform: none }
.partner-logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}
.partner-logo-initials {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.partner-nom {
    font-family: 'Poppins', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    text-align: center;
    color: #002932;
    line-height: 1.3;
}

/* ── Définitions ────────────────────────────────────────────────────────── */
.definitions-section { margin-bottom: 60px }
.definition-intro {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 1.5rem;
    max-width: 780px;
}
.definition-subtypes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.definition-subtype {
    padding: 1rem 1.25rem;
    background: #f5faf8;
    border: 1px solid rgba(25,24,22,.08);
    border-radius: 10px;
}
.definition-subtype-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.definition-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.definition-label {
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: #002932;
}
.definition-desc {
    font-size: .88rem;
    line-height: 1.5;
    color: #555;
    margin: 0;
    padding-left: 18px;
}

/* =================================================================
   Page Projet
   ================================================================= */
.projet-hero {
    max-width: 760px;
    margin: 0 auto 3rem;
    text-align: center;
}
.projet-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: #002932;
    margin-bottom: .5rem;
}
.projet-hero .subtitle {
    font-size: 1.05rem;
    color: #666;
}

.projet-content {
    max-width: 760px;
    margin: 0 auto;
}
.projet-content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #002932;
    margin: 2.5rem 0 .75rem;
}
.projet-content p {
    color: #333;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.projet-badge {
    display: inline-block;
    background: #002932;
    color: #f5faf8;
    font-family: 'Poppins', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 4px 14px;
    border-radius: 20px;
    margin: 2.5rem 0 1rem;
}

.projet-timeline {
    border-left: 3px solid #d2ccb9;
    margin: 1rem 0 2rem 1rem;
    padding-left: 1.5rem;
}
.projet-timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.projet-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.94rem;
    top: .35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #002932;
    border: 2px solid #f5faf8;
    outline: 2px solid #002932;
}
.projet-timeline-year {
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .2rem;
}
.projet-timeline-item p {
    margin: 0;
    font-size: .95rem;
}

.projet-usagers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 3rem;
}
.projet-usager-card {
    background: #f5faf8;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    font-size: .92rem;
    color: #002932;
    font-weight: 500;
    border-left: 3px solid #002932;
}

.projet-publications {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0 2rem;
}
.projet-publication-card {
    background: #faf9f5;
    border: 1px solid rgba(25,24,22,.1);
    border-left: 4px solid #002932;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
}
.publication-type {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #002932;
    margin-bottom: .5rem;
}
.publication-ref {
    font-size: .95rem;
    line-height: 1.6;
    color: #333;
    margin: .25rem 0 .75rem !important;
}
.publication-ref em {
    font-style: italic;
}
.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.publication-doi,
.publication-hal {
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity .15s;
}
.publication-doi {
    background: #002932;
    color: #f5faf8;
}
.publication-hal {
    background: #d2ccb9;
    color: #191816;
}
.publication-doi:hover,
.publication-hal:hover { opacity: .8 }

.projet-partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 3rem;
}
.projet-partner-card {
    background: #fff;
    border: 1px solid #e0ddd6;
    border-radius: 12px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: box-shadow .2s;
}
.projet-partner-card:hover {
    box-shadow: 0 4px 16px rgba(0,41,50,.1);
}
.projet-partner-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #002932;
    margin: 0;
}
.projet-partner-card p {
    font-size: .88rem;
    color: #444;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.projet-partner-card .partner-meta {
    font-size: .8rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: .6rem;
    margin-top: auto;
}
.projet-partner-card a.partner-link {
    font-size: .82rem;
    font-weight: 600;
    color: #1a7a5e;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.projet-partner-card a.partner-link:hover { text-decoration: underline; }

/* =================================================================
   Contenu bilingue — piloté par html[lang]
   ================================================================= */
html[lang="en"] .fr-only { display: none; }
html[lang="fr"] .en-only { display: none; }

/* Nav — item "à venir" */
.nav-coming-soon {
    opacity: .45;
    pointer-events: none;
    cursor: default;
}
.nav-badge-soon {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #d2ccb9;
    color: #666;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}
/* ── Autocomplete PAT (observatoire + territoire) ───────────────────────── */
.pat-search-input {
    width: 100%; box-sizing: border-box;
    padding: .45rem .75rem;
    border: 1px solid rgba(25,24,22,.2);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    background: #fff;
}
.pat-search-input:focus {
    outline: none;
    border-color: rgba(25,24,22,.5);
}
.pat-dropdown {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    max-height: 220px; overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(25,24,22,.15);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 1000;
}
.pat-suggestion {
    padding: .4rem .75rem;
    cursor: pointer;
    font-size: .82rem;
    line-height: 1.35;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.pat-suggestion:hover { background: rgba(210,204,185,.4); }
.pat-clear-btn {
    display: none; margin-top: .35rem;
    font-size: .8rem; color: #888;
    background: none; border: none;
    cursor: pointer; text-decoration: underline;
    padding: 0;
}

/* ── Tags services dans les popups carte ────────────────────────────────── */
.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.popup-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(210,204,185,.35);
    color: #555;
    font-size: .75rem;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}
