/* IMPORTANT : Les variables CSS sont dans variables.css */
/* Ce fichier doit être chargé APRÈS variables.css */

/* Modules temporairement désactivés (Quand et Qui) */
#quand-selector,
#qui-selector {
    display: none !important;
}

/* Reset du main */
main {
    padding: 0 !important;
    margin: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
}

body.recherche {
    text-align: left;
}

body {
    background-color: var(--bg-body-alt);
}

/* Hero Section */
.hero-recherche {
    position: relative;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-recherche-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-recherche-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-recherche-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Container principal */
.recherche-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem;  /* CORRECTION: Padding horizontal de 2rem */
}

/* Container des résultats - même largeur que le moteur de recherche */
.results-container-modern {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;  /* CORRECTION: Padding horizontal de 2rem */
}

.results-section-modern {
    /* Pas de margin - le padding du parent gère l'espacement */
}

/* Carte de recherche - alignement avec résultats */
.search-card-modern {
    /* Pas de margin - le padding du parent gère l'espacement */
}

/* Alignement du bouton reset avec la barre de recherche */
.search-card-modern > .text-center {
    margin-left: 0;
    margin-right: 0;
}

.recherche .cards-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.search-form-wrapper {
    border: var(--border-width) solid var(--border-color-dark);
    border-radius: var(--radius-card);
    padding: 1.5rem;  /* Réduit de 2rem à 1.5rem */
    background-color: var(--bg-card);
    box-shadow: var(--shadow-research);
    margin-bottom: 1.5rem;  /* Réduit de 2rem à 1.5rem */
    width: 100%;
    min-width: 100%;
}

.recherche .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Fieldset styling - Version compacte */
.recherche fieldset {
    border: var(--border-width) solid var(--border-color-form);
    border-radius: var(--radius-button);
    padding: 0.75rem;  /* Réduit de 1rem à 0.75rem */
    margin-bottom: 0.75rem;  /* Réduit de 1rem à 0.75rem */
}

.recherche legend {
    float: none;
    width: auto;
    padding: 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.recherche .fieldset-regions,
.recherche .form-check {
    text-align: left;
}

/* Region items spacing - Version compacte */
.recherche .region-item {
    margin-bottom: 0.1rem;  /* Réduit de 0.15rem à 0.1rem */
    line-height: 1;  /* Réduit de 1.1 à 1 */
}

.recherche #regions-container {
    line-height: 1.2;  /* Réduit de 1.3 à 1.2 */
}

/* Réduire la taille des labels de régions/départements */
.recherche .region-item .form-check-label {
    font-size: 0.9rem;
    line-height: 1.2;  /* Réduit de 1.3 à 1.2 */
}

.recherche .department-list .form-check-label {
    font-size: 0.85rem;
    line-height: 1.2;  /* Réduit de 1.3 à 1.2 */
}

.recherche .department-list .form-check {
    margin-bottom: 0.15rem;  /* Réduit l'espacement entre départements */
    padding-left: 0.5rem;  /* Réduit le padding gauche */
}

/* Department list */
.department-list {
    padding-left: 1.5rem;  /* Réduit de 2rem à 1.5rem */
    max-height: 200px;
    overflow-y: auto;
    border-left: 2px solid #eee;
    margin-top: 0.25rem;  /* Réduit de 0.5rem à 0.25rem */
    margin-left: 0.5rem;  /* Ajout d'une marge à gauche pour l'alignement */
}

.region-item .form-check {
    display: inline-block;
}

.toggle-departments {
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;  /* Réduit de 0.9rem à 0.85rem */
    padding: 0 8px;  /* Augmenté de 6px à 8px pour plus d'espace */
    display: inline-flex;  /* Changé de inline-block à inline-flex */
    align-items: center;  /* Alignement vertical */
    justify-content: center;  /* Centrage horizontal */
    transition: transform var(--transition-base);
    user-select: none;
    min-width: 26px;  /* Augmenté de 24px à 26px */
    height: 100%;  /* Occupe toute la hauteur */
    flex-shrink: 0;  /* Empêche la compression */
    margin-right: 0.25rem;  /* Ajout d'une marge à droite de la flèche */
}

.toggle-departments i {
    font-size: 0.75rem;  /* Taille réduite de l'icône */
    line-height: 1;
}

.toggle-departments.collapsed {
    transform: rotate(0deg);
}

