:root {
    /* --- NOUVELLE PALETTE : BLEU CIEL --- */
    
    /* La couleur d'accent principale */
    --primary-color: #3498db; /* Un bleu ciel clair et moderne */
    --primary-color-hover: #2980b9; /* Une version plus foncée */

    /* Les couleurs de fond */
    --background-light: #f4f7f9; /* Un gris très clair avec une pointe de bleu */
    --background-white: #ffffff;

    /* Les couleurs de texte */
    --text-primary: #2c3e50; /* Un bleu ardoise foncé, très lisible */
    --text-secondary: #8494a6; /* Un gris-bleu pour les infos secondaires */
    
    /* Autres couleurs */
    --border-color: #eaf0f4; /* Une bordure très discrète */
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --danger-color-hover: #c0392b;
    
    /* Variables de structure (ne changent pas) */
    --container-width: 1200px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    /* On applique la nouvelle police à tout le site */
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
    line-height: 1.7;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 600;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: var(--primary-color-hover);
}

/* --- Header & Navigation --- */
.navbar {
    background-color: var(--background-white);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo img { height: 80px; width: auto; }
.main-nav { flex-grow: 1; display: flex; justify-content: center; align-items: center; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 15px; align-items: center; }
.main-nav ul li a { color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 16px; padding: 8px 15px; border-radius: 8px; transition: all 0.2s ease-in-out; }
.main-nav ul li a:hover { color: var(--primary-color); }
.search-form { display: flex; align-items: center; }
.search-form input { border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 8px 0 0 8px; font-size: 14px; width: 250px; }
.search-form input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }
.search-form button { background: var(--primary-color); border: 1px solid var(--primary-color); color: white; padding: 8px 12px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 16px; margin-left: -1px; }
.search-form button:hover { background-color: var(--primary-color-hover); }
.action-links { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--text-primary); text-decoration: none; font-weight: 600; padding: 10px 15px; align-self: center; }
.nav-link:hover { color: var(--primary-color); }
.nav-link-notification { position: relative; padding: 8px 15px; color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 16px; border-radius: 8px; transition: all 0.2s ease-in-out; }
.nav-link-notification:hover { color: var(--primary-color); background-color: var(--background-light); }
.notification-bubble { position: absolute; top: 0px; right: 0px; background-color: var(--danger-color); color: white; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

/* --- Section Hero --- */
.hero {
    color: white;
    padding: 120px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.pexels.com/photos/1549196/pexels-photo-1549196.jpeg');
    background-size: cover;
    background-position: center;
}
.hero h1 { font-size: 52px; font-weight: 700; margin-bottom: 20px; text-shadow: 2px 2px 4px rgba(0,0,0,0.6); }
.hero p { font-size: 20px; max-width: 650px; margin-bottom: 30px; text-shadow: 1px 1px 2px rgba(0,0,0,0.6); }

/* --- Boutons --- */
.btn { display: inline-block; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: all 0.2s ease-in-out; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn-primary { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-color-hover); border-color: var(--primary-color-hover); }
.btn-secondary { background-color: var(--background-white); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background-color: var(--background-light); border-color: #caced1; }
.btn-danger { background-color: var(--danger-color); color: white; border-color: var(--danger-color); }
.btn-danger:hover { background-color: var(--danger-color-hover); border-color: var(--danger-color-hover); }
.btn-success { background-color: var(--success-color); color: white; border-color: var(--success-color); }
.btn-success:hover { background-color: #157347; border-color: #146c43; }
.btn-large { padding: 15px 30px; font-size: 18px; }
.btn-full { width: 100%; }

/* --- Formulaires --- */
.main-form { padding: 80px 20px; }
.form-container { background: var(--background-white); padding: 50px; border-radius: 16px; box-shadow: var(--shadow-md); width: 100%; max-width: 550px; text-align: center; border: 1px solid var(--border-color); }
.form-container h2 { margin-bottom: 15px; font-size: 32px; }
.form-container p { margin-bottom: 30px; color: var(--text-secondary); }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select, .form-group ul { width: 100%; padding: 0; border: none; font-size: 16px; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }
.form-group ul li { list-style: none; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"], .form-group textarea, .form-group select { padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; }
.form-footer { margin-top: 25px; font-size: 14px; }

/* --- Cartes d'Activité --- */
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.activity-card { background-color: var(--background-white); border: 1px solid transparent; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md); transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.activity-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); border-color: var(--primary-color); }
a.card-link-wrapper { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.card-image-container img { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 20px; flex-grow: 1; }
.card-category { background-color: var(--primary-color); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.activity-card h4 { font-size: 1.1rem; margin-top: 10px; color: var(--text-primary); }
.activity-meta { font-size: 14px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 15px; margin-top: 15px; }
.card-footer { padding: 20px; background-color: var(--background-light); border-top: 1px solid var(--border-color); margin-top: auto; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }

/* --- Page de Détail d'Activité --- */
.activity-detail-header { padding: 80px 20px; margin: -50px -20px 0 -20px; background-size: cover; background-position: center; color: white; text-align: center; border-radius: 0 0 25px 25px; box-shadow: var(--shadow-md); position: relative; }
.activity-detail-header h1 { font-size: 3rem; text-shadow: 2px 2px 5px rgba(0,0,0,0.7); margin: 0; }
.activity-detail-header .card-category { background-color: rgba(255,255,255,0.2); backdrop-filter: blur(5px); margin-bottom: 15px; }
.activity-detail-header .activity-meta a { color: white; font-weight: bold; }
.activity-detail-container { display: flex; flex-wrap: wrap; gap: 40px; }
.activity-main-content { flex: 1; min-width: 60%; }
.activity-sidebar { flex: 1; min-width: 300px; }
.action-box { border: 1px solid var(--border-color); border-radius: 16px; background-color: var(--background-white); padding: 25px; position: sticky; top: 100px; box-shadow: var(--shadow-sm); }
.details-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }
.details-list li { display: flex; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.details-list li:last-child { border-bottom: none; padding-bottom: 0; }
.details-list li span:first-child { font-size: 24px; margin-top: 5px; }
.details-list li div p { margin: 0; color: var(--text-secondary); }
.details-list li div strong { color: var(--text-primary); }
.participation-section { margin-top: 25px; padding-top: 25px; border-top: 1px solid var(--border-color); }
.activity-actions { margin-top: 20px !important; display: flex; gap: 10px; }
.discussion-section { margin-top: 40px; }

/* --- Discussion & Mur --- */
.message-thread { margin-top: 20px; display: flex; flex-direction: column; gap: 15px; }
.message-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; background-color: #fff; }
.message-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.message-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.message-timestamp { color: var(--text-secondary); font-size: 12px; margin-left: auto; }
.message-form { display: flex; gap: 10px; margin-top: 20px; }
.message-form textarea { flex-grow: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; }
.post-creation-form { background: var(--background-white); padding: 25px; border-radius: 12px; border: 1px solid var(--border-color); margin-bottom: 30px; }
.post-creation-form h4 { margin-top: 0; margin-bottom: 15px; font-size: 1.1rem; }
.post-form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }

/* MODIFICATION POUR LA GRILLE MASONRY */
.post-thread {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    align-items: start;
}
.post-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    width: 100%; /* S'assure que la carte remplit la colonne */
}
.post-header { padding: 20px 25px 15px 25px; }
.post-content { padding: 0 25px 25px 25px; }
.post-content p { font-size: 1rem; color: var(--text-primary); margin: 0; }
.post-image { display: block; width: calc(100% + 50px); margin: 20px -25px 20px -25px; max-height: 600px; object-fit: cover; background-color: var(--background-light); }
.delete-post-btn { position: absolute; top: 20px; right: 20px; text-decoration: none; font-size: 24px; color: var(--text-secondary); font-weight: bold; line-height: 1; }
.delete-post-btn:hover { color: var(--danger-color); }
.empty-state { text-align: center; padding: 40px; background-color: var(--background-white); border: 2px dashed var(--border-color); border-radius: 12px; }

/* --- Page de Profil --- */
.profile-page { background-color: var(--background-white); }
.profile-header { background-color: var(--background-light); padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.profile-cover-image { height: 280px; background-color: #87CEEB; background-size: cover; background-position: center; background-repeat: no-repeat; }
.profile-header-content { display: flex; align-items: flex-end; gap: 20px; margin-top: -80px; position: relative; z-index: 2; }
.profile-avatar-container { border: 5px solid var(--background-white); border-radius: 50%; background-color: var(--background-white); box-shadow: var(--shadow-md); line-height: 0; }
.profile-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
.profile-info { flex-grow: 1; padding-bottom: 20px; }
.profile-info h1 { margin: 0; font-size: 32px; }
.profile-actions { padding-bottom: 20px; }
.profile-nav-container { background-color: var(--background-white); border-bottom: 1px solid var(--border-color); position: sticky; top: 81px; z-index: 999; }
.profile-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.profile-nav ul li a { display: block; padding: 15px 20px; text-decoration: none; color: var(--text-secondary); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.profile-nav ul li a:hover { color: var(--text-primary); }
.profile-nav ul li a.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 30px 0; }
.about-section h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; color: var(--text-secondary); border-bottom: none; margin-bottom: 10px; }
.about-section p { font-size: 1rem; padding-left: 34px; margin: 0; }
.about-section.full-width { grid-column: 1 / -1; }
.friend-request-card { display: flex; justify-content: space-between; align-items: center; background-color: var(--background-white); padding: 15px 20px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.friend-request-info { display: flex; align-items: center; gap: 15px; }
.friend-request-actions a { margin-left: 10px; }
.rank-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; color: white; font-size: 12px; font-weight: 600; margin-left: 10px; vertical-align: middle; }
.rank-badge.excellent { background-color: var(--primary-color); }
.rank-badge.crack { background-color: #6f42c1; }
.rank-badge.super-crack { background-color: #d63384; }

.wall-container { display: flex; align-items: flex-start; gap: 40px; }
.wall-main { flex: 2; min-width: 0; }
.wall-sidebar { flex: 1; min-width: 300px; position: sticky; top: 100px;}
.info-box { background-color: var(--background-white); padding: 25px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.info-box h3 { margin-top: 0; font-size: 1.25rem; color: var(--primary-color); }
.info-box p { font-size: 14px; color: var(--text-secondary); }
.checklist { list-style: none; padding: 0; margin: 20px 0; }
.checklist li { margin-bottom: 12px; font-weight: 500; color: var(--text-secondary); padding-left: 28px; position: relative; }
.checklist li::before { content: '○'; position: absolute; left: 0; top: 0; font-size: 18px; line-height: 1; color: var(--border-color); }
.checklist li.completed::before { content: '✓'; color: var(--success-color); font-weight: bold; }
.checklist li.pending::before { content: '…'; color: var(--text-secondary); font-weight: bold; }
.ranks p { font-size: 14px; margin-bottom: 5px; }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 25px; margin-top: 30px; }
.user-card { text-decoration: none; color: var(--text-primary); text-align: center; background-color: var(--background-white); border: 1px solid var(--border-color); border-radius: 12px; padding: 25px; transition: all 0.2s ease-in-out; }
.user-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.user-avatar-large { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; border: 3px solid var(--background-white); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.user-card h3 { font-size: 18px; margin-top: 10px; }

.two-column-layout { display: flex; align-items: flex-start; gap: 40px; }
.form-column { flex: 2; min-width: 0; }
.info-column { flex: 1; position: sticky; top: 100px;}
.category-examples { list-style: none; padding: 0; margin-top: 20px; }
.category-examples li { margin-bottom: 15px; font-size: 14px; color: var(--text-secondary); }
.category-examples li strong { color: var(--text-primary); }

@media (max-width: 992px) {
    .two-column-layout, .wall-container, .activity-detail-container { flex-direction: column; }
    .info-column, .wall-sidebar, .activity-sidebar { position: static; margin-top: 30px; min-width: unset; }
}
@media (max-width: 768px) {
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 16px; }
    .navbar .container { flex-direction: column; height: auto; padding: 15px 20px; gap: 15px; }
    .main-nav { order: 1; margin-top: 10px; width: 100%; border-top: 1px solid var(--border-color); padding-top: 15px; }
    .main-nav ul { flex-direction: column; width: 100%; gap: 10px; text-align: center; }
    .action-links { order: 0; }
    .logo { order: -1; }
    .profile-header-content { flex-direction: column; align-items: center; margin-top: -100px; text-align: center; }
    .profile-info, .profile-actions { padding-bottom: 0; }
    .profile-actions { margin-top: 15px; }
    .about-grid { grid-template-columns: 1fr; }
}

/* --- Section redondante, à fusionner/nettoyer plus tard --- */
/* =========================================================
   ≡   PAGE DÉTAIL D’ACTIVITÉ – Améliorations visuelles   ≡
   ========================================================= */
.activity-detail-header { min-height: 280px; background-size: cover; background-position: center; color: #fff; display: flex; align-items: flex-end; padding: 60px 0 40px; position: relative; }
.activity-detail-header h1 { font-size: 2.2rem; margin: 0 0 0.3em; line-height: 1.2; }
.activity-detail-header .card-category { background: rgba(0,0,0,0.45); padding: 4px 14px; border-radius: 20px; font-size: .75rem; letter-spacing: .8px; text-transform: uppercase; }
.activity-detail-header .activity-meta { font-size: .9rem; opacity: .9; }
.activity-detail-container { display: grid; grid-template-columns: 3fr 1.3fr; gap: 2.5rem; }
@media (max-width: 900px) {
    .activity-detail-container { grid-template-columns: 1fr; }
    .activity-sidebar { order: -1; margin-bottom: 2rem; }
}
.activity-actions { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.discussion-section hr { margin: 1rem 0 2rem; border: none; border-top: 1px solid #e4e4e4; }
.message-thread { display: flex; flex-direction: column; gap: 1.75rem; }
.message-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,0.06); padding: 1rem 1.25rem; }
.message-header { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; }
.message-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.message-header strong a { color: var(--text-primary); }
.message-timestamp { margin-left: auto; font-size: .8rem; color: #888; }
.delete-post-btn { display: inline-block; margin-left: .5rem; color: #e74c3c; font-weight: bold; }
.message-form textarea { width: 100%; min-height: 110px; resize: vertical; padding: .75rem .9rem; border: 1px solid #d0d0d0; border-radius: 8px; font-size: .95rem; line-height: 1.4; margin-bottom: .75rem; }
.activity-sidebar .action-box { background: #fff; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.05); padding: 1.5rem 1.75rem 1.25rem; position: sticky; top: 90px; }
.btn-full { width: 100%; margin-bottom: 1rem; }
.details-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.details-list li { display: flex; gap: .85rem; font-size: .95rem; }
.details-list li span { font-size: 1.2rem; line-height: 1; }
.details-list li strong { display: block; font-size: .9rem; margin-bottom: .2rem; }
.details-list li p { margin: 0; }

/* --- Barre de filtre Ville --- */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.city-filter-form {
    display: flex;
    align-items: center;
    gap: 10px; /* Ajoute un espace entre la barre et le bouton */
}
.city-filter-form .city-search-input {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    min-width: 300px;
}

/* --- Menu déroulant du Logo --- */
.logo-dropdown {
    position: relative;
    display: inline-block;
}

.menu-trigger {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #495057;
    transition: color 0.2s;
    margin-right: 10px;
}

.menu-trigger:hover {
    color: #0d6efd;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--background-white);
    min-width: 240px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 1001;
    margin-top: 10px;
    left: 0;
}
.dropdown-content.show {
    display: block;
}
.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    font-size: 15px;
    font-weight: 500;
}
.dropdown-content a:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

/* --- Alignements du Header --- */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* On ajuste la position du menu par rapport à l'icône */
.logo-dropdown {
    order: 0;
    margin-right: 0;
}

/* --- Bloc de bienvenue pour visiteur non connecté --- */
.welcome-box {
    text-align: center;
    padding: 60px 40px;
    background-color: var(--background-white);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    margin: 20px auto;
}
.welcome-box h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
}
.welcome-box p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 15px auto 30px;
}
.welcome-actions a {
    margin: 0 10px;
}

/* --- Styles pour la Messagerie --- */
.conversation-list {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.conversation-item {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
}
.conversation-item:last-child {
    border-bottom: none;
}
.conversation-item:hover {
    background-color: var(--background-light);
}
.conversation-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.conversation-preview {
    flex-grow: 1;
}
.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.last-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* --- Styles pour la Vue Conversation --- */
.chat-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 70vh; /* Hauteur de la fenêtre de chat */
}
.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    position: relative;
}
.chat-header a {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}
.chat-header h2 {
    margin: 0;
    font-size: 1.2rem;
}
.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.message-bubble p {
    margin: 0;
}
.message-bubble.sent {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}
.message-bubble.received {
    background-color: var(--background-light);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}
.chat-form {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}
.chat-form form {
    display: flex;
    gap: 10px;
}
.chat-form textarea {
    flex-grow: 1;
    resize: none;
}

/* --- Galerie Photo Profil (Version Finale Robuste) --- */
.photo-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 15px !important;
    margin-top: 30px !important;
}

.photo-item {
    position: relative !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background-color: var(--background-light) !important;
}

.photo-item a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.photo-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.photo-item:hover img {
    transform: scale(1.1) !important;
}

.photo-caption {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent) !important;
    color: white !important;
    padding: 20px 10px 10px !important;
    font-size: 14px !important;
    margin: 0 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    text-align: center !important;
    pointer-events: none !important;
}

.photo-item:hover .photo-caption {
    opacity: 1 !important;
}

.delete-photo-btn {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    background-color: rgba(0,0,0,0.6) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 20px !important;
    line-height: 28px !important;
    text-align: center !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
    z-index: 5 !important;
}

.photo-item:hover .delete-photo-btn {
    opacity: 1 !important;
}

/* --- NOUVEAU DESIGN : Section Héros V2 --- */
.hero-v2 {
    position: relative;
    height: 60vh; /* Hauteur de la section : 60% de la hauteur de l'écran */
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    overflow: hidden;
    color: white;
}
.hero-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Voile sombre pour la lisibilité */
    z-index: 2;
}
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.hero-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}
.hero-slideshow .slide.active {
    opacity: 1;
}
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
}
.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}
.hero-search-form {
    display: flex;
    background-color: white;
    border-radius: 50px; /* Bords arrondis */
    padding: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
}
.hero-search-form select, .hero-search-form input {
    border: none;
    background: none;
    font-size: 1rem;
    padding: 0 15px;
}
.hero-search-form select {
    color: var(--text-secondary);
    font-weight: 500;
}
.hero-search-form input {
    flex-grow: 1;
    color: var(--text-primary);
}
.hero-search-form select:focus, .hero-search-form input:focus {
    outline: none;
}
.hero-search-form button {
    background-color: var(--primary-color);
    border: none;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.hero-search-form button:hover {
    background-color: var(--primary-color-hover);
}

/* --- NOUVEAU DESIGN : Le Journal de la Ville --- */
.city-journal-page {
    background-color: #f7f7f7; /* Un fond gris très subtil */
}

.journal-container {
    max-width: 720px; /* Le fil est centré et pas trop large pour la lisibilité */
    margin: 0 auto;
    padding: 50px 20px;
}

/* On réutilise le style du formulaire de post, mais on peut l'ajuster plus tard */
.journal-container .post-creation-form {
    margin-bottom: 40px;
}

.journal-feed .post-card {
    background-color: #fff;
    border: none; /* Fini les bordures */
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Une ombre douce */
}

.journal-feed .post-header {
    padding: 20px 25px 15px 25px;
}
.journal-feed .post-header strong a {
    font-size: 1.1rem;
    font-weight: 600;
}

.journal-feed .post-content {
    padding: 0 25px 25px 25px;
}

.journal-feed .post-content p {
    font-size: 1.1rem; /* Texte plus grand pour la lecture */
    line-height: 1.7; /* Espacement de ligne confortable */
    color: #333;
}

.journal-feed .post-image {
    width: 100%;
    margin: 20px 0;
    border-radius: 8px; /* Bords arrondis pour les images */
    max-height: 700px;
    object-fit: cover;
}

/* --- Widget Prochaines Activités --- */
.upcoming-activities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.upcoming-activities-list li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background-color 0.2s;
}
.upcoming-activities-list li:last-child a {
    border-bottom: none;
}
.upcoming-activities-list li a:hover {
    background-color: #f8f9fa; /* un gris très clair */
}
.activity-date {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    min-width: 45px;
}
.activity-title {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- DESIGN : Page Créer une Activité (Corrigé) --- */

.form-page-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: flex-start;
    padding: 40px 0;
}

