/* ==================================================
   VARIABLES & RESET MODERNISÉS
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;      /* Indigo lumineux */
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;    /* Rose élégant */
    --dark-color: #0f172a;         /* Slate foncé très élégant */
    --light-color: #f8fafc;        /* Gris très clair bleuté */
    --success-color: #10b981;      /* Vert */
    --danger-color: #ef4444;       /* Rouge */
    --white: #ffffff;
    --text-color: #334155;         /* Slate texte doux */
    --border-color: #e2e8f0;       /* Bordure fine propre */
    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    -webkit-font-smoothing: antialiased;
}

/* ==================================================
   CONTENEUR & STRUCTURE
   ================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ==================================================
   BOUTONS
   ================================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.8rem 1.6rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s ease;
    font-weight: 600;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.04);
    color: var(--primary-color);
}

.btn-large {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 0.85rem;
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s ease;
    font-weight: 700;
    margin-top: 1.5rem;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.3);
}

.btn-large:hover {
    background-color: #db2777;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

/* ==================================================
   SECTION HERO
   ================================================== */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    color: var(--white);
    padding: 6rem 0;
    margin-bottom: 3rem;
    border-radius: 0 0 2.5rem 2.5rem;
    box-shadow: var(--shadow-lg);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    font-weight: 400;
}

.hero-image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ==================================================
   SECTION FEATURES & HOW IT WORKS
   ================================================== */
.features, .how-it-works {
    padding: 5rem 0;
    background-color: var(--white);
    margin-bottom: 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.features h2, .how-it-works h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.features-grid, .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.feature-card, .step {
    background-color: var(--light-color);
    padding: 2.5rem 2rem;
    border-radius: 1.25rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

.feature-card:hover, .step:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background-color: var(--white);
}

/* ==================================================
   FORMULAIRES
   ================================================== */
.form-container {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    margin: 2rem auto;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fafafa;
    color: var(--text-color);
    transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* ==================================================
   SYSTÈMES DE CHAT & MESSAGERIE (REFONTE COMPLÈTE)
   ================================================== */
.messages-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 90px);
}

.messages-list {
    background-color: var(--white);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.chat-window {
    background-color: var(--white);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chat-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--dark-color);
    background-color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background-color: #fcfcfd;
}

/* Bulle de message individuelle */
.message {
    display: flex;
    width: 100%;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}

.message.sent .message-content-wrapper {
    align-items: flex-end;
}

.message.received .message-content-wrapper {
    align-items: flex-start;
}

.message-bubble {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    padding: 0.75rem 1rem;
    border-radius: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.message.received .message-bubble {
    background-color: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.35rem;
}

.message-text {
    flex: 1;
    min-width: 0;
}

.message-time {
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0.8;
    flex-shrink: 0;
    margin-bottom: 1px;
    font-weight: 500;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message.received .message-time {
    color: #94a3b8;
}

.message-modified {
    font-size: 0.65rem;
    font-style: italic;
    opacity: 0.7;
    margin-right: 4px;
}

/* Actions de message (Modifier / Supprimer) subtiles au survol */
.message-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-content-wrapper:hover .message-actions {
    opacity: 1;
}

.message-action {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.edit-message:hover {
    background-color: var(--primary-color);
    color: white;
}

.delete-message:hover {
    background-color: var(--danger-color);
    color: white;
}

/* ==================================================
   ZONE D'ÉCRITURE DU CHAT
   ================================================== */
.chat-input-area {
    margin: 1.25rem;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background-color: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: border-color 0.25s ease;
}

.chat-input-area:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#messageInput {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 0.5rem 0;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-color);
}

#messageInput::placeholder {
    color: #94a3b8;
}

.send-message-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: transparent;
    cursor: default;
    transition: all 0.25s ease;
}

.send-message-btn.active {
    background-color: var(--dark-color);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.send-message-btn.active::after {
    content: "↑";
    font-size: 1.25rem;
    font-weight: 800;
}

.send-message-btn.active:hover {
    transform: scale(1.08);
    background-color: var(--primary-color);
}

/* ==================================================
   BADGES DE CERTIFICATION (PROPRES ET HARMONISÉS)
   ================================================== */
.verified-badge,
.verified-badge-message {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 15px !important;
    height: 15px !important;
    margin-left: 5px !important;
    vertical-align: -2px;
    flex-shrink: 0;
}

.verified-badge svg,
.verified-badge-message svg {
    width: 15px !important;
    height: 15px !important;
    display: block !important;
}

.profile-photos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 1rem;
    max-width: 600px;
}