.toggle-departments:not(.collapsed) {
    transform: rotate(90deg);
}

/* Activity accordion */
.accordion-button:not(.collapsed) {
    color: var(--color-accordion-expanded);
    background-color: var(--color-accordion-bg);
}

/* Results Container */
#results-container {
    border: var(--border-width) solid var(--border-color-dark);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-research);
}

#results-container .card {
    border-color: var(--border-color-card);
}

#results-container .card-header {
    background-color: var(--bg-body-alt);
    font-weight: bold;
}

#results-container .card-body pre {
    background-color: var(--bg-form-header);
    padding: 1rem;
    border-radius: var(--radius-card);
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
}

/* Summary criteria spacing - Force vertical spacing between different criteria types */
#results-container .summary-container .criteria-line {
    margin-bottom: 1rem !important;
}

#results-container .summary-container .criteria-line:last-child {
    margin-bottom: 0 !important;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: #f0f0f0;
}

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

.suggestion-name {
    font-weight: 500;
    color: #333;
}

.suggestion-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.autocomplete-loading {
    padding: 10px 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.autocomplete-no-results {
    padding: 10px 15px;
    text-align: center;
    color: #999;
}

/* Animations for transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Apply animations to elements */
#results-container:not(.d-none) {
    animation: fadeIn 0.5s ease-in-out;
}

#search-criteria:not(.d-none) {
    animation: slideDown 0.4s ease-out;
}

#results-count:not(.d-none) {
    animation: slideDown 0.6s ease-out;
}

.summary-container {
    animation: slideUp 0.5s ease-out;
}

#results-display:not(.d-none) {
    animation: fadeIn 0.7s ease-in-out;
}

/* Bouton "Modifier les critères" dans le résumé */
.btn-modify-criteria {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.btn-modify-criteria:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-modify-criteria i {
    font-size: 1rem;
}

/* ============================================
   TYPOGRAPHIE HIÉRARCHISÉE
   ============================================ */

/* Titres principaux */
h1.display-5 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

#results-container h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 1.5rem;
}

/* Légendes et labels - Version compacte */
legend {
    font-size: 1rem;  /* Réduit de 1.15rem à 1rem */
    font-weight: 600;
    color: var(--color-secondary-dark);
    margin-bottom: 0.75rem;  /* Réduit l'espace sous la légende */
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;  /* Réduit de 0.95rem à 0.9rem */
    color: #333;
    margin-bottom: 0.3rem;  /* Réduit l'espace sous le label */
}

/* Texte du corps */
body {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

/* ============================================
   BADGES D'ÉVÉNEMENTS AVEC COULEURS - COMPACTS
   ============================================ */

.card-type-event {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;  /* Réduit de 0.35rem à 0.3rem */
    padding: 0.25rem 0.6rem;  /* Réduit de 0.35rem 0.75rem */
    border-radius: 0.75rem;  /* Réduit de 1rem à 0.75rem */
    font-size: 0.75rem;  /* Réduit de 0.85rem à 0.75rem */
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);  /* Ombre réduite */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-type-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);  /* Ombre hover réduite */
}

.card-type-event i {
    font-size: 0.8rem;  /* Réduit de 0.9rem à 0.8rem */
}

/* Amélioration des badges de compteur */
.badge.bg-primary {
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

/* ============================================
   CARTES D'ARTICLES DANS LA VUE CARTE
   ============================================ */

/* Les cartes dans la vue Carte utilisent maintenant le même format que la vue Grille */
/* Aucun style spécifique nécessaire - elles héritent des styles de style.css */

/* ============================================
   ACCORDÉON D'ACTIVITÉS - COMPACT
   ============================================ */

.accordion-button {
    font-size: 0.95rem;  /* Réduit de 1.05rem à 0.95rem */
    font-weight: 500;
    padding: 0.6rem 1rem;  /* Réduit le padding vertical (défaut: 1rem 1.25rem) */
    line-height: 1.3;  /* Réduit la hauteur de ligne */
}

.accordion-button:not(.collapsed) {
    font-weight: 600;
}

/* Réduire la hauteur des items accordion */
.accordion-item {
    margin-bottom: 0.5rem;  /* Espacement entre les accordéons */
}

/* Optimiser le corps de l'accordéon */
.accordion-body {
    padding: 0.75rem 1rem;  /* Réduit le padding (défaut: 1rem 1.25rem) */
}

/* Réduire la taille des checkboxes d'activités */
#activites-accordion .form-check {
    margin-bottom: 0.3rem;  /* Réduit l'espacement entre les checkboxes */
    padding-left: 1.5rem;  /* Ajuste l'alignement */
}