/* On rend la colonne de droite "collante", et non plus les widgets individuels */
.info-column {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 30px; /* Espace entre les widgets */
}

.form-column .form-section {
    margin-bottom: 40px;
}

.form-column .form-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* Amélioration des champs de formulaire */
.form-section .form-group p {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-section label {
    font-weight: 600;
    font-size: 0.95rem;
}
.form-section input[type="text"],
.form-section input[type="datetime-local"],
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-section input[type="text"]:focus,
.form-section input[type="datetime-local"]:focus,
.form-section textarea:focus,
.form-section select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

@media (max-width: 992px) {
    .form-page-layout {
        grid-template-columns: 1fr;
    }
    .info-column {
        position: static;
        margin-top: 40px;
    }
}


/* --- DESIGN MESSAGERIE FINAL (Avec Polish) --- */

.messaging-page-layout {
    display: flex;
    height: calc(100vh - 81px);
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
}

/* Volet de Gauche */
.conversations-panel {
    width: 380px;
    min-width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.inbox-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.inbox-header h1 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.conversation-list { overflow-y: auto; flex-grow: 1; }
.conversation-list-item { display: flex; align-items: center; padding: 12px 20px; gap: 15px; text-decoration: none; color: inherit; border-left: 4px solid transparent; position: relative; }
.conversation-list-item.active { background-color: var(--background-light); border-left-color: var(--primary-color); }
.conversation-list-item:hover { background-color: var(--background-light); }
.unread-dot { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; background-color: var(--primary-color); border-radius: 50%; }
.conversation-list-item .message-avatar { width: 55px; height: 55px; flex-shrink: 0; }
.conversation-list-item .message-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.conversation-preview { flex-grow: 1; overflow: hidden; }
.conversation-header { display: flex; justify-content: space-between; align-items: center; }
.conversation-header strong { font-size: 1rem; font-weight: 600; }
.last-message { color: var(--text-secondary); font-size: 0.9rem; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-message strong { color: var(--text-primary); font-weight: 600; }

/* Volet de Droite */
.chat-panel { flex-grow: 1; display: flex; flex-direction: column; background-color: var(--background-light); }
.chat-panel-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; text-align: center; color: var(--text-secondary); background-color: var(--background-light); }
.chat-panel-placeholder .placeholder-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.chat-panel-placeholder h2 { font-size: 1.5rem; color: var(--text-primary); }
.chat-page-container { height: 100%; display: flex; flex-direction: column; }
.chat-header { display: flex; align-items: center; gap: 15px; padding: 10px 20px; background-color: var(--background-white); border-bottom: 1px solid var(--border-color); flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.chat-header a { text-decoration: none; font-weight: 600; }
.chat-header .message-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-header h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.chat-messages { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }

/* Animation d'arrivée des messages */
@keyframes slide-in-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-bubble {
    max-width: 65%;
    padding: 12px 18px;
    border-radius: 22px;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 8px; /* Espace pour la mention "Lu" */
    animation: slide-in-fade 0.3s ease-out;
}
.message-bubble.sent {
    background: linear-gradient(to top right, #3498db, #8e44ad); /* Dégradé de bleu à violet */
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-bubble.received {
    background-color: #ffffff;
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}
.read-receipt {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 10px;
}
.chat-form { padding: 10px 15px; border-top: 1px solid #dcdcdc; background: var(--background-white); flex-shrink: 0; }
.chat-form form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex-grow: 1; resize: none; border: 1px solid #ccc; border-radius: 20px; padding: 10px 18px; font-family: inherit; font-size: 1rem; max-height: 100px; }
.chat-form textarea:focus { outline: none; border-color: var(--primary-color); }
.chat-form button { border: none; background-color: var(--primary-color); color: white; border-radius: 50%; width: 42px; height: 42px; flex-shrink: 0; font-size: 1.2rem; padding: 0; cursor: pointer; transition: background-color 0.2s; }
.chat-form button:hover { background-color: var(--primary-color-hover); }

/* Gadget Emoji */
.emoji-picker { position: relative; }
.emoji-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); padding: 8px; }
.emoji-palette {
    position: absolute;
    bottom: 55px; /* Apparaît au-dessus du bouton */
    left: 0;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    display: none; /* Caché par défaut */
    padding: 8px;
    gap: 8px;
}
.emoji-palette.show {
    display: flex;
}
.emoji-palette span {
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    border-radius: 5px;
}
.emoji-palette span:hover {
    background-color: var(--background-light);
}

/* --- DESIGN FINAL : Page de Profil "Carte de Visite" --- */

.profile-page-v3 {
    background-color: var(--background-light);
}

/* L'en-tête "Carte" */
.profile-card-header {
    background-color: var(--background-white);
    border-radius: 16px;
    padding: 30px;
    margin: 40px auto;
    max-width: 900px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.profile-card-left {
    display: flex;
    align-items: center;
    gap: 25px;
}
.profile-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--background-light);
}
.profile-card-info h1 {
    margin: 0 0 5px 0;
    font-size: 2rem;
}
.profile-card-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.profile-card-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}
.profile-card-actions {
    display: flex;
    gap: 10px;
}

/* La navigation par icônes */
.profile-icon-nav {
    background-color: var(--background-white);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}
.profile-icon-nav ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.profile-icon-nav ul li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-size: 0.85rem;
}
.profile-icon-nav ul li a:hover {
    color: var(--text-primary);
}
.profile-icon-nav ul li a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.profile-icon-nav .nav-icon {
    font-size: 1.8rem;
}

/* Le contenu des onglets */
.tab-content h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

/* --- DESIGN PROFIL V3 (Corrigé et Final) --- */

/* Section Questions/Réponses */
.qa-section {
    border-left: 3px solid var(--primary-color);
    padding-left: 25px;
    margin-bottom: 30px;
}
.qa-section .question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.qa-section .answer {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.1rem;
}

/* Grille pour les onglets Activités et Amis */
.profile-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Style unifié pour les cartes Activités/Amis */
.unified-card {
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.unified-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.unified-card-image {
    aspect-ratio: 16 / 10; /* Force un format d'image constant (16:10) */
    background-color: var(--background-light);
}
.unified-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recadre l'image parfaitement */
}
.unified-card-content {
    padding: 15px;
    flex-grow: 1;
}
.unified-card-content h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.unified-card-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
}


