/* ============================
   Variables & Thème
============================ */
:root {
    --primary-color: #5c6b7d;
    --primary-hover: #4a5664;
    --accent-color: #1abc9c;
    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border-color: #d1d5db;
    --footer-bg: #4a5664;
}

/* ============================
   Structure générale
============================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 40px;
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    flex: 1;
    min-width: 60%;
}
/* ============================
   En-tête (Header)
============================ */
.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.header-left {
    display: flex;
    flex-direction: column;
}
.page-header {
    text-align: center;
}
.header-right {
    justify-self: end;
}
.header-right #lang-switch {
    margin-bottom: 0;
}
.site-title {
    font-size: 2.0em;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
    line-height: 1.2;
}
.site-title:hover {
    color: var(--primary-hover);
}
.site-tagline {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}
/* ============================
   Navigation & Switch langue
============================ */
#lang-switch {
    text-align: right;
    margin-bottom: 20px;
    font-size: 0.9em;
}

#lang-switch a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 10px;
    transition: color 0.2s ease;
}

#lang-switch a:hover {
    color: var(--primary-color);
}

/* ============================
   Titres
============================ */
h1 {
    text-align: center;
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

h2, h3 {
    color: var(--primary-color);
    margin-top: 30px;
    font-weight: 600;
}

/* ============================
   Formulaires, Inputs & Boutons
============================ */
form label {
    display: block;
    margin-top: 15px;
    font-weight: 500;
    color: var(--text-main);
}

form input[type="text"],
form input[type="file"],
form input[type="number"],
form input[type="email"],
form select,
form textarea,
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

form input:focus,
form select:focus,
form textarea:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(92, 107, 125, 0.15);
}

form button,
button {
    margin-top: 8px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    box-sizing: border-box;
}

form button:hover,
button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

form button:active,
button:active {
    transform: scale(0.98);
}

/* ============================
   Carte et résultats
============================ */
#results-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;   /* clé : les deux colonnes ont la même hauteur */
    width: 100%;            /* occupe toute la largeur du conteneur */
    margin: 20px 0;
}

.odo-popup {
    position: absolute;
    max-width: 280px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.85em;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
}

.copy-btn:disabled {
    color: #696969;        /* texte sombre, lisible */
    background-color: #e2e8f0;  /* fond neutre */
    cursor: default;
}
#results-container {
    width: 320px;            /* légèrement réduite, comme tu le souhaitais */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
#results-container h3 {
    margin-top: 0;           /* aligne le haut du titre avec le haut de la carte */
}
#results-list {
    flex: 1;
    overflow-y: auto;
    min-height: 1200px;       /* ≈ hauteur pour 10 résultats — à affiner, voir remarque ci-dessous */
    max-height: 1200px;
}

.map-column {
    flex: 1;                 /* occupe tout l'espace restant → pleine largeur dispo */
    min-width: 0;            /* évite le débordement flex classique */
    display: flex;
    flex-direction: column;
}

#map-wrapper {
    position: relative;   /* sert de référence pour le positionnement du slider */
    flex: 1;               /* prend toute la hauteur de .map-column (grand écran) */
    min-height: 0;
}
#map {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
#historical-control {
    position: absolute;
    top: 5px;
    bottom: 15px;
    right: 5px;
    width: 80px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 10px;
    z-index: 1000;
}
#year-slider {
    flex: 1;
    margin-top: 10px;
}
#layer-type {
    font-size: 13px;
    text-align: center;
    margin-bottom: 15px;
}

#legend {
    margin-top: 15px;
    width: 100%;
}


@media (max-width: 900px) {
    #results-layout {
        flex-direction: column;
        align-items: stretch;
    }
    #results-container,
    .map-column {
        width: 100%;
    }
    #results-list {
        min-height: 0;
        max-height: none;
        max-width: 400px;
        overflow-y: visible;
    }
    #map-wrapper {
        flex: none;      /* plus de hauteur héritée du flex parent en mode colonne */
        height: 70vw;    /* hauteur proportionnelle à la largeur d'écran */
    }
}