#activites-accordion .form-check-label {
    font-size: 0.9rem;  /* Réduit la taille du texte des activités */
    line-height: 1.3;
}

#activites-accordion .form-check-input {
    margin-top: 0.15rem;  /* Ajuste l'alignement vertical de la checkbox */
}

/* ============================================
   COMPTEUR DE RÉSULTATS
   ============================================ */

#results-count {
    font-size: 1.1rem;
    border-radius: var(--radius-card);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#results-count strong {
    font-size: 1.25rem;
}

/* ============================================
   GRILLE DE RÉSULTATS - COMPACTE
   ============================================ */

#results-grid-view.row {
    row-gap: 1rem !important;  /* Réduit l'espacement vertical entre les cartes */
}

#results-grid-view .col {
    padding-left: 0.5rem;  /* Réduit l'espacement horizontal */
    padding-right: 0.5rem;
}

/* ============================================
   CHIPS DE CRITÈRES DE RECHERCHE
   ============================================ */

.search-criteria-chips {
    background: white;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    z-index: 998;
    transition: all 0.3s ease;
}

.search-criteria-chips.empty {
    display: none;
}

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

.chips-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.chips-clear-all {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
}

.chips-clear-all:hover {
    color: #495057;
    text-decoration: underline;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.search-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-chip.chip-ou {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-chip.chip-quand {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.search-chip.chip-qui {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.search-chip.chip-quoi {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.chip-icon {
    font-size: 1rem;
}

.chip-text {
    flex: 1;
}

.chip-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.chip-close:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Responsive pour chips */
@media (max-width: 768px) {
    .search-criteria-chips {
        padding: 0.75rem 1rem;
    }

    .search-chip {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Vue Carte : contraindre la largeur de la colonne liste pour correspondre à la vue Grille (5 colonnes = 20%) */
.results-list-map-col {
    max-width: 20% !important;
    flex: 0 0 20% !important;
}

.map-col {
    max-width: 80% !important;
    flex: 0 0 80% !important;
}

/* Espacement vertical pour les cartes dans la liste de la vue Carte */
.results-list-map-col .article-card {
    margin-bottom: 1rem;
}

/* ============================================
   NOUVELLE INTERFACE COMPACTE - BARRE DE RECHERCHE
   ============================================ */

.search-bar-compact {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;  /* Supprimé pour sticky */
    overflow: visible !important;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: all 0.3s ease;
}

.search-bar-compact.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-bar-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    overflow: visible !important;
}

.search-item {
    flex: 1;
    min-width: 180px;
    position: relative;
    overflow: visible !important;
}

.search-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.search-label i {
    margin-right: 0.25rem;
    color: #667eea;
}

.search-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-button:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.search-button:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-button i.fa-chevron-down {
    font-size: 0.75rem;
    color: #999;
    transition: transform 0.2s ease;
}

.search-button.active i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Feedback visuel : bouton avec sélections actives */
.search-button.has-selection {
    border-color: #667eea !important;
    background: linear-gradient(to right, #f0f4ff 0%, #ffffff 100%) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
}

/* Style du label quand le bouton a une sélection */
.search-item.has-selection .search-label {
    color: #667eea;
    font-weight: 600;
}

/* Style du texte affiché dans le bouton */
.search-button.has-selection span {
    color: #667eea !important;
    font-weight: 600 !important;
}

/* Dropdowns */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    min-width: 300px;
    max-height: 500px;
    overflow: visible;
    padding: 1rem;
}

.search-dropdown.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
    position: absolute !important;
}

/* Dropdown pour "Où" plus large */
#ou-dropdown {
    min-width: 400px;
}

/* Dropdown pour "Quoi" */
#quoi-dropdown {
    min-width: 350px;
}

#quoi-dropdown .dropdown-content {
    display: block !important;
    visibility: visible !important;
}

/* Overflow sur le contenu seulement - UNIQUEMENT pour la barre de recherche */
.search-bar-compact .search-dropdown .dropdown-content,
.search-bar-compact #ou-dropdown .dropdown-content,
.search-bar-compact #quand-dropdown .dropdown-content,
.search-bar-compact #qui-dropdown .dropdown-content,
.search-bar-compact #quoi-dropdown .dropdown-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    min-height: 50px;
}

.tab-btn {
    flex: 1;
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    visibility: visible;
    opacity: 1;
    min-height: 150px;
    padding: 1rem;
}

/* Compteurs Qui */
.counter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.counter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.counter-label i {
    font-size: 1.1rem;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.counter-btn:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

/* Dates rapides */
.quick-dates {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-dates .btn {
    flex: 1;
    min-width: fit-content;
}

/* Actions de recherche */
.search-actions {
    display: flex;
    gap: 0.5rem;
    flex: none;
}

.btn-search {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: white !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white !important;
}

/* Chips de sélection */
.selection-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #333;
}

.chip i {
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
}

.chip i:hover {
    color: #495057;
}

/* Panneau filtres avancés */
.advanced-filters-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;  /* Margin verticale seulement - parent gère l'horizontal */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.panel-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close-panel {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close-panel:hover {
    background: #f0f0f0;
    color: #333;
}

/* Contenu du panneau filtres avancés */
.advanced-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.advanced-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.advanced-section-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.advanced-section-title i {
    color: #667eea;
    font-size: 0.95rem;
}

#advanced-activites-container,
#advanced-regions-container {
    max-height: 450px;
    overflow-y: auto;
}

/* Grille pour afficher plusieurs régions et activités par ligne */
.advanced-regions-grid,
.advanced-activites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.advanced-activite-group {
    margin-bottom: 1rem;
}

/* Style avec fond coloré pour les groupes dans les grilles */
.advanced-regions-grid .advanced-activite-group,
.advanced-activites-grid .advanced-activite-group {
    margin-bottom: 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff5f8 100%);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e8e9f3;
}

.advanced-group-title {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1.5px solid #e0e0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-select-all-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #667eea;
    cursor: pointer;
    margin-bottom: 0;
}

.group-select-all-label input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #667eea;
}