/* Grille d'amis simplifiée */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 30px;
}
.friend-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
}
.friend-item img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.friend-item:hover img {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}
.friend-item strong {
    font-weight: 600;
}

/* --- DESIGN : Page Paramètres du Profil --- */
.settings-page {
    padding: 40px 0;
}
.settings-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}
/* Navigation latérale */
.settings-nav {
    width: 250px;
    flex-shrink: 0;
}
.settings-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 5px;
    border-left: 4px solid transparent;
}
.settings-nav a:hover {
    background-color: var(--background-light);
    color: var(--text-primary);
}
.settings-nav a.active {
    background-color: var(--background-light);
    border-left-color: var(--primary-color);
    color: var(--text-primary);
}
/* Contenu principal */
.settings-content {
    flex-grow: 1;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}
.settings-content h2 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.settings-content .form-group {
    margin-bottom: 25px;
}

/* --- DESIGN : Page Détail d'Activité --- */

.activity-detail-page {
    background-color: var(--background-white);
}

.activity-detail-header-v2 {
    height: 50vh; /* 50% de la hauteur de l'écran */
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: white;
    padding: 40px;
    background-size: cover;
    background-position: center;
}
.activity-detail-header-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.activity-detail-header-v2 .container {
    position: relative;
    z-index: 2;
}
.activity-detail-header-v2 h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}
.activity-detail-header-v2 .category {
    background-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.activity-detail-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    padding: 40px 0;
    align-items: flex-start;
}

