/* Fichier: css/profil.css */
/* Rôle: Styles spécifiques pour la page profil.php */
/* MODIFIÉ: Transformation des .back-links en boutons */

/* Animation pour le nom */
@keyframes textGradientShine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Le body est déjà stylé globalement, pas besoin de le redéfinir sauf si spécificité */
.profile-container {
    max-width: 1000px;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color, #005a87) 0%, #007bb5 100%); 
    color: white;
    padding: 2.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    gap: 1.5rem;
    border-bottom: 5px solid var(--accent-color, #f0c808); 
    text-align: center; 
}

/* Logo plus grand - PLUS de cercle, centré */
.profile-logo {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 100%; 
    margin-bottom: 1rem; 
}

.profile-logo img {
     width: 80%; 
     max-width: 350px; 
     height: auto; 
     border-radius: var(--border-radius-sm, 8px); 
     object-fit: contain; 
     border: none; 
     background-color: transparent; 
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 
}
.profile-logo .placeholder { 
    width: 80%;
    max-width: 350px;
    height: auto; 
    min-height: 150px; 
    padding-top: 20%; 
    padding-bottom: 20%;
    background-color: #e9ecef;
    border-radius: var(--border-radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: clamp(3rem, 10vw, 5rem); 
    border: none;
}

.profile-title {
    flex-grow: 0; 
    width: 100%; 
}
/* Nom plus grand et animé - Centré */
.profile-title h1 {
    margin: 0 0 0.5rem 0;
    font-size: clamp(2rem, 6vw, 3rem); 
    line-height: 1.1;
    font-weight: 800; 
    /* Couleur animée */
    background: linear-gradient(to right, #ffffff, var(--accent-color, #f0c808), #ffffff);
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    text-fill-color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradientShine 4s linear infinite;
    text-align: center; 
}
.profile-title .metiers {
    font-size: 1.2rem;
    opacity: 0.9;
    word-wrap: break-word;
    font-weight: 400;
    text-align: center; 
}

.profile-content {
    padding: 2.5rem 2rem;
}

/* Layout Grid */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr; /* Une colonne par défaut (mobile) */
    gap: 30px;
}
 @media (min-width: 800px) {
     .profile-grid {
         grid-template-columns: 300px 1fr; /* Sidebar + Main sur desktop */
         gap: 40px;
     }
     .profile-sidebar {
         order: -1; /* Met la sidebar à gauche sur desktop */
     }
 }

.profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.profile-main {
    /* Contient contact, détails et zone */
}

/* QR Code bien centré */
.qrcode-container-profil {
    margin-bottom: 20px;
    text-align: center; 
    cursor: pointer;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius-md, 12px);
    border: 1px solid var(--border-color, #e0e0e0);
}
.qrcode-container-profil p {
    margin: 0 0 10px 0;
    font-size: 0.85em;
    color: var(--text-light, #576574);
}
.qrcode-container-profil canvas, .qrcode-container-profil img {
    display: inline-block; 
    border: 1px solid #eee;
    padding: 5px;
    background: white;
    border-radius: var(--border-radius-sm, 8px);
}

/* Boutons Actions */
.contact-buttons-profil {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}
.small-button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.contact-buttons-profil .contact-btn,
.contact-buttons-profil .action-button {
    width: 100%;
    padding: 12px;
    font-size: 0.9em;
    /* Styles de base des boutons (couleurs ci-dessous) */
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; /* Réduit l'espace icône/texte */
    color: white !important;
    text-decoration: none; font-weight: 600; border-radius: 50px;
    border: none; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.contact-buttons-profil .contact-btn:hover,
.contact-buttons-profil .action-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}
/* Le bouton "Faire une demande" utilise action-button */
.contact-buttons-profil .action-button {
    /* Style spécifique si besoin, sinon hérite de .contact-btn */
}

/* Couleurs spécifiques des boutons (héritées ou définies ici) */
.btn-tel { background: linear-gradient(45deg, #f0c808, #f7b733); color: var(--text-dark, #2c3e50) !important; }
.btn-whatsapp { background: linear-gradient(45deg, #25D366, #128C7E); }
.btn-sms { background: linear-gradient(45deg, #343a40, #212529); }
.btn-email { background: linear-gradient(45deg, var(--danger-color, #dc3545), #c82333); }
.btn-action { background: linear-gradient(45deg, var(--request-color, #6f42c1), #5a2b9d); }
.btn-vcard { background: linear-gradient(45deg, var(--vcard-color, #0d6efd), #0a58ca); }
.btn-share-whatsapp { background: linear-gradient(45deg, var(--share-color, #576574), #2c3e50); }


/* Sections Contenu */
.profile-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
.profile-section:last-of-type {
    border-bottom: none; /* Enlève bordure dernière section */
}
.profile-section h2 {
    color: var(--primary-color, #005a87);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color, #f0c808);
    display: inline-block;
    font-weight: 600;
}
.profile-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    font-size: 1rem;
    line-height: 1.6;
}
.profile-info-item i {
    color: var(--primary-color, #005a87);
    font-size: 1.2em;
    margin-right: 15px;
    width: 25px;
    text-align: center;
    padding-top: 4px;
    flex-shrink: 0;
}
.profile-info-item span {
    flex-grow: 1;
    word-break: break-word;
}
.profile-info-item strong {
    display: block;
    margin-bottom: 2px;
    color: #555;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-info-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}
.profile-info-item a:hover {
    color: var(--primary-color, #005a87);
    text-decoration: underline;
}

/* SIRET lien Google */
.siret-info a {
     font-size: 0.8em; margin-left: 10px; color: #4285F4; /* Couleur Google */ text-decoration: none;
     border: 1px solid #4285F4; padding: 2px 6px; border-radius: 4px; transition: all 0.2s ease;
     white-space: nowrap;
}
.siret-info a:hover { background-color: #4285F4; color: white; }

.badge-urgence {
    background-color: var(--danger-color, #dc3545);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: 10px;
    display: inline-block;
}
.horaires, .commentaire-section {
    white-space: pre-wrap;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid #eee;
    font-size: 0.95em;
    margin-top: 0.5rem;
}

/* Nouveau Style pour Zone d'intervention */
.zone-info {
    background-color: #eef7ff; /* Fond bleu très clair */
    padding: 1.5rem;
    border-radius: var(--border-radius-md, 12px);
    border: 1px solid #cce5ff; /* Bordure bleu clair */
}
.zone-info h2 {
    color: #004085; /* Bleu plus foncé pour le titre */
    border-bottom-color: #005a87; /* Bordure sous titre plus foncée */
}
.zone-info p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}
.zone-info strong {
    color: #004085;
}

#map {
    height: 350px;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid #ccc;
    margin-top: 1rem;
    z-index: 1; /* Pour être sûr qu'elle est cliquable */
}
.communes-list-container {
    margin-top: 1rem;
}
.communes-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; /* Grid layout */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Colonnes responsives */
    gap: 10px;
}
.communes-list li {
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 0.9em;
    color: #333;
    display: flex;
    align-items: center;
}
.communes-list li i {
    color: var(--success-color, #28a745);
    margin-right: 8px;
    font-size: 0.8em;
}

/* Section Flyers */
.flyers-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.flyers-section h2 {
    color: var(--primary-color, #005a87);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
}
.flyers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.flyer-item-profil {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}
.flyer-item-profil:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft, 0 4px 15px rgba(0, 0, 0, 0.1));
}
.flyer-item-profil img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 250px; /* Limite hauteur */
    margin: 0 auto;
    padding: 5px;
}
.flyer-item-profil p {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-light, #576574);
    padding: 8px;
    margin: 0;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color, #e0e0e0);
}


/* Messages, Liens retour, Footer, Last Update */
.error-message { text-align: center; color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 1.5rem; border-radius: var(--border-radius-sm, 8px); margin: 2rem; }

/* * ============================================
 * 💥 CORRECTION: Transformation des liens en boutons 💥
 * ============================================
 */
.back-links { 
    text-align: center; 
    margin-top: 2rem; 
    display: flex; /* Utilisation de flexbox */
    flex-direction: column; /* Empiler verticalement */
    align-items: center; /* Centrer les boutons */
    gap: 15px; /* Espace entre les boutons */
}
.back-links a { 
    /* Appliquer les styles de bouton ronds */
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    padding: 12px 25px;
    color: white !important;
    text-decoration: none; 
    font-weight: 600; 
    border-radius: 50px; 
    font-size: 0.95em; 
    border: none; 
    cursor: pointer;
    transition: all 0.3s ease; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    min-width: 250px; /* Largeur minimale */
}
.back-links a:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
    text-decoration: none; /* S'assurer qu'il n'y a pas de soulignement au survol */
}
/* Couleur spécifique pour "Retour aux résultats" */
.back-links a[href*="search.php"] {
    background: linear-gradient(45deg, var(--secondary-color, #007bff), #0a58ca);
}
/* Couleur spécifique pour "Retour à l'accueil" */
.back-links a[href="index.php"] {
    background: linear-gradient(45deg, var(--share-color, #576574), #2c3e50);
}
/* ---------------- FIN CORRECTION ---------------- */


footer { text-align: center; margin-top: 2rem; padding: 1rem; border-top: 1px solid #eee; color: #888; font-size: 0.9rem; }
#last-update { /* Styles inchangés de style.css, sauf si besoin de spécificité */ }

/* Media Queries spécifiques au profil si nécessaire */
@media (max-width: 500px) {
    .profile-header { flex-direction: column; text-align: center; padding: 1.5rem 1rem; /* Moins de padding sur petit écran */}
    .profile-title h1 { font-size: 1.8rem; /* Plus petit sur très petit écran */ }
    .profile-title .metiers { font-size: 1.1rem; }
    .profile-grid { grid-template-columns: 1fr; } /* Une seule colonne */
    .profile-sidebar { order: 0; } /* Ordre par défaut */
    .communes-list { grid-template-columns: 1fr; } /* Une colonne pour communes */
    .profile-logo img { max-width: 150px; /* Logo un peu plus petit sur mobile */ }
    .profile-logo .placeholder { max-width: 150px; font-size: 4rem; }
    .profile-content { padding: 1.5rem 1rem; /* Moins de padding sur petit écran */}
    
    .back-links a {
        min-width: 90%; /* Boutons pleine largeur sur mobile */
    }
}