.group-select-all-label:hover {
    color: #764ba2;
}

.advanced-activites-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.advanced-activite-item {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.advanced-activite-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.advanced-activite-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-right: 0.35rem;
    cursor: pointer;
    accent-color: #667eea;
}

.advanced-activite-item.selected {
    background: #e7ecff;
    border-color: #667eea;
    color: #667eea;
    font-weight: 500;
}

/* Conteneurs pour les régions et activités dans les dropdowns */
/* Container scrollable pour les régions */
.regions-scroll-container {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

#regions-container-compact {
    display: block !important;
    visibility: visible !important;
    padding: 0.5rem 0.65rem;  /* Augmenté le padding horizontal */
    background: #fafafa;
}

/* Bouton sticky en bas du dropdown */
.sticky-footer-btn {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 0.75rem 0.5rem 0.5rem 0.5rem;
    border-top: 2px solid #e9ecef;
    margin-top: 0.5rem;
    z-index: 10;
}

.sticky-footer-btn .btn-open-modal-dept {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.sticky-footer-btn .btn-open-modal-dept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sticky-footer-btn .btn-open-modal-dept i {
    font-size: 1rem;
}

/* Style pour le bouton "Sélection détaillée" (activités) */
.sticky-footer-btn .btn-open-modal-activites {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.sticky-footer-btn .btn-open-modal-activites:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sticky-footer-btn .btn-open-modal-activites i {
    font-size: 1rem;
}

/* Container scrollable pour les activités */
.activites-scroll-container {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

#activites-container-compact {
    display: block !important;
    visibility: visible !important;
    padding: 0.5rem 0.65rem 0.5rem 1.25rem;  /* Padding gauche augmenté pour voir toute la checkbox */
    background: #fafafa;
}

#regions-container-compact .region-item {
    margin-bottom: 0.25rem;
    display: block !important;
    visibility: visible !important;
}

/* S'assurer que les form-check des activités sont aussi visibles */
#activites-container-compact .form-check {
    display: flex !important;
    align-items: center;
    visibility: visible !important;
    padding: 0.25rem 0.65rem 0.25rem 0.65rem;
    margin-bottom: 0.25rem;
    min-height: 28px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    gap: 0.5rem;
    flex-shrink: 0;
}

#activites-container-compact .form-check:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* Styles pour les items avec sélections dans le dropdown compact */
.activite-item.partial-selection .form-check {
    background: #fff3e0;
    border-color: #ff9800;
    border-left: 3px solid #ff9800;
}