.activity-content-main h2 {
    font-size: 1.8rem;
    margin-top: 0;
}

.organizer-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 12px;
    margin: 30px 0;
}
.organizer-box img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.organizer-box p { margin: 0; }

.activity-sidebar-sticky {
    position: sticky;
    top: 100px;
}
.info-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-white);
    box-shadow: var(--shadow-md);
}
.info-card-header {
    padding: 20px;
}
.info-card-header .price {
    font-size: 1.5rem;
    font-weight: 600;
}
.info-card-body {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}
.info-card .details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.info-card .details-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 0.95rem;
}
.info-card .details-list .icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.info-card .details-list strong {
    display: block;
    color: var(--text-primary);
}
.info-card .details-list p {
    margin: 0;
    color: var(--text-secondary);
}
.info-card-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 992px) {
    .activity-detail-body {
        grid-template-columns: 1fr;
    }
    .activity-sidebar-sticky {
        position: static;
        margin-top: 40px;
    }
}

/* --- Style pour les Commentaires (Version Épurée) --- */
.comments-section {
    padding: 0 25px 20px 25px;
}
.comment {
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.comment-author-link {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-right: 8px; /* Espace entre le nom et le commentaire */
}
.comment-author-link:hover {
    text-decoration: underline;
}
.comment-text {
    color: var(--text-secondary);
}
.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.comment-form input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    font-family: inherit;
}
.comment-form button {
    background: none;
    border: none;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

/* --- DESIGN : Page Détail d'Activité --- */

.activity-detail-header-v2 {
    height: 50vh; /* 50% de la hauteur de l'écran */
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: white;
    background-size: cover;
    background-position: center;
}
.activity-detail-header-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.activity-detail-header-v2 .container {
    position: relative;
    z-index: 2;
    padding-bottom: 40px;
}
.activity-detail-header-v2 h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}
.activity-detail-header-v2 .category {
    background-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.activity-detail-body {
    display: grid;
    grid-template-columns: 2fr 1.2fr; /* Colonne de gauche plus large */
    gap: 50px;
    padding: 50px 0;
    align-items: flex-start;
}

.activity-content-main h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 25px;
}

