/* Style général pour la grille des associations */
.association-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Style des cartes individuelles */
.association-card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.association-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Style de l'en-tête de la carte avec fond coloré (logo + nom) */
.association-header {
    background: #f0f8ff;
    padding: 15px 20px 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.association-header:hover {
    background: #e6f2ff;
}

.association-header img {
    max-width: 100%;
    max-height: 80px;
    height: auto;
    margin: 0 auto 10px;
    display: block;
    background: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.association-header h2 {
    margin: 10px 0 0;
    font-size: 1.3em;
    color: #343a40;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
}

/* Détails de l'association */
.association-card-body {
    padding: 20px;
}

.association-card-body p {
    margin: 8px 0;
}

.association-card-body p strong {
    margin-right: 5px;
    font-weight: bold;
}

/* Section Président */
.president {
    margin-top: 15px;
    padding: 12px;
    border-top: 1px solid #eee;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.president h3 {
    font-size: 1em;
    color: #333;
    margin-bottom: 8px;
    font-weight: bold;
}

.president p {
    margin: 5px 0;
    font-size: 0.9em;
}
/* Pied de carte */
.association-card-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Bouton "En savoir plus" */
.more-info-button {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: 1px solid #0069d9;
}

.more-info-button:hover {
    background: #18B5F2;
    transform: translateY(-5px);
}

/* Style du formulaire de recherche */
.association-search-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group input[type="submit"] {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-group input[type="submit"]:hover {
    background-color: #218838;
}

/* Style pour la page de détail d'une association */
.association-details {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
}

.association-details-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.association-details-header img {
    max-width: 200px;
    max-height: 200px;
    margin-bottom: 15px;
}

.association-details-header h2 {
    font-size: 1.8em;
    color: #333;
    margin: 0;
}

.association-details-content h2 {
    color: #007bff;
    margin-top: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.association-details-content ul {
    list-style: none;
    padding: 0;
}

.association-details-content li {
    margin: 10px 0;
}

/* Style pour la section des présidents dans la page de détail */
.association-details-content .president-section {
    margin-top: 20px;
}

.president-section h3 {
    color: #007bff;
    border-left: 4px solid #007bff;
    padding-left: 10px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.president-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.president-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.president-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.president-phone {
    margin-bottom: 5px;
    color: #555;
}

.president-phone a {
    color: #007bff;
    text-decoration: none;
}

.president-phone a:hover {
    text-decoration: underline;
}

.president-divers {
    margin-top: 5px;
    color: #555;
}

/* Style responsive pour les petits écrans */
@media (max-width: 768px) {
    .association-results-grid {
        grid-template-columns: 1fr;
    }
}

/* Correction des libellés et champs */
.association-search-form .form-group label {
    white-space: nowrap;
    display: inline-block;
    width: auto;
    max-width: none;
    font-family: 'Amaranth', sans-serif !important;
    font-size: 16px;
    margin-right: 10px;
}

.association-search-form .form-group input[type="text"],
.association-search-form .form-group select {
    width: 50%;
    display: inline-block;
    vertical-align: middle;
    font-family: 'Amaranth', sans-serif !important;
}

.association-search-form .form-group input[type="submit"] {
    white-space: nowrap;
    padding: 5px 15px;
    font-family: 'Amaranth', sans-serif !important;
}

/* Assurer que le conteneur ne limite pas la largeur */
.association-search-form .form-group {
    width: 100%;
    margin-bottom: 15px;
}


/* =========================================================
   MOTEUR DE RECHERCHE DES PROFESSIONNELS
   ========================================================= */

/* Grille des professionnels */
.professionnel-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Carte individuelle */
.professionnel-card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.professionnel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* En-tête de la carte */
.professionnel-header {
    background: #f0f8ff;
    padding: 15px 20px 10px;
    text-align: center;
    width: 100%;
    height: 175px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.professionnel-header:hover {
    background: #e6f2ff;
}

/* Logo / photo */
.professionnel-logo {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 120px;
    height: auto;
    margin: 5px 0 0;
    text-align: center;
    background: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

/* Nom du professionnel */
.professionnel-header h2 {
    margin: 10px 0 0;
    font-size: 1.3em;
    color: #343a40;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
}

/* Corps de la carte */
.professionnel-card-body {
    padding: 20px;
    flex: 1;
}

/* Paragraphes */
.professionnel-card-body p {
    margin: 8px 0;
    line-height: 1.4;
}

/* Libellés */
.professionnel-card-body p strong {
    margin-right: 5px;
    font-weight: bold;
}

/* Liens */
.professionnel-card-body a {
    color: #007bff;
    text-decoration: none;
}

.professionnel-card-body a:hover {
    text-decoration: underline;
}

/* Pied de carte */
.professionnel-card-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Formulaire de recherche */
.professionnel-search-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Champs du formulaire */
.professionnel-search-form .form-group {
    width: 100%;
    margin-bottom: 15px;
}

/* Libellés */
.professionnel-search-form .form-group label {
    white-space: nowrap;
    display: inline-block;
    width: auto;
    max-width: none;
    font-family: 'Amaranth', sans-serif !important;
    font-size: 16px;
    margin-right: 10px;
}

/* Champ texte et liste */
.professionnel-search-form .form-group input[type="text"],
.professionnel-search-form .form-group select {
    width: 50%;
    display: inline-block;
    vertical-align: middle;
    font-family: 'Amaranth', sans-serif !important;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Bouton rechercher */
.professionnel-search-form .form-group input[type="submit"] {
    white-space: nowrap;
    padding: 5px 15px;
    font-family: 'Amaranth', sans-serif !important;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.professionnel-search-form .form-group input[type="submit"]:hover {
    background-color: #218838;
}

/* Responsive */
@media (max-width: 992px) {

    .professionnel-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 768px) {

    .professionnel-results-grid {
        grid-template-columns: 1fr;
    }

    .professionnel-search-form .form-group input[type="text"],
    .professionnel-search-form .form-group select {
        width: 100%;
        margin-top: 5px;
    }

}

.professionnel-logo-placeholder {
    width: 170px;
    height: 120px;
    margin: 0 auto 10px;
}

/* --------------------------------------------------
   Centrage du nom lorsqu'il n'y a pas de photo
   -------------------------------------------------- */

.professionnel-header:not(:has(.professionnel-logo)) .professionnel-logo-placeholder {
    display: none;
}

.professionnel-header:not(:has(.professionnel-logo)) h2 {
    margin: 0;
}

/* TEST GRILLE SERVICES */
.professionnel-results-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    width: 100% !important;
}

.professionnel-card {
    width: auto !important;
}

/* =========================================================
   FICHE DETAIL ASSOCIATION
   Même présentation que les fiches entités
   ========================================================= */

.entite-detail {
    width: 100%;
    max-width: 1000px;
    margin: 50px auto !important;
    padding: 0 20px;
    box-sizing: border-box;
}


/* ---------------------------------------------------------
   En-tête
   --------------------------------------------------------- */

.entite-detail-header {
    background: #ffffff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}


/* Type / domaine */

.entite-detail-domain {
    background: #d9efff;
    border-left: 5px solid #007bff;
    border-radius: 6px;
    padding: 12px 18px;
    margin-bottom: 25px;
    color: #005b96;
    font-size: 1.3em;
    font-weight: bold;
    text-transform: uppercase;
    text-align: left;
}


/* Logo */

.entite-detail-logo {
    display: block;
    max-width: 300px;
    max-height: 250px;
    width: auto;
    height: auto;
    margin: 0 auto 25px;
}


/* Nom */

.entite-detail-header h1 {
    margin: 0;
}


/* ---------------------------------------------------------
   Contenu
   --------------------------------------------------------- */

.entite-detail-content {
    background: #ffffff;
}


/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.entite-detail-section {
    margin-bottom: 30px;
}

.entite-detail-section h2 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
    font-size: 1.6em;
    font-weight: normal;
}

.entite-detail-section p {
    margin: 8px 0;
    line-height: 1.5;
}


/* ---------------------------------------------------------
   Président
   --------------------------------------------------------- */

.entite-detail-section .president-item {
    background: #f8f8f8;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}


/* ---------------------------------------------------------
   Pied de fiche
   --------------------------------------------------------- */

.entite-detail-footer {
    margin-top: 30px;
    padding-top: 20px;
}


/* ---------------------------------------------------------
   Bouton retour
   --------------------------------------------------------- */

.entite-detail-footer a.return-button,
.entite-detail-footer a.return-button:visited {
    display: inline-block !important;
    background-color: #6c757d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 15px;
    border-radius: 5px;
}

.entite-detail-footer a.return-button:hover,
.entite-detail-footer a.return-button:focus {
    background-color: #007bff !important;
    color: #ffffff !important;
    text-decoration: none !important;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .entite-detail {
        margin: 30px auto !important;
        padding: 0 15px;
    }

    .entite-detail-header {
        padding: 20px;
    }

    .entite-detail-domain {
        font-size: 1.1em;
    }

    .entite-detail-logo {
        max-width: 250px;
        max-height: 200px;
    }

}

.entite-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

.entite-detail-title-row h1 {
    margin: 0;
}

.entite-detail-title-row .return-button {
    flex-shrink: 0;
    margin: 0;
    display: inline-block;
    background-color: #6c757d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 15px;
    border-radius: 5px;
}

.entite-detail-title-row .return-button:hover {
    background-color: #007bff !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

@media (max-width: 768px) {

    .entite-detail-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

}

.association-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
}

.association-title {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 1;
    min-width: 0;
}

.association-title h2 {
    margin: 0;
    font-family: 'Amaranth', sans-serif !important;
    font-size: 2em;
    color: #005b96;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.association-title-row .more-info-button {
    flex-shrink: 0;
}

/* Logo sur la fiche détail d'une association */
.association-title .association-logo {
    display: block;
    max-width: 350px;
    max-height: 220px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 8px;
    object-fit: contain;
    flex-shrink: 0;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .association-title-row {
        flex-direction: column;
        align-items: center;
    }

    .association-title {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .association-title .association-logo {
        max-width: 250px;
        max-height: 200px;
    }

    .association-title h2 {
        text-align: center;
    }

    .association-title-row .more-info-button {
        align-self: center;
    }

}