.activite-item.full-selection .form-check {
    background: #e8f5e9;
    border-color: #4caf50;
    border-left: 3px solid #4caf50;
}

/* Badge de sélection dans le dropdown compact */
.compact-selection-badge {
    display: none;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    background: #ff9800;
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.activite-item.full-selection .compact-selection-badge {
    background: #4caf50;
}

/* Groupes d'activités */
.activite-groupe {
    margin-bottom: 0.75rem !important;  /* Réduit de 1rem à 0.75rem */
}

.groupe-titre {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;  /* Réduit de 1rem à 0.95rem */
    margin-bottom: 0.5rem;  /* Réduit de 0.75rem à 0.5rem */
    margin-left: 8px;  /* Aligné avec les rectangles d'activités */
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;  /* Padding gauche */
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

#regions-container-compact .region-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.25rem 0.65rem 0.25rem 0.75rem;  /* Augmenté le padding gauche à 0.75rem */
    margin-bottom: 0.25rem;  /* Réduit l'espacement */
    min-height: 28px;  /* Réduit de 40px à 28px */
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    line-height: 1;  /* Réduit la hauteur de ligne */
    gap: 0.4rem;  /* Augmenté de 0.3rem à 0.4rem pour plus d'espace */
}

#regions-container-compact .region-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* S'assurer que les form-check sont visibles */
#regions-container-compact .form-check {
    display: flex !important;
    align-items: center;
    padding-left: 0.25rem;  /* Ajout d'un petit padding gauche */
    margin-bottom: 0;
    min-height: 24px;
    flex-shrink: 0;  /* Empêche la compression */
    gap: 0.35rem;  /* Augmenté de 0.25rem à 0.35rem pour plus d'espace */
}

#regions-container-compact .form-check-input {
    margin-top: 0;
    margin-right: 0;  /* Supprimé car géré par gap du parent */
    flex-shrink: 0;  /* Empêche la compression de la checkbox */
    width: 16px;  /* Réduit de 18px à 16px */
    height: 16px;  /* Réduit de 18px à 16px */
    min-width: 16px;  /* Assure une largeur minimale */
}

#activites-container-compact .form-check-input {
    margin-top: 0;
    margin-right: 0;
    flex-shrink: 0;  /* Empêche la compression de la checkbox */
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
}

#regions-container-compact .form-check-label,
#activites-container-compact .form-check-label {
    cursor: pointer;
    user-select: none;
    color: #212529 !important;
    font-size: 0.9rem;  /* Réduit de 0.95rem à 0.9rem */
    font-weight: 500;
    margin-bottom: 0;
    padding: 0.15rem 0.4rem;  /* Réduit considérablement le padding */
    line-height: 1.2;  /* Réduit de 1.5 à 1.2 */
}