.organizer-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 12px;
    margin: 30px 0;
}
.organizer-box img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.organizer-box p { margin: 0; }

.activity-sidebar-sticky {
    position: sticky;
    top: 100px; /* Colle au bas du header principal */
}
.info-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--background-white);
    box-shadow: var(--shadow-md);
    overflow: hidden; /* Pour que les coins arrondis s'appliquent bien */
}
.info-card-header {
    padding: 20px;
    background-color: var(--background-light);
}
.info-card-header .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.info-card-body {
    padding: 25px;
}
.info-card .details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.info-card .details-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 0.95rem;
}
.info-card .details-list .icon {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.info-card .details-list strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.info-card .details-list p {
    margin: 0;
    color: var(--text-secondary);
}
.info-card-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 992px) {
    .activity-detail-body {
        grid-template-columns: 1fr;
    }
    .activity-sidebar-sticky {
        position: static;
        margin-top: 40px;
    }
    .activity-detail-header-v2 h1 {
        font-size: 2.2rem;
    }
}

/* --- DESIGN : Passeport & Badges --- */

.passport-container {
    text-align: center;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    margin-top: 30px;
    text-align: center;
}

.badge-item {
    background-color: var(--background-white);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.badge-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.badge-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Style pour les badges bloqués */
.badge-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}
.badge-item.locked .badge-icon {
    content: '🔒';
}

