/* Conteneur principal */
#annuaire-elus {
    padding: 20px;
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto; /* Centre l'annuaire */
}

/* 🔎 Barre de recherche et bouton "Afficher plus de filtres" */
.search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.toggle-filters-btn {
    background-color: #0073aa;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-filters-btn:hover {
    background-color: #005f8d;
}

/* 🛠️ Zone des filtres avancés (cachés par défaut) */
.filters {
    display: none; /* Caché par défaut */
    flex-wrap: wrap;
    gap: 10px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.filters select {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

/* ✉️ Section d'envoi d'email */
.email-section {
    text-align: center;
    margin-bottom: 10px;
}

.mail-button {
    padding: 10px 15px;
    font-size: 14px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.mail-button:hover {
    background: #005f8d;
}

/* Texte explicatif sous le bouton "Envoyer un mail" */
.email-info {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* 📜 Liste des élus */
.elus-list-container {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.elus-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* 🎭 Carte des élus */
.elu {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    width: 100%;
    overflow: hidden;
}

.elu:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.elu-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* Style personnalisé pour les checkboxes */
.elu-checkbox {
    display: none;
}

.checkbox-label {
    width: 24px;
    height: 24px;
    border: 2px solid #0073aa;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background-color: rgba(0, 115, 170, 0.1);
}

.elu-checkbox:checked + .checkbox-label {
    background-color: #0073aa;
}

.elu-checkbox:checked + .checkbox-label::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.elu-content {
    flex: 1;
    display: flex;
}

.elu-link {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.elu-photo {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 2px solid #f0f0f0;
    background: #f8f8f8;
}

.elu-info {
    flex: 1;
    min-width: 0;
}

.elu-name {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elu-details {
    font-size: 14px;
    color: #666;
}

.elu-profession {
    color: #ef0a0a;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elu-pays {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .elu-photo {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .elu-name {
        font-size: 16px;
    }

    .elu-details {
        font-size: 13px;
    }

    .elu-link {
        padding: 10px;
    }

    .elu-checkbox-wrapper {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .elu-photo {
        width: 50px;
        height: 50px;
        min-width: 50px;
        margin-right: 10px;
    }
}

/* 📱 Responsive */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .toggle-filters-btn {
        width: 100%;
        text-align: center;
    }

    .filters {
        flex-direction: column;
    }

    .elus-list {
        flex-direction: column;
    }
}

/* Bandeau flottant pour l'envoi d'email */
#email-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 115, 170, 0.95);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    transition: bottom 0.3s ease-in-out;
}

.selected-elus {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.selected-elus img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mail-button {
    background: white;
    color: #0073aa;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mail-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    #email-banner {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }
    
    .mail-button {
        width: 100%;
        text-align: center;
    }
}

/* Styles pour le popup d'envoi d'email */
.mail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.mail-popup.hidden {
    display: none;
}

.mail-popup-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.mail-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.mail-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #666;
}

.close-popup:hover {
    color: #333;
}

.recipients-section {
    margin-bottom: 25px;
}

.recipients-section h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 1.1em;
}

.selected-elus-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.selected-elu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.selected-elu-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    background: #f8f8f8;
}

.selected-elu-name {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-form .form-group {
    margin-bottom: 20px;
}

.mail-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.mail-form input,
.mail-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.mail-form input:focus,
.mail-form textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.mail-form input::placeholder,
.mail-form textarea::placeholder {
    color: #999;
}

.mail-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.required-fields {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.send-button {
    background: #0073aa;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
}

.send-button:hover {
    background: #005177;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .mail-popup-content {
        padding: 20px;
        width: 95%;
    }

    .mail-popup-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .send-button {
        width: 100%;
    }
}