/* Responsive */
@media (max-width: 1024px) {
    .search-bar-row {
        flex-direction: column;
    }

    .search-item {
        width: 100%;
        min-width: 100%;
    }

    .search-actions {
        width: 100%;
    }

    .btn-search {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .recherche-container {
        padding: 2rem 1rem;  /* Réduction du padding sur mobile */
    }

    .results-container-modern {
        padding: 0 1rem 2rem 1rem;  /* Réduction du padding sur mobile */
    }

    .search-bar-compact {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .advanced-filters-panel {
        margin-top: 1rem;
    }

    .search-dropdown {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 0;
        border-radius: 12px 12px 0 0;
        max-height: 70vh;
    }

    .quick-dates {
        flex-direction: column;
    }

    .quick-dates .btn {
        width: 100%;
    }
}

/* ========================================= */
/* STYLES DES CARTES POI */
/* ========================================= */

/* Les styles de base des cartes sont gérés par style.css */
/* Styles spécifiques ajoutés ci-dessous pour les éléments visuels (badge, favoris, CTA, etc.) */

/* Container de l'image - nécessaire pour positionner les éléments absolus */
.card-image-wrapper {
    position: relative;
    overflow: hidden;
}

/* Overlay gradient sur l'image */
.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    pointer-events: none;
}

/* Badge de catégorie en haut à gauche */
.card-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.card-category-badge i {
    font-size: 1rem;
}

/* Bouton favoris en haut à droite */
.card-favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.card-favorite-btn i {
    font-size: 1.2rem;
    color: #666;
    transition: all 0.3s;
}

.card-favorite-btn:hover {
    transform: scale(1.1);
    background: #ff6b6b;
}

.card-favorite-btn:hover i {
    color: white;
}

.card-favorite-btn.active i {
    color: #ff6b6b;
}

/* Les styles .card-content et .card-label sont maintenant gérés par style.css */

.card-label a {
    color: rgb(0, 80, 82);
    text-decoration: none;
    transition: color 0.3s;
}

.card-label a:hover {
    color: #667eea;
}

/* Rating avec étoiles */
.card-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-stars {
    display: flex;
    gap: 0.2rem;
}

.card-stars i {
    color: #ffc107;
    font-size: 0.9rem;
}

.card-stars i.empty {
    color: #ddd;
}

.card-reviews-count {
    font-size: 0.85rem;
    color: #666;
}

/* Meta informations (badges type et région) */
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-type,
.card-region {
    padding: 0.4rem 0.8rem;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.card-type {
    background: #e3f2fd;
    color: #1976d2;
}

.card-region {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Bouton "Plus d'infos" qui apparaît au hover */
.card-cta {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    margin-top: 1rem;
}

.article-card:hover .card-cta {
    opacity: 1;
    transform: translateY(0);
}

.card-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.card-cta-btn:hover {
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   NOUVELLE SOLUTION : Boutons et Modals
   ============================================ */

/* Boutons pour ouvrir les modals dans les dropdowns */
.btn-open-modal-dept,
.btn-open-modal-activites {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-open-modal-dept:hover,
.btn-open-modal-activites:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-open-modal-dept i,
.btn-open-modal-activites i {
    font-size: 1rem;
}

/* Styles spécifiques pour les modals */
#modal-departements .modal-content,
#modal-activites .modal-content,
#modal-quoi-manifestations .modal-content,
#modal-quoi-activites .modal-content,
#modal-quoi-hebergement .modal-content,
#modal-quoi-restaurant .modal-content {
    border-radius: 15px;
    border: none;
}

#modal-departements .modal-header,
#modal-activites .modal-header,
#modal-quoi-manifestations .modal-header,
#modal-quoi-activites .modal-header,
#modal-quoi-hebergement .modal-header,
#modal-quoi-restaurant .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
}

#modal-departements .modal-title,
#modal-activites .modal-title,
#modal-quoi-manifestations .modal-title,
#modal-quoi-activites .modal-title,
#modal-quoi-hebergement .modal-title,
#modal-quoi-restaurant .modal-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#modal-departements .modal-title i,
#modal-activites .modal-title i,
#modal-quoi-manifestations .modal-title i,
#modal-quoi-activites .modal-title i,
#modal-quoi-hebergement .modal-title i,
#modal-quoi-restaurant .modal-title i {
    font-size: 1.5rem;
}

#modal-departements .btn-close,
#modal-activites .btn-close,
#modal-quoi-manifestations .btn-close,
#modal-quoi-activites .btn-close,
#modal-quoi-hebergement .btn-close,
#modal-quoi-restaurant .btn-close {
    filter: brightness(0) invert(1);
}

#modal-departements .modal-body,
#modal-activites .modal-body,
#modal-quoi-manifestations .modal-body,
#modal-quoi-activites .modal-body,
#modal-quoi-hebergement .modal-body,
#modal-quoi-restaurant .modal-body {
    padding: 2rem;
    max-height: 60vh;
}

/* Styles spécifiques pour modal-departements */
#modal-departements .form-check {
    margin-bottom: 0;
    padding: 0.15rem 0;
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

/* Fond de couleur léger pour les départements */
#modal-departements .row .form-check {
    background-color: #f8f9ff;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease;
}

#modal-departements .row .form-check:hover {
    background-color: #e8ecff;
}

#modal-departements .form-check-input {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

#modal-departements .form-check-label {
    padding-left: 0.4rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

/* Case à cocher pour sélectionner toute la région */
#modal-departements .region-select-all {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

#modal-departements .region-select-all:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alignement des cases à cocher des départements avec la région */
#modal-departements .row {
    padding-left: 0.5rem;
}

#modal-departements .row .form-check {
    padding-left: 0;
}

#modal-departements .row .form-check-input {
    margin-left: 0;
}

