/**
 * Styles pour la modale de détails adhérent - Annuaire public
 */

/* ==================== Modale Container ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-container {
    position: relative;
    z-index: 10000;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

#modalContent {
    max-height: 90vh;
    overflow-y: auto;
}

/* ==================== Header ==================== */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    border-bottom: 1px solid #ecf0f1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-title h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ==================== Body ==================== */
.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2.5rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem;
}

/* ==================== Stats ==================== */
.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.stat-item.stat-highlight {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-item.stat-highlight .stat-value {
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.stat-item.stat-highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== Prix PNCC ==================== */
.prix-pncc-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prix-pncc-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.2s;
}

.prix-pncc-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prix-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    height: fit-content;
}

.badge-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.badge-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
    color: #000;
}

.badge-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
}

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

.badge-special {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.prix-content {
    flex: 1;
}

.prix-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #2c3e50;
}

.prix-meta {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.prix-description {
    margin: 0;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.6;
}

/* ==================== Contact Info ==================== */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s;
}

.contact-item:hover {
    background: #e9ecef;
}

.contact-icon {
    width: 20px;
    height: 20px;
    stroke: #667eea;
    stroke-width: 2;
    flex-shrink: 0;
}

.contact-item a {
    color: #2c3e50;
    text-decoration: none;
    word-break: break-word;
}

.contact-item a:hover {
    color: #667eea;
}

/* ==================== Réalisations Grid ==================== */
.realisations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.realisation-card-modal {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.realisation-card-modal:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.realisation-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
}

.realisation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.realisation-card-modal:hover .realisation-image img {
    transform: scale(1.05);
}

.image-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

.realisation-content {
    padding: 1.25rem;
}

.realisation-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    color: #2c3e50;
}

.realisation-meta {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.realisation-surface {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #667eea;
}

.realisation-description {
    margin: 0;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
}

/* ==================== Loader ==================== */
.loader {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader p {
    color: #7f8c8d;
    margin: 0;
}

/* ==================== Messages ==================== */
.error-message {
    text-align: center;
    padding: 3rem;
    color: #e74c3c;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.text-muted {
    color: #7f8c8d;
    font-style: italic;
}

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

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .modal {
        padding: 0;
    }

    .modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    #modalContent {
        max-height: 100vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .realisations-grid {
        grid-template-columns: 1fr;
    }

    .prix-pncc-item {
        flex-direction: column;
    }

    .prix-badge {
        width: fit-content;
    }
}

@media (max-width: 480px) {
    .modal-stats {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ==================== Accessibilité ==================== */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-container,
    .modal-close,
    .realisation-card-modal,
    .realisation-image img {
        animation: none;
        transition: none;
    }
}

/* Focus visible pour l'accessibilité */
.modal-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.contact-item a:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

.realisation-card-modal:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ==================== Couleurs Header selon statut ==================== */
/* Adhérent mis en avant - Or doré */
.modal-header-featured {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border-bottom: 3px solid #DAA520;
}

.modal-header-featured .modal-close {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.modal-header-featured .modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Adhérent CenC - Marron Construire en Chanvre */
.modal-header-member {
    background: linear-gradient(135deg, #8B5A3C 0%, #5D4037 100%);
    color: white;
    border-bottom: 3px solid #6D4C41;
}

.modal-header-member .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-header-member .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Utilisateur basique - Gris/Bleu classique */
.modal-header-basic {
    background: linear-gradient(135deg, #78909C 0%, #546E7A 100%);
    color: white;
    border-bottom: 3px solid #607D8B;
}

.modal-header-basic .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-header-basic .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Badges de statut ==================== */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-featured {
    background: rgba(255, 255, 255, 0.25);
    color: #000;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.status-member {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ==================== Bouton contact email ==================== */
.contact-email-button {
    grid-column: 1 / -1;
}

.btn-contact-email {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--cenc-orange, #E67E22) 0%, #D35400 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.btn-contact-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
    background: linear-gradient(135deg, #D35400 0%, #CA6F1E 100%);
}

.btn-contact-email:active {
    transform: translateY(0);
}

.btn-contact-email .contact-icon {
    stroke: white;
}

/* ==================== Informations détaillées ==================== */
.info-block {
    margin-bottom: 1.5rem;
}

.info-block:last-child {
    margin-bottom: 0;
}

.info-block h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.info-block p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* ==================== Tags (Spécialisations, Certifications) ==================== */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    color: white;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-cert {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
}

/* ==================== Réseaux sociaux ==================== */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.social-link:hover {
    background: var(--cenc-orange, #E67E22);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.social-link span {
    font-size: 1.1rem;
}