/* ============================
   Légende des couleurs
============================ */
#legend {
    max-width: 800px;
    margin: 15px auto 40px auto;
    font-size: 14px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

#legend strong {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* ============================
   Légende des symboles
============================ */

#legend-symbologie {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

#legend-symbologie > div {
    flex: 1;
    min-width: 220px;
}

#legend-symbologie strong {
    display: block;
    margin-bottom: 8px;
}

#legend-symbologie span {
    white-space: normal;
}

/* ============================
   Tableaux
============================ */
#example-table {
    margin: 30px auto;
    border-collapse: collapse;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#example-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    font-weight: 500;
}

#example-table td {
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

#example-table tr:hover td {
    background-color: #f8f9fa;
}

/* ============================
   Zone de mapping (batch)
============================ */
#column-mapping {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#column-mapping select {
    margin-left: 10px;
    margin-bottom: 10px;
}

/* ============================
   Section téléchargement
============================ */
#download-section {
    margin-top: 20px;
    display: none;
}

#download-btn {
    background: #27ae60;
    border-color: #27ae60;
}

#download-btn:hover {
    background: #2ecc71;
    border-color: #2ecc71;
}

/* ============================
   Page Contact
============================ */
.contact-page-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre le contenu horizontalement */
    width: 100%;
}

#contact-box {
    width: 100%;
    max-width: 600px;
    margin: 20px 0;
}

#contact-box textarea {
    height: 250px;
    resize: vertical;
}

.flash-message {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    text-align: center;
    font-weight: 500;
}

.back-link {
    margin-top: 30px;
}

.btn-secondary {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background-color: var(--bg-color) !important;
    color: var(--primary-color) !important;
}

/* ============================
   Footer
============================ */
.footer-outro {
    font-size: 1em;
    color: #e1e6ea; /* #b8c2cc; */
    line-height: 1.6;
    margin: 0 0 10px 0;
    opacity: 0.95;
}
.footer-outro a {
    color: #d1d9e0;
    text-decoration: underline;
    transition: color 0.3s ease;
}
.footer-outro a:hover {
    color: #ffffff;
}

.archisols-footer {
    background-color: var(--footer-bg);
    color: #e2e8f0;
    padding: 60px 20px 20px;
    margin-top: 60px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.footer-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    justify-content: space-between;
}

.footer-col {
    flex: 1;
    min-width: 280px;
}

.about-col .footer-main-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.about-col p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #e2e8f0;
    margin: 0;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.1em;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 1px;
}

.partner-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 40px;
    align-items: center;
    justify-items: center;
}

.partner-logos img {
    max-width: 100%;
    max-height: 65px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.partner-logos img:hover {
    opacity: 1;
    transform: scale(1.05);
}

.links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-col ul li {
    margin-bottom: 12px;
}

.links-col ul li a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.links-col ul li a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 50px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.footer-bottom a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-col h3 {
        margin-bottom: 15px;
    }
}

/* ============================
   Formulaire de recherche (Accueil)
============================ */
.search-form {
    display: flex;
    flex-wrap: wrap; /* Permet de passer à la ligne sur mobile */
    gap: 15px; /* Espace uniforme entre les champs */
    align-items: center; /* Aligne tout verticalement au centre */
    background: #f8f9fa; /* Ajoute un fond gris très clair pour délimiter la zone */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

/* Annuler la largeur de 100% pour qu'ils se partagent la ligne */
.search-form input,
.search-form select {
    flex: 1; /* Chaque champ prend une largeur égale */
    min-width: 140px; /* Empêche les champs d'être trop écrasés sur écran moyen */
    margin-top: 0; /* Annule la marge définie précédemment */
}

/* Ajustements pour les champs numériques (numéro et année) qui peuvent être plus petits */
.search-form input[type="number"] {
    flex: 0.5;
    min-width: 100px;
}

.search-form button {
    margin-top: 0;
    white-space: nowrap; /* Empêche le texte du bouton de passer sur deux lignes */
}

/* Force le message d'erreur/succès à passer en dessous de la ligne de recherche */
#feedback-message {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 10px;
    text-align: center;
}