#modal-departements .modal-footer,
#modal-activites .modal-footer,
#modal-quoi-manifestations .modal-footer,
#modal-quoi-activites .modal-footer,
#modal-quoi-hebergement .modal-footer,
#modal-quoi-restaurant .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Badge de comptage dans les boutons Appliquer */
#dept-count-badge,
#activites-count-badge,
#manifestations-count-badge,
#hebergement-count-badge,
#restaurant-count-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

/* Bouton Appliquer */
#apply-dept-modal,
#apply-activites-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

#apply-dept-modal:hover,
#apply-activites-modal:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ============================================
   SYSTÈME DE 3 COLONNES CASCADÉES
   ============================================ */

/* Zone filtres actifs sticky */
/* ✨ AMÉLIORATION #3: Zone de filtres actifs sticky et plus visible */
.active-filters-zone {
    background: linear-gradient(135deg, #f0f4ff 0%, #e3f2fd 100%);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 0.8rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

#clear-all-filters {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    color: #6c757d !important;
    border-color: #6c757d !important;
    background: transparent !important;
}

#clear-all-filters:hover {
    background: #6c757d !important;
    color: white !important;
}

.active-filters-title {
    font-weight: 600;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.active-filters-title i {
    color: #667eea;
    font-size: 0.8rem;
}

#active-filters-count {
    font-weight: 700;
    color: #667eea;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    max-height: 50px;
    overflow-y: auto;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: white;
    border: 1px solid #667eea;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: #fff3f3;
    border-color: #f44336;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.filter-chip-remove:hover {
    transform: scale(1.2);
}

/* Barre de recherche dans modal */
.modal-search-bar {
    padding: 0;
    margin-bottom: 0.8rem;
}

.modal-search-bar input {
    border-radius: 20px;
    border: 2px solid #e0e0e0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.modal-search-bar input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Styles pour le modal */
#modal-activites .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

#modal-activites .modal-header .modal-title {
    font-weight: 600;
}

#modal-activites .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

#modal-activites .modal-header .btn-close:hover {
    opacity: 1;
}

#modal-activites .modal-body {
    padding: 0.8rem;
    background: #f8f9fa;
}

#modal-activites .modal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 0.8rem 1.5rem;
    background: white;
}

#modal-activites .modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

#modal-activites .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

#modal-activites .modal-footer .btn-secondary {
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    padding: 0.5rem 1.5rem;
}

#modal-activites .modal-footer .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* ============================================
   ZONE 1 : SÉLECTION DIRECTE
   ============================================ */

.direct-selection-zone {
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #fff5e6 0%, #fff9f0 100%);
    padding: 0.75rem 1rem;
}

.direct-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.direct-selection-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.direct-selection-count {
    background: #667eea;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
}

/* Grille des items directs - ultra compacte */
.direct-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.3rem;
}

/* Item direct - version ultra compacte identique à Zone 2 */
.direct-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.4rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.direct-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.direct-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8ecff 0%, #f0f4ff 100%);
}

.direct-item-checkbox {
    flex-shrink: 0;
    width: 0.85rem;
    height: 0.85rem;
    cursor: pointer;
    margin: 0;
}

.direct-item-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    user-select: none;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.direct-item.selected .direct-item-label {
    color: #667eea;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .direct-items-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ZONE 2 : SÉLECTION CASCADING
   ============================================ */

/* Conteneur des 3 colonnes */
.cascading-columns-container {
    display: flex;
    height: 400px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Chaque colonne */
.cascading-column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    background: #fafafa;
    transition: all 0.3s ease;
}

/* ✨ AMÉLIORATION #4: Couleurs progressives pour guider l'œil */
.column-level-1 {
    background: linear-gradient(180deg, #f8f9ff 0%, #f5f6ff 100%);
}

.column-level-2 {
    background: linear-gradient(180deg, #f0f4ff 0%, #ecf0ff 100%);
}

.cascading-column:last-child {
    border-right: none;
}

.cascading-column:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.cascading-column:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Largeurs des colonnes - Configuration pour 2 colonnes */
.column-level-1 {
    width: 35%;
    min-width: 250px;
    flex-shrink: 0;
}

.column-level-2 {
    width: 65%;
    min-width: 400px;
    flex-shrink: 0;
    background: white;
    border-left: 2px solid #e0e0e0;
}

/* Colonne 3 supprimée - non utilisée */

/* ✨ AMÉLIORATION #1: Headers de colonnes améliorés */
.column-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #5568d3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.column-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.column-title::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.column-level-1 .column-title::before {
    content: "\f07b"; /* Icône dossier */
}

.column-level-2 .column-title::before {
    content: "\f07c"; /* Icône dossier ouvert */
}

.column-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Contenu de colonne avec scroll */
.column-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem;
}

/* Afficher la colonne 2 en grille de 3 colonnes */
.column-level-2 .column-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.6rem;
    align-items: start;
    grid-auto-rows: min-content;
}