/* Style pour les badges bloqués */
.badge-item.locked {
    opacity: 0.4;
    filter: grayscale(80%);
    transition: all 0.2s;
}
.badge-item.locked:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* --- Centre de Notifications --- */
.notification-list .notification-item {
    display: block;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}
.notification-list .notification-item:hover {
    background-color: var(--background-light);
}
.notification-list .notification-item.unread {
    font-weight: 600;
    background-color: #f4f7f9;
}
.notification-list .notification-item p {
    margin: 0 0 5px 0;
}

/* --- Widget Suggestions d'amis --- */
.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.suggestion-item .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.suggestion-item .user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.suggestion-item .user-info strong {
    color: var(--text-primary);
    font-weight: 600;
}
.suggestion-item .btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- DESIGN : Page de Notifications --- */
.notification-group {
    margin-bottom: 30px;
}
.notification-group h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}
.notification-item-v2 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 5px;
}
.notification-item-v2.unread {
    background-color: var(--background-light);
}
.notification-item-v2:hover {
    background-color: var(--background-light);
}
.notification-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}
.notification-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
/* Couleurs d'icônes par type de notif */
.icon-friend_request { background-color: #3498db; color: white; }
.icon-badge_unlocked { background-color: #f1c40f; color: white; }
.icon-post_like { background-color: #e74c3c; color: white; }
.icon-post_comment { background-color: #2ecc71; color: white; }

.notification-content {
    flex-grow: 1;
}
.notification-content p {
    margin: 0;
    line-height: 1.4;
}
.notification-actions {
    display: flex;
    gap: 10px;
}

/* --- Suggestions d'Amis sur la Page Profil --- */
.suggestions-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* --- Widget Défi de la Semaine --- */
.challenge-widget {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-hover));
    color: white;
}
.challenge-widget h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}
.challenge-widget p {
    font-size: 1rem;
    line-height: 1.6;
}
.challenge-widget strong {
    font-weight: 700;
}

/* --- DESIGN : Page Classement (Salle des Trophées) --- */
.leaderboard-page { 
    padding: 40px 0; 
    background-color: var(--background-light); 
}
.leaderboard-header { 
    text-align: center; 
    margin-bottom: 50px; 
}
.leaderboard-header .icon { 
    font-size: 4rem; 
    margin-bottom: 15px; 
    color: var(--primary-color); 
}
.leaderboard-header h1 { 
    font-family: 'Poppins', sans-serif; 
}
.leaderboard-section { 
    margin-bottom: 50px; 
}
.leaderboard-section h2 { 
    font-family: 'Poppins', sans-serif; 
    margin-top: 0; 
    font-size: 1.6rem; 
    text-align: center; 
    margin-bottom: 30px;
}
.leaderboard-list { 
    list-style: none; 
    padding: 0; 
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.leaderboard-card { 
    display: flex; 
    align-items: center; 
    padding: 20px; 
    background: var(--background-white); 
    border-radius: 12px; 
    border: 1px solid var(--border-color);
    border-left-width: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.leaderboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.leaderboard-card .rank { 
    font-size: 1.5rem; 
    font-weight: 700; 
    font-family: 'Poppins', sans-serif;
    color: var(--text-secondary); 
    min-width: 50px; 
    text-align: center; 
}
.leaderboard-card .avatar { 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    object-fit: cover; 
    margin: 0 20px; 
}
.leaderboard-card .info { 
    flex-grow: 1; 
}
.leaderboard-card .info strong { 
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}
.leaderboard-card .info .stats {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.leaderboard-card .score { 
    font-size: 1.3rem; 
    font-weight: 700; 
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color); 
}
.leaderboard-card.rank-1 { border-left-color: #ffd700; }
.leaderboard-card.rank-2 { border-left-color: #c0c0c0; }
.leaderboard-card.rank-3 { border-left-color: #cd7f32; }
.leaderboard-card.rank-1 .rank { color: #e6b800; }
.leaderboard-card.rank-2 .rank { color: #a0a0a0; }
.leaderboard-card.rank-3 .rank { color: #b8732e; }
.leaderboard-card.challenger { border-left-color: var(--primary-color); }

/* --- CTA de Transition entre Pages --- */
.page-transition-cta {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.page-transition-cta p {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* --- Style pour le bouton "Utile" --- */
.like-button.voted-useful .icon {
    color: #f1c40f; /* Couleur Or/Jaune */
}

/* --- Style pour le Diaporama de Photos (Swiper.js) --- */
.post-gallery-slider {
    margin-top: 15px;
    position: relative;
}
.swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.swiper-button-next, .swiper-button-prev {
    color: white !important;
    --swiper-navigation-size: 30px;
    background-color: rgba(0,0,0,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.swiper-pagination-bullet-active {
    background-color: white !important;
}

/* Placeholder pour avatar sans image */
.default-avatar-placeholder {
    width: 100%; /* S'adapte au conteneur */
    height: 100%; /* S'adapte au conteneur */
    background-color: #ADD8E6; /* Bleu clair */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white; /* Pourrait contenir une icône ou une initiale */
    font-size: 2rem;
    font-weight: bold;
    object-fit: cover; /* Assure que le fond couvre bien l'espace */
}

/* Ajustements pour l'avatar dans la navbar */
.profile-avatar-nav {
    display: flex; /* Permet au placeholder de s'aligner */
    width: 40px; /* Taille de l'avatar dans la navbar */
    height: 40px;
    border-radius: 50%;
    overflow: hidden; /* Cache les débordements si le placeholder est trop grand */
    margin-right: 15px; /* Pour l'espacement */
}
.profile-avatar-nav img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* S'assurer que le placeholder dans la navbar a la bonne taille */
.profile-avatar-nav .default-avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 1.2rem; /* Plus petit pour la navbar */
}

/* S'assurer que le placeholder dans le profile card a la bonne taille */
.profile-card-avatar.default-avatar-placeholder {
    width: 150px; /* Taille de l'avatar sur le profil card */
    height: 150px;
    font-size: 3rem; /* Plus grand pour le profile card */
}

/* Style existant pour la navbar à ajuster si nécessaire */
header.navbar .container {
    display: flex;
    align-items: center; /* Aligne les éléments verticalement */
    justify-content: space-between;
}
.header-left {
    display: flex;
    align-items: center;
}
.header-left .logo {
    margin-right: 15px; /* Espace entre le logo et l'avatar */
}

/* --- Avatar par Défaut & Nav --- */
.default-avatar-placeholder-nav {
    width: 40px;
    height: 40px;
    background-color: #eaf0f4; /* Un gris-bleu clair */
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}
.nav-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* === Correction ancrage menu PC === */
.header-left {
  position: relative;
}

#logo-menu-content {
  left: 0; /* ancré à gauche du hamburger */
  right: auto;
  top: 60px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    min-width: 230px;
    z-index: 1200;
    transition: all 0.25s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== QJD BACK BUTTON ===== */
.qjd-back-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 12px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    backdrop-filter: blur(6px);
}

.qjd-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    color: #111827;
    font-size: 0.9rem;
    font-weight: 500;
}

.qjd-back-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.qjd-back-btn:hover {
    opacity: 0.7;
}

/* Mobile-first : toujours visible */
@media (max-width: 768px) {
    .qjd-back-wrapper {
        padding: 8px 10px;
    }
}