/* ============================================
   CSS du module "Où" (ou-module.js)
   Styles pour le dropdown, régions, départements, ville
   ============================================ */

/* Dropdown Où - dimensionnement */
#ou-dropdown {
    min-width: 100%;
    max-width: none;
}

@media (max-width: 576px) {
    #ou-dropdown {
        min-width: 0;
        max-width: none;
        width: calc(100vw - 2rem);
    }
}

/* Onglets Où en gras */
#ou-dropdown .tab-btn {
    font-weight: 700;
}

/* Bouton Appliquer dans le dropdown Où */
.ou-dropdown-apply {
    padding: 0.75rem 0.5rem 0.5rem 0.5rem;
    border-top: 2px solid #e9ecef;
    margin-top: 0.5rem;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

/* 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;
    background: #fafafa;
}

#regions-container-compact .region-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.25rem 0.65rem 0.25rem 0.75rem;
    margin-bottom: 0.25rem;
    min-height: 28px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    line-height: 1;
    gap: 0.4rem;
}

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

#regions-container-compact .form-check {
    display: flex !important;
    align-items: center;
    padding-left: 0.25rem;
    margin-bottom: 0;
    min-height: 24px;
    flex-shrink: 0;
    gap: 0.35rem;
}

#regions-container-compact .form-check-input {
    margin-top: 0;
    margin-right: 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    min-width: 16px;
}

#regions-container-compact .form-check-label {
    cursor: pointer;
    user-select: none;
    color: #212529 !important;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0;
    padding: 0.15rem 0.4rem;
    line-height: 1.2;
}

/* Départements */
.departements-scroll-container {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

#departements-container-compact {
    padding: 0.5rem;
}

/* Accordéons régions (onglet Département) */
.accordion-region {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-region .accordion-header {
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.accordion-region .accordion-header i {
    transition: transform 0.2s;
}

.accordion-region.open .accordion-header i {
    transform: rotate(180deg);
}

.accordion-region .accordion-body {
    display: none;
    padding: 0.5rem 1rem;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 1rem;
}

.accordion-region.open .accordion-body {
    display: grid;
}

.accordion-body .checkbox-item {
    font-size: 0.85rem;
    color: #2c3e50;
}

/* Ville - distance row */
.distance-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-top: 0.75rem;
}

.distance-select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Bouton sticky "Sélection par département" */
.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: #2c3e50;
    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;
}

/* ============================================
   Modal départements
   ============================================ */

#modal-departements .modal-content {
    border-radius: 15px;
    border: none;
}

#modal-departements .modal-header {
    background: #2c3e50;
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
}

#modal-departements .modal-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#modal-departements .modal-title i {
    font-size: 1.5rem;
}

#modal-departements .btn-close {
    filter: brightness(0) invert(1);
}

#modal-departements .modal-body {
    padding: 2rem;
    max-height: 60vh;
}

#modal-departements .form-check {
    margin-bottom: 0;
    padding: 0.15rem 0;
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

#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;
}

#modal-departements .region-select-all {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

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

/* Colonnes responsive pour les départements dans le modal */
.modal-dept-col {
    width: 16.666667%;
    flex: 0 0 16.666667%;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .modal-dept-col {
        width: 50%;
        flex: 0 0 50%;
    }
}

@media (max-width: 399.98px) {
    .modal-dept-col {
        width: 100%;
        flex: 0 0 100%;
    }
}

#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 {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Badge de comptage et bouton Appliquer */
#dept-count-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

#apply-dept-modal {
    background: #2c3e50;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

#apply-dept-modal:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #2c3e50 100%);
}