/* Colonne 3 supprimée - mode 2 colonnes uniquement */

.column-content::-webkit-scrollbar {
    width: 6px;
}

.column-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.column-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.column-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Titre de groupe pour Type3 dans la colonne 2 */
.type3-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #667eea;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-left: 3px solid #667eea;
    border-radius: 4px;
    grid-column: 1 / -1; /* Prendre toute la largeur de la grille (3 colonnes) */
}

.type3-group-title:first-child {
    margin-top: 0;
}

.type3-group-title i {
    font-size: 0.9rem;
    color: #667eea;
}

/* Items dans les colonnes */
.column-item {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.column-item:last-child {
    margin-bottom: 0;
}

/* Items de la colonne 2 en mode grille (pour checkboxes) */
.column-level-2 .column-item {
    margin-bottom: 0;
    padding: 0.3rem 0.4rem;
    display: flex;
    align-items: center;
    height: auto;
}

.column-level-2 .column-item .item-label {
    width: 100%;
    gap: 0.25rem;
    display: flex;
    align-items: center;
}

.column-level-2 .column-item .item-text {
    font-size: 0.8rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-level-2 .column-item .item-checkbox {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}


/* ✨ États hover améliorés avec élévation */
.column-item:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

/* Style pour les items sélectionnés dans la colonne 2 (mode grille) */
.column-level-2 .column-item:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

/* ✨ AMÉLIORATION #2: Items sélectionnés plus visuels */
.column-level-2 .column-item.selected {
    background: linear-gradient(135deg, #f0f0ff 0%, #f8f6ff 100%);
    border-color: #667eea;
    border-left: 3px solid #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
    position: relative;
}

.column-level-2 .column-item.selected::before {
    content: "✓";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-weight: bold;
    font-size: 0.9rem;
}

.column-level-2 .column-item.selected .item-text {
    color: #5a67d8 !important;
    font-weight: 600;
}

.column-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* Marquer les éléments de colonne 1 qui ont des sous-éléments sélectionnés (mais pas actifs) */
.column-level-1 .column-item.has-selection:not(.active) {
    border-left: 4px solid #667eea;
    background: #f0f0ff;
}

.column-level-1 .column-item.has-selection:not(.active) .item-text {
    color: #5a67d8;
    font-weight: 600;
}

.column-level-1 .column-item.has-selection:not(.active) .item-count {
    background: #667eea;
    color: white;
}

/* Si l'élément est actif ET a des sélections : garder le style actif avec bordure */
.column-level-1 .column-item.active.has-selection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-left: 4px solid #764ba2;
}

.column-level-1 .column-item.active.has-selection .item-text {
    color: white;
}

.column-level-1 .column-item.active.has-selection .item-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.column-item.active .item-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.item-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.item-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #667eea;
}

.item-text {
    font-size: 0.85rem;
    line-height: 1.3;
    color: #333;
}

.item-count {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.3rem;
}

.selection-badge {
    color: #4caf50;
    font-weight: 700;
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

.column-level-1 .column-item.has-selection .selection-badge {
    color: #2e7d32;
}

.column-level-1 .column-item.active .selection-badge {
    color: white;
}

.item-icon {
    color: #667eea;
    font-size: 0.9rem;
    margin-right: 0.3rem;
}

/* Styles spécifiques pour la colonne 3 déjà définis plus haut */

/* État vide */
.column-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9e9e9e;
}

.column-empty-state i {
    font-size: 3rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .cascading-columns-container {
        height: 450px;
    }

    .column-level-1 {
        width: 40%;
        min-width: 200px;
    }

    .column-level-2 {
        width: 60%;
        min-width: 300px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .cascading-columns-container {
        flex-direction: column;
        height: auto;
        max-height: 500px;
    }

    .cascading-column {
        width: 100% !important;
        min-width: 100% !important;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        height: 200px;
    }

    .cascading-column:last-child {
        border-bottom: none;
    }

    .active-filters-zone {
        padding: 0.75rem 1rem;
    }

    .filter-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}