.profile-photo-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.7rem;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease;
}

.profile-photo-item:hover {
    transform: translateY(-2px);
}

.profile-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Toutes les photos ont maintenant la même taille */
.profile-photo-item.primary {
    grid-column: span 1;
    grid-row: span 1;
}

.profile-photo-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--danger-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.profile-photo-delete:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.05);
}

.profile-certified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    margin-left: 6px;

    background: #1877F2;
    color: white;

    border-radius: 50%;

    font-size: 12px;
    font-weight: bold;

    vertical-align: middle;
}

.facebook-verified-badge {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(24, 119, 242, 0.2));
}


/* ==================================================
   PIED DE PAGE
   ================================================== */
footer, .site-footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 2.5rem 0;
    text-align: center;
    margin-top: auto;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ==================================================
   RESPONSIVE DESIGN (MOBILE)
   ================================================== */
@media (max-width: 768px) {
    .messages-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .messages-list {
        display: none;
    }

    .message-content-wrapper {
        max-width: 85%;
    }

    .message-actions {
        opacity: 1; /* Toujours visible sur mobile pour plus d'ergonomie tactile */
    }

    .hero {
        padding: 4rem 0;
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .hero-image img {
        height: 300px;
    }
}

/* ==================================================
   ANIMATIONS
   ================================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==================================================
   STATISTIQUES DES MEMBRES
   ================================================== */

.members-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.stat-card div {
    font-size: 24px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin: 5px 0;
}

.stat-card span {
    color: #6b7280;
}


/* ==================================================
   RECHERCHE
   ================================================== */

.member-search {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 20px;
}


/* ==================================================
   CARTE MEMBRE
   ================================================== */

.member-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 12px;
    background: white;
    animation: slideIn 0.3s ease;
}

.member-photo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info {
    flex: 1;
}

.member-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
}

.member-location {
    margin-top: 7px;
    color: #6b7280;
}

.member-details {
    margin-top: 5px;
    color: #6b7280;
    font-size: 14px;
}


/* ==================================================
   BADGE CERTIFIÉ
   ================================================== */

.facebook-verified-badge {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}


/* ==================================================
   BOUTON VOIR LE PROFIL
   ================================================== */

.view-member-button {
    border: none;
    background: #1877F2;
    color: white;
    padding: 10px 15px;
    border-radius: 9px;
    cursor: pointer;
}

.view-member-button:hover {
    opacity: 0.9;
}


/* ==================================================
   RESPONSIVE
   ================================================== */

@media (max-width: 700px) {

    .member-card {
        flex-wrap: wrap;
    }

    .view-member-button {
        width: 100%;
    }

    .members-stats {
        grid-template-columns: 1fr;
    }


.member-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.member-actions button {
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.report-member-button {
    background: #fff7ed;
    color: #c2410c;
}

.report-member-button:hover {
    background: #fed7aa;
}

.delete-member-button {
    background: #fef2f2;
    color: #dc2626;
}

.delete-member-button:hover {
    background: #dc2626;
    color: white;
}

@media (max-width: 768px) {

    .member-card {
        align-items: flex-start;
    }

    .member-actions {
        width: 100%;
    }

    .member-actions button {
        flex: 1;
    }
}

/* =====================================================
   🚨 MODAL DE SIGNALEMENT
   ===================================================== */

.report-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.report-modal-content {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.report-modal-content h2 {
    margin-top: 0;
    color: #dc2626;
}

.report-member-name {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: bold;
}

.report-field {
    margin-bottom: 15px;
}

.report-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.report-field select,
.report-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.report-field textarea {
    min-height: 100px;
    resize: vertical;
}

.report-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.report-actions button {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-weight: 700;
    cursor: pointer;
}

.report-cancel {
    background: #e5e7eb;
    color: #374151;
}

.report-confirm {
    background: #dc2626;
    color: white;
}

}
    
