/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh; /* C'est ça la clé ! min-height au lieu de height */
    display: flex;
    flex-direction: column;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: #16213e;
    border-bottom: 1px solid #0f3460;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4cc9f0; /* Bleu cyan doux */
}

.menu a {
    text-decoration: none;
    color: #a0a0a0;
    margin: 0 15px;
    font-size: 1rem;
    transition: color 0.3s;
}

.menu a:hover, .menu a.active {
    color: #4cc9f0;
}

.auth-buttons .btn-login {
    text-decoration: none;
    color: #fff;
    background-color: #4361ee;
    padding: 8px 20px;
    border-radius: 20px;
    transition: background 0.3s;
}

.auth-buttons .btn-login:hover {
    background-color: #3a0ca3;
}


.hero {
    
    padding: 100px 20px; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at center, #1f2a48 0%, #1a1a2e 100%);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
    color: #b0b0b0;
}

.btn-primary {
    text-decoration: none;
    background-color: #4cc9f0;
    color: #1a1a2e;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    margin-right: 15px;
    transition: transform 0.2s;
}

.btn-secondary {
    text-decoration: none;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
}

.btn-primary:hover {
    transform: scale(1.05); /* Petit effet de zoom motivant */
}

/* Lecteur Musique (Footer fixe) */
.music-player {
    background-color: #0f3460;
    padding: 15px;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #81b0ff;
}

/* Section Fonctionnalités */
.features {
    background-color: #1a1a2e;
    padding: 80px 20px;
    margin-top: 0; 
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* S'adapte aux écrans */
    gap: 30px;
}

.feature-card {
    background-color: #16213e; /* Un peu plus clair que le fond */
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #0f3460;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px); /* La carte monte un peu au survol */
    box-shadow: 0 10px 20px rgba(76, 201, 240, 0.1); /* Lueur bleue douce */
    border-color: #4cc9f0;
}

.feature-card h3 {
    color: #4cc9f0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.feature-card p {
    color: #a0a0a0;
    line-height: 1.6;
}

/* Pied de page */
footer {
    background-color: #0f3460;
    padding: 40px 0;
    margin-bottom: 0; /* On remet ça à zéro pour coller au bas de la page */
    text-align: center;
    border-top: 1px solid #1f4068;
}

.footer-content p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    display: inline;
    margin: 0 10px;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4cc9f0;
}

/* --- Page de Connexion --- */

.login-container {
    flex: 1; /* Prend tout l'espace disponible au centre */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 20px;
    background: radial-gradient(circle at center, #1f2a48 0%, #1a1a2e 100%);
}

.login-box {
    background-color: #16213e;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #0f3460;
    width: 100%;
    max-width: 400px; /* Pas trop large pour rester intime */
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    text-align: center;
}

.login-box h2 {
    color: #fff;
    margin-bottom: 10px;
}

.login-intro {
    color: #a0a0a0;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Les champs de texte */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    color: #4cc9f0;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #2a3b55;
    background-color: #0f172a; /* Fond des champs très sombre */
    color: #fff;
    outline: none;
    transition: border 0.3s;
}

.input-group input:focus {
    border-color: #4cc9f0; /* S'illumine en bleu quand on clique dedans */
}

/* Bouton pleine largeur */
.btn-full {
    width: 100%;
    padding: 12px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-full:hover {
    background-color: #3a0ca3;
}

.signup-link {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

.signup-link a {
    color: #4cc9f0;
    text-decoration: none;
}

/* --- Interface Journal --- */

.journal-container {
    display: flex; /* On met les éléments côte à côte */
    flex: 1; /* Prend toute la hauteur restante */
    height: calc(100vh - 80px); /* Hauteur écran moins la barre de nav */
    overflow: hidden; /* Pas de scroll sur la page entière, juste dans les zones */
}

/* Barre latérale (Liste) */
.journal-sidebar {
    width: 300px;
    background-color: #16213e;
    border-right: 1px solid #0f3460;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.btn-new-entry {
    background-color: #4cc9f0;
    border: none;
    color: #1a1a2e;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.btn-new-entry:hover {
    transform: scale(1.02);
}

.entry-item {
    background-color: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.entry-item:hover {
    background-color: #1f2a48;
}

.entry-item.active {
    border-color: #4cc9f0; /* Bordure bleue pour dire "c'est celle-là qu'on lit" */
    background-color: #1f2a48;
}

.entry-item h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #fff;
}

.entry-item span {
    font-size: 0.8rem;
    color: #6c757d;
}


.journal-editor {
    flex: 1;
    /* Le secret est là : un dégradé qui part du centre (plus clair) vers les bords (plus sombre) */
    background: radial-gradient(circle at center, #233055 0%, #1a1a2e 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    /* Une ombre interne pour donner de la profondeur à l'écran */
    box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
    position: relative;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a3b55;
    padding-bottom: 10px;
}

.entry-title {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #fff;
    width: 100%;
    font-family: 'Nunito', sans-serif;
    outline: none;
}

.entry-date {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap; /* Empêche la date de se casser en deux lignes */
}

/* Le texte que tu écris */
.entry-content {
    flex: 1;
    background-color: transparent; /* Transparent pour voir le beau fond */
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem; /* Texte un peu plus grand, plus confortable */
    line-height: 1.8; /* Lignes espacées pour que ça respire */
    font-family: 'Nunito', sans-serif;
    resize: none;
    outline: none;
    padding: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Légère ombre sous le texte pour le lisibilité */
}

/* Petit détail : quand tu cliques pour écrire, la date s'illumine */
.entry-content:focus {
    color: #fff;
}

.editor-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end; /* Boutons à droite */
}

.btn-save {
    background-color: #4361ee;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-delete {
    background-color: transparent;
    color: #ef476f; /* Rouge doux */
    padding: 10px 20px;
    border: 1px solid #ef476f;
    border-radius: 5px;
    cursor: pointer;
}

.btn-save:hover { background-color: #3a0ca3; }
.btn-delete:hover { background-color: #ef476f; color: white; }

/* --- Page Communauté --- */

.forum-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    width: 100%;
}

.forum-header {
    text-align: center;
    margin-bottom: 50px;
}

.forum-header h1 {
    font-size: 2.5rem;
    color: #4cc9f0;
    margin-bottom: 10px;
}

.forum-header p {
    color: #a0a0a0;
}

.btn-create-topic {
    margin-top: 20px;
    padding: 12px 25px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-create-topic:hover {
    background-color: #3a0ca3;
}

/* Les Cartes de Sujets */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topic-card {
    background-color: #16213e;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #2a3b55;
    display: flex;
    justify-content: space-between; /* Ecarte le texte de la flèche */
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.topic-card:hover {
    transform: translateX(10px); /* Petit décalage vers la droite au survol */
    border-color: #4cc9f0;
}

.topic-info h3 {
    margin: 10px 0;
    color: #e0e0e0;
    font-size: 1.2rem;
}

.topic-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.topic-meta strong {
    color: #4cc9f0;
}

.topic-arrow {
    font-size: 1.5rem;
    color: #4361ee;
    opacity: 0.5;
}

.topic-card:hover .topic-arrow {
    opacity: 1;
}

/* Les petits Tags (Etiquettes) colorés */
.topic-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 15px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.tag-soutien { background-color: rgba(239, 71, 111, 0.2); color: #ef476f; } /* Rouge doux */
.tag-passion { background-color: rgba(255, 209, 102, 0.2); color: #ffd166; } /* Jaune */
.tag-victoire { background-color: rgba(6, 214, 160, 0.2); color: #06d6a0; } /* Vert */
.tag-conseil { background-color: rgba(17, 138, 178, 0.2); color: #118ab2; } /* Bleu */

/* --- Page Actualités --- */

.news-header {
    text-align: center;
    padding: 60px 20px;
    background-color: #1a1a2e;
}

.news-header h1 {
    font-size: 2.5rem;
    color: #4cc9f0;
    margin-bottom: 10px;
}

.news-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Grille automatique */
    gap: 30px;
}

.news-card {
    background-color: #16213e;
    border-radius: 15px;
    overflow: hidden; /* Pour que l'image ne dépasse pas des bords ronds */
    border: 1px solid #2a3b55;
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    height: 180px;
    width: 100%;
    /* Ces 2 lignes magiques permettent de centrer l'image et de remplir le cadre sans la déformer */
    background-size: cover;
    background-position: center;
    transition: transform 0.5s; /* Petit effet smooth */
}

/* Petit bonus : quand on survole la carte, l'image zoome légèrement ! */
.news-card:hover .news-image {
    transform: scale(1.1);
}

.news-content {
    padding: 20px;
}

.news-date {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
    margin-bottom: 10px;
}

.news-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #fff;
}

.news-content p {
    font-size: 0.95rem;
    color: #b0b0b0;
    margin-bottom: 20px;
    line-height: 1.5;
}

.read-more {
    text-decoration: none;
    color: #4cc9f0;
    font-weight: bold;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* --- Les Bonhommes Bâtons (SVG) --- */

.stick-icon {
    width: 60px;       /* Taille de l'icône */
    height: 60px;
    margin-bottom: 20px;
    stroke: #ffffff;   /* Couleur du trait (blanc) */
    stroke-width: 2.5; /* Épaisseur du trait */
    fill: none;        /* Pas de remplissage */
    stroke-linecap: round; /* Bouts arrondis pour faire "dessin main" */
    stroke-linejoin: round;
    transition: transform 0.3s;
}

/* Animation : le petit bonhomme saute quand on passe la souris sur la carte */
.feature-card:hover .stick-icon {
    transform: translateY(-10px) rotate(-5deg);
    stroke: #4cc9f0; /* Il s'illumine en bleu ! */
}

/* Le petit bonhomme du footer */
.footer-stick {
    width: 40px;
    height: 40px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
    margin: 0 auto 10px auto; /* Centré au dessus du texte */
    animation: coucou 3s infinite ease-in-out;
}

@keyframes coucou {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); } /* Il se balance un peu */
}

/* --- L'Illustration "Cozy" (Lit + Musique) --- */

.illustration-cozy {
    width: 200px;      /* Une belle taille pour bien voir les détails */
    height: 150px;
    margin-bottom: 20px;
    display: block;    /* S'assure qu'il est bien centré */
    margin-left: auto;
    margin-right: auto;
}

/* Animation des notes de musique */
@keyframes floatNote {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
    50% { transform: translateY(-10px) rotate(10deg); opacity: 1; }
    100% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
}

/* =========================================
   VERSION MOBILE & TABLETTE (RESPONSIVE)
   ========================================= */

@media (max-width: 768px) {
    body {
        font-size: 15px; /* Un peu plus petit pour tout faire rentrer */
    }
    nav {
        flex-direction: column; /* Les éléments se mettent les uns sous les autres */
        padding: 15px;
    }
    .logo {
        margin-bottom: 15px; /* Espace sous le logo */
    }
    .menu {
        display: flex;
        flex-wrap: wrap; /* Si ça dépasse, ça va à la ligne */
        justify-content: center; /* Centré */
        margin-bottom: 15px;
    }
    .menu a {
        margin: 5px 10px; /* Un peu d'espace autour des liens */
        font-size: 0.9rem;
    }
    .hero {
        padding: 40px 20px; /* Moins de marge pour gagner de la place */
    }
    .hero-content h1 {
        font-size: 2rem; /* Titre plus petit pour ne pas manger l'écran */
    }
    .mascot-img {
        width: 150px; /* On réduit un peu le bonhomme */
        height: auto;
    }
    .journal-container {
        flex-direction: column; /* Empilement vertical */
        height: auto; /* On laisse la hauteur s'adapter */
        overflow: visible; /* On active le défilement normal de la page */
    }
    .journal-sidebar {
        width: 100%; /* Prend toute la largeur */
        height: 200px; /* Une petite hauteur pour la liste */
        overflow-y: scroll; /* On peut scroller dans la liste */
        border-right: none;
        border-bottom: 1px solid #0f3460;
    }
    .journal-editor {
        width: 100%;
        height: 500px; /* On donne de la place pour écrire */
    }
    .entry-title {
        font-size: 1.5rem; /* Titre de la note plus petit */
    }
    .container, .news-container {
        grid-template-columns: 1fr; /* Une seule colonne */
        padding: 0 20px;
    }
    .feature-card, .topic-card {
        margin-bottom: 20px; /* Espace entre les cartes */
    }
    .login-box {
        width: 90%; /* Prend presque toute la largeur du téléphone */
        padding: 20px;
    }
}

/* --- Page Profil --- */

.profile-header-bg {
    background: linear-gradient(to right, #1f2a48, #16213e);
    padding: 60px 20px;
    border-bottom: 1px solid #2a3b55;
}

.profile-info-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap; /* Pour le mobile */
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background-color: #0f172a;
    border-radius: 50%;
    border: 4px solid #4cc9f0;
    overflow: hidden;
}

.profile-text {
    flex: 1;
}

.profile-text h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 10px;
}

.badge-creator {
    background-color: #f72585; /* Rose flash pour le chef */
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 10px;
}

.profile-bio {
    color: #b0b0b0;
    margin-bottom: 15px;
    font-style: italic;
}

.profile-stats span {
    margin-right: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-edit {
    background: transparent;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

/* Contenu Principal Grid */
.profile-content {
    max-width: 900px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1fr 2fr; /* 1/3 pour gauche, 2/3 pour droite */
    gap: 30px;
    padding: 0 20px;
}

/* Sidebar (Gauche) */
.sidebar-box {
    background-color: #16213e;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.sidebar-box h3 {
    color: #4cc9f0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid #2a3b55;
    padding-bottom: 10px;
}

.mood {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    background: #1a1a2e;
    color: #6c757d;
    margin: 5px;
    font-size: 0.85rem;
    cursor: pointer;
}

.mood.active {
    background: #4361ee;
    color: white;
}

.badges-grid {
    display: flex;
    gap: 10px;
}

.badge {
    font-size: 1.5rem;
    background: #1a1a2e;
    padding: 10px;
    border-radius: 50%;
    cursor: help;
}

/* Activité (Droite) */
.profile-main h3 {
    color: #fff;
    margin-bottom: 20px;
}

.activity-card {
    display: flex;
    align-items: center;
    background-color: #16213e;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #4361ee;
}

.activity-icon {
    font-size: 1.5rem;
    margin-right: 20px;
}

.activity-details h4 {
    color: #e0e0e0;
    font-size: 1rem;
}

.activity-details p {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Mobile responsive pour le profil */
@media (max-width: 768px) {
    .profile-content {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    }
    .profile-info-container {
        flex-direction: column;
        text-align: center;
    }
}


.profile-avatar-real {
    width: 120px;
    height: 120px;
    border-radius: 50%; 
    border: 4px solid #4cc9f0;
    object-fit: cover; 
    background-color: #0f172a; 
}

/* --- NOUVELLE PAGE CRÉATEUR (Dynamique) --- */

.creator-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px); /* Prend toute la hauteur moins le menu */
    padding: 40px 20px;
    background: radial-gradient(circle at bottom, #1f2a48 0%, #1a1a2e 70%);
}

.creator-card {
    background-color: #16213e;
    width: 100%;
    max-width: 500px; /* Pas trop large, pour faire "carte" */
    border-radius: 20px;
    overflow: hidden; /* Important pour la bannière */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    text-align: center;
    position: relative;
    border: 1px solid #2a3b55;
}

/* La bannière colorée en haut */
.creator-banner {
    height: 120px;
    background: linear-gradient(45deg, #4361ee, #4cc9f0);
}

/* Ta photo qui vient chevaucher la bannière */
.creator-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid #16213e; /* Bordure de la couleur du fond pour l'effet de coupe */
    margin-top: -70px; /* C'est ça qui la fait remonter sur la bannière ! */
    object-fit: cover;
    background-color: #fff; /* Au cas où l'image ne charge pas */
}

.creator-card h1 {
    color: #fff;
    font-size: 2rem;
    margin-top: 15px;
}

.creator-card h1 .highlight {
    color: #4cc9f0;
}

.creator-role {
    color: #a0a0a0;
    font-weight: 600;
    margin-bottom: 25px;
}

.creator-bio {
    padding: 0 30px;
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 30px;
}

.creator-bio p:first-child {
    font-size: 1.2rem;
    font-style: italic;
    color: #fff;
    margin-bottom: 15px;
}

.creator-footer {
    border-top: 1px solid #2a3b55;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-around;
    background-color: #121b35;
}

/* --- Barre de défilement personnalisée --- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #16213e; 
}
::-webkit-scrollbar-thumb {
    background: #2a3b55; 
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4cc9f0; /* Elle devient bleue au survol */
}

/* --- LE CIEL ÉTOILÉ ANIMÉ (Version Vivante) --- */

.stars-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Les étoiles principales (Couche 1) */
.stars-container::after {
    content: ""; position: absolute; top: 0; left: 0;
    width: 2px; height: 2px; border-radius: 50%; background: transparent;
    box-shadow: 
        10vw 10vh #fff, 20vw 80vh #fff, 30vw 20vh #fff, 
        40vw 50vh #fff, 50vw 90vh #fff, 60vw 30vh #fff, 
        70vw 70vh #fff, 80vw 10vh #fff, 90vw 60vh #fff,
        15vw 45vh #fff, 85vw 25vh #fff, 55vw 55vh #fff;
    /* Durée de 12 secondes : assez lent pour être zen, assez rapide pour voir le changement */
    animation: driftAndPulse 12s infinite ease-in-out;
}

/* Les étoiles lointaines (Couche 2) */
.stars-container::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 1px; height: 1px; background: transparent;
    box-shadow: 
        5vw 5vh #a0a0a0, 15vw 85vh #a0a0a0, 25vw 15vh #a0a0a0, 
        35vw 55vh #a0a0a0, 45vw 95vh #a0a0a0, 55vw 25vh #a0a0a0, 
        65vw 75vh #a0a0a0;
    /* Plus lentes (20s) et décalées pour un effet de profondeur naturel */
    animation: driftAndPulse 20s infinite 3s ease-in-out;
}

/* NOUVELLE ANIMATION : Respiration et Dérive */
@keyframes driftAndPulse {
    0% {
        opacity: 0.1; /* Presque invisibles au début */
        transform: translate(0, 0); /* Position de départ */
    }
    50% {
        opacity: 0.9; /* Elles brillent fort ! (Scintillement visible) */
        /* Elles se sont déplacées doucement de 20px vers la gauche et 10px vers le bas */
        transform: translate(-20px, 10px); 
    }
    100% {
        opacity: 0.1; /* Retour à presque invisibles */
        transform: translate(0, 0); /* Retour à la position de départ */
    }
}

/* --- NOUVELLE PAGE BIOGRAPHIE (Style Complet) --- */

/* 1. L'En-tête (Header) */
.bio-header {
    text-align: center;
    padding: 80px 20px 60px 20px;
    background: radial-gradient(circle at top, #233055 0%, #1a1a2e 100%);
}

.bio-photo-container {
    margin-bottom: 20px;
}

.bio-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #4cc9f0;
    box-shadow: 0 0 30px rgba(76, 201, 240, 0.3); /* Effet de lueur bleue */
    transition: transform 0.5s;
}

.bio-photo:hover {
    transform: scale(1.05) rotate(2deg);
}

.bio-header h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 10px;
}

.bio-subtitle {
    font-size: 1.1rem;
    color: #4cc9f0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    margin-bottom: 30px;
}

.bio-quote {
    font-size: 1.2rem;
    font-style: italic;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
    border-left: 3px solid #4361ee;
    padding-left: 20px;
}

/* 2. L'Histoire (Section Texte) */
.bio-story {
    background-color: #16213e;
    padding: 60px 20px;
    line-height: 1.8;
}

.story-content {
    max-width: 700px; /* Pas trop large pour que ce soit facile à lire */
    margin: 0 auto;
}

.story-content h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 30px;
    border-bottom: 2px solid #2a3b55;
    padding-bottom: 10px;
    display: inline-block;
}

.story-content p {
    color: #d1d5db;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.story-content strong {
    color: #4cc9f0;
}

/* 3. Les Piliers (Grille) */
.bio-pillars {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.bio-pillars h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 40px;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Grille auto */
    gap: 30px;
}

.pillar-card {
    background: #1f2a48;
    padding: 30px;
    border-radius: 15px;
    transition: transform 0.3s, background 0.3s;
    border: 1px solid transparent;
}

.pillar-card:hover {
    transform: translateY(-10px);
    background: #233055;
    border-color: #4cc9f0;
}

.pillar-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.pillar-card h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.pillar-card p {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 4. Footer Bio */
.bio-footer {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background-color: #0f172a;
    border-top: 1px solid #1a1a2e;
}

.signature {
    font-family: 'Courier New', monospace; /* Police style "machine à écrire" */
    color: #4cc9f0;
    margin-top: 10px;
}

/* --- NOTIFICATIONS (VERSION CORRIGÉE) --- */
.notif-box {
    position: relative;
    cursor: pointer;
    display: flex; /* Flex pour bien centrer le contenu */
    align-items: center;
    justify-content: center;
    width: 40px; /* On force une taille fixe */
    height: 40px; /* Idem */
    margin-right: 15px; /* Petit espace avec le bouton "Mon Espace" */
}

.notif-box:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Petit effet au survol */
    border-radius: 50%;
}

.badge-notif {
    position: absolute;
    top: 0;    /* Collé en haut */
    right: 0;  /* Collé à droite */
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    width: 16px; height: 16px; /* Un poil plus petit pour être discret */
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-weight: bold;
    border: 2px solid #16213e; /* Bordure couleur fond pour "découper" la cloche */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Le menu déroulant des notifications */
.notif-dropdown {
    display: none;
    position: absolute;
    top: 100%; /* Juste en dessous de la cloche */
    right: 0;  /* Aligné à droite de la cloche */
    background: #16213e;
    border: 1px solid #2a3b55;
    border-radius: 10px;
    width: 280px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 10px;
    margin-top: 10px; /* Petit espace */
}

.notif-box:hover .notif-dropdown {
    display: block;
}

.notif-item {
    padding: 10px;
    border-bottom: 1px solid #2a3b55;
    font-size: 0.85rem;
    color: #d1d5db;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover { background: #1f2a48; }

/* --- CHAT V3 (DESIGN FINAL AVEC AMIS) --- */
.chat-widget {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 320px;
    background: #16213e;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.6);
    z-index: 9999;
    border: 1px solid #2a3b55;
    overflow: hidden;
    touch-action: none;
    font-family: 'Nunito', sans-serif;
}

.chat-header {
    background: linear-gradient(90deg, #4361ee, #4cc9f0);
    padding: 15px;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-header:active { cursor: grabbing; }

.header-left { display: flex; gap: 8px; align-items: center; font-weight: bold; }

/* Les boutons (+ et -) */
.chat-controls { display: flex; gap: 10px; }

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex; justify-content: center; align-items: center;
    transition: background 0.2s;
    font-size: 1.1rem;
}
.btn-icon:hover { background: rgba(255,255,255,0.4); }

.chat-body {
    height: 350px;
    overflow-y: auto;
    background: #0f172a;
    display: flex;
    flex-direction: column;
}

/* Style des Amis */
.chat-friend {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #1f2a48;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.chat-friend:hover { background: #1f2a48; }

.avatar-container {
    position: relative;
    margin-right: 15px;
}

.friend-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2a3b55;
}

.status-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 12px; height: 12px;
    background-color: #2ecc71;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.friend-info {
    flex: 1;
    overflow: hidden;
}

.friend-info strong {
    color: #fff;
    font-size: 1rem;
    display: block;
    margin-bottom: 4px;
}

.friend-info p {
    color: #a0a0a0;
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Si non lu */
.chat-friend.unread .friend-info strong { color: #4cc9f0; }
.chat-friend.unread .friend-info p { color: #fff; font-weight: bold; }

/* Version réduite */
.chat-widget.minimized .chat-body { height: 0; }
.chat-widget.minimized { width: 220px; border-radius: 15px; }

/* --- LE FIL SOCIAL (STYLE FACEBOOK) --- */

.feed-container {
    max-width: 700px; /* Plus étroit pour ressembler à un fil d'actu mobile/app */
    margin: 0 auto;
    padding: 20px;
}

/* Zone de création de post */
.create-post-box {
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #2a3b55;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.create-input {
    flex: 1;
    background: #0f172a;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: white;
    font-family: 'Nunito', sans-serif;
}

/* LA CARTE DE POST */
.social-post {
    background: #16213e;
    border-radius: 15px;
    border: 1px solid #2a3b55;
    margin-bottom: 30px;
    overflow: hidden;
}

.post-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar-small {
    width: 45px; height: 45px;
    border-radius: 50%;
    border: 2px solid #4cc9f0;
}

.post-info h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 2px;
}

.post-info span {
    color: #6c757d;
    font-size: 0.8rem;
}

.post-body {
    padding: 0 15px 15px 15px;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Image dans le post */
.post-image-container {
    width: 100%;
    height: 300px;
    background-color: #0f172a;
    margin-top: 10px;
}

.post-img-real {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'image remplit le cadre sans être écrasée */
}

/* Barre de réactions (J'aime / Commenter) */
.post-actions {
    border-top: 1px solid #2a3b55;
    border-bottom: 1px solid #2a3b55;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

.action-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.action-btn:hover { color: #4cc9f0; }
.action-btn.liked { color: #ff4757; } /* Quand c'est liké */

/* Section Commentaires */
.comment-section {
    padding: 15px;
    background: #121b35;
}

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.comment-bubble {
    background: #1f2a48;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #d1d5db;
}

.comment-bubble strong {
    color: #4cc9f0;
    display: block;
    margin-bottom: 3px;
    font-size: 0.85rem;
}

/* --- MODALE D'ÉDITION (Le costume manquant !) --- */
.modal-overlay {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open { display: flex; } /* On l'affiche quand on ajoute la classe "open" */

.modal-box {
    background: #16213e;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #4cc9f0;
    box-shadow: 0 0 30px rgba(76, 201, 240, 0.2);
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: #a0a0a0; margin-bottom: 8px; font-size: 0.9rem; }

.modal-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #2a3b55;
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
}
.modal-input:focus { border-color: #4cc9f0; outline: none; }

.modal-buttons { display: flex; justify-content: space-between; margin-top: 30px; }

.btn-cancel {
    background: transparent; border: 1px solid #ff4757; color: #ff4757;
    padding: 10px 20px; border-radius: 10px; cursor: pointer;
}

.btn-save-modal {
    background: #4cc9f0; border: none; color: #0f172a;
    padding: 10px 30px; border-radius: 10px; font-weight: bold; cursor: pointer;
}

/* --- NOUVEAUTÉS PROFIL V3 (BADGES & AMIS) --- */

/* 1. La Grille des Amis */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 amis par ligne */
    gap: 10px;
    margin-top: 15px;
}

.friend-face {
    width: 45px; height: 45px;
    border-radius: 50%;
    border: 2px solid #2a3b55;
    transition: transform 0.2s;
    cursor: pointer;
}
.friend-face:hover { transform: scale(1.1); border-color: #4cc9f0; }

/* 2. La Grille des Badges */
.badges-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.badge-item {
    background: #0f172a;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #2a3b55;
    opacity: 0.4; /* Grisé par défaut (verrouillé) */
    filter: grayscale(100%);
    transition: all 0.5s;
    position: relative;
}

.badge-item.unlocked {
    opacity: 1;
    filter: grayscale(0%);
    border-color: #feca57; /* Or */
    box-shadow: 0 0 15px rgba(254, 202, 87, 0.2);
    transform: scale(1.05);
}

.badge-icon { font-size: 1.5rem; display: block; margin-bottom: 5px; }
.badge-name { font-size: 0.7rem; color: #a0a0a0; display: block; }

/* 3. Le Fil d'Actu Personnel (Timeline) */
.timeline {
    position: relative;
    border-left: 2px solid #2a3b55;
    margin-left: 10px;
    padding-left: 20px;
}

.timeline-item {
    margin-bottom: 30px;
    position: relative;
}

/* Le petit point sur la ligne */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px; top: 0;
    width: 10px; height: 10px;
    background: #4cc9f0;
    border-radius: 50%;
    border: 3px solid #16213e;
}

.timeline-date { font-size: 0.8rem; color: #6c757d; margin-bottom: 5px; display: block; }
.timeline-content {
    background: #1f2a48;
    padding: 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #e0e0e0;
}
.timeline-highlight { color: #4cc9f0; font-weight: bold; }

/* Bouton triche pour tester les badges */
.btn-cheat {
    width: 100%; margin-top: 10px; background: #2a3b55; 
    border: none; color: white; padding: 5px; border-radius: 5px; cursor: pointer; font-size: 0.8rem;
}
.btn-cheat:hover { background: #4cc9f0; color: #0f172a; }

/* --- SYSTÈME DE NOTIFICATIONS (TOASTS) --- */

/* Le conteneur invisible qui va empiler les messages */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%); /* Centré horizontalement */
    z-index: 20000; /* Au-dessus de TOUT (même les modales) */
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none; /* Pour pouvoir cliquer à travers le vide */
}

/* La Bulle de Notification elle-même */
.toast {
    background: rgba(22, 33, 62, 0.95); /* Fond sombre quasi opaque */
    border: 1px solid #4cc9f0; /* Bordure bleu néon */
    color: white;
    padding: 15px 30px;
    border-radius: 50px; /* Très arrondi */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 320px;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effet rebond */
    backdrop-filter: blur(5px);
    pointer-events: auto; /* La bulle est cliquable si besoin */
}

/* Variantes de couleurs */
.toast.success { border-color: #2ecc71; box-shadow: 0 5px 20px rgba(46, 204, 113, 0.3); } /* Vert */
.toast.level-up { border-color: #feca57; box-shadow: 0 5px 20px rgba(254, 202, 87, 0.3); } /* Or */
.toast.info { border-color: #4cc9f0; } /* Bleu */

/* L'icône dans la notif */
.toast-icon { font-size: 1.5rem; }

/* Animations */
@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-30px) scale(0.9); }
}

/* =================================================================
   ⬇️ PATCH DE CORRECTION (A COLLER A LA FIN DU FICHIER) ⬇️
   ================================================================= */

/* 1. CORRECTION DE LA CLOCHE (Taille fixe pour éviter qu'elle saute) */
.notif-box {
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
}

.badge-notif {
    top: 0 !important;
    right: 0 !important;
    width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 0.65rem;
}

/* 2. LE NOUVEAU PROFIL (Ce qui manquait et causait le logo géant) */
.profile-cover-container {
    height: 250px;
    width: 100%;
    background-color: #2a3b55;
    background-size: cover;
    background-position: center;
    position: relative;
}

.profile-header-content {
    background: linear-gradient(to bottom, rgba(26,26,46,0.8), #1a1a2e);
    padding: 20px;
    border-bottom: 1px solid #2a3b55;
}

/* Le conteneur qui fait chevaucher la photo sur la bannière */
.profile-info-container-v2 {
    max-width: 900px;
    margin: -100px auto 0 auto; /* C'est cette ligne qui fait la magie */
    display: flex;
    align-items: flex-end; /* Aligne le texte en bas */
    gap: 30px;
    position: relative;
    z-index: 2;
}

/* LA CORRECTION DU LOGO GÉANT EST ICI */
.profile-avatar-v2 {
    width: 160px;  /* On force la taille */
    height: 160px; /* On force la taille */
    border-radius: 50%;
    border: 6px solid #1a1a2e;
    object-fit: cover;
    background-color: #0f172a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.public-mood-badge {
    display: inline-block;
    background: #4361ee;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: bold;
}

/* Version Mobile du profil */
@media (max-width: 768px) {
    .profile-info-container-v2 {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -80px;
    }
    .profile-avatar-v2 {
        width: 140px;
        height: 140px;
    }
}

/* --- COULEURS DES HUMEURS --- */
.mood-badge.calme { background-color: #2ecc71 !important; color: #0f172a; } /* Vert */
.mood-badge.surcharge { background-color: #ff4757 !important; color: white; } /* Rouge */
.mood-badge.energique { background-color: #feca57 !important; color: #0f172a; } /* Jaune */
.mood-badge.fatigue { background-color: #576574 !important; color: white; } /* Gris */

/* Badge Spécial Fondateur */
.badge-founder {
    background: linear-gradient(45deg, #ffd700, #fdb931);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    border: 1px solid #fff;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
}

/* =======================================================
   NOUVEAU DESIGN COMMUNAUTÉ (3 COLONNES & MOBILE)
   ======================================================= */

/* Le conteneur principal devient une grille */
.community-layout {
    display: grid;
    grid-template-columns: 250px 1fr 280px; /* Gauche Fixe - Centre Elastique - Droite Fixe */
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    align-items: start;
}

/* Colonne de Gauche (Filtres) */
.comm-sidebar-left {
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #2a3b55;
    position: sticky;
    top: 20px; /* Reste accroché quand on scrolle */
}

.filter-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    color: #a0a0a0;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
}
.filter-btn:hover { background: #1f2a48; color: white; padding-left: 20px; }
.filter-btn.active { background: #4cc9f0; color: #1a1a2e; font-weight: bold; }

/* Colonne Centrale (Fil d'actu) */
.comm-feed {
    width: 100%;
}

/* Colonne de Droite (Infos) */
.comm-sidebar-right {
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #2a3b55;
}

/* MODALE PROFIL UTILISATEUR (Quand on clique sur une photo) */
.user-modal-box {
    text-align: center;
    background: radial-gradient(circle at top, #233055, #16213e);
}
.user-modal-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    border: 4px solid #4cc9f0; margin-bottom: 15px;
    object-fit: cover;
}

/* Bouton Supprimer (Corbeille) */
.btn-delete-post {
    background: transparent; border: none; color: #ff4757;
    cursor: pointer; font-size: 1.1rem; padding: 5px;
    margin-left: auto; transition: transform 0.2s;
}
.btn-delete-post:hover { transform: scale(1.2); }

/* --- RESPONSIVE MOBILE (C'est ici qu'on règle les problèmes de téléphone) --- */
@media (max-width: 900px) {
    .community-layout {
        display: flex;
        flex-direction: column-reverse; /* On met le menu en bas ou haut selon préférence, ici colonne simple */
    }
    
    /* On change l'ordre : D'abord le fil, ensuite les filtres */
    .comm-sidebar-left {
        width: 100%;
        position: static; /* Ne flotte plus */
        margin-bottom: 20px;
        order: 2; /* Les filtres passent après le fil sur mobile, ou avant (1) selon ton choix */
    }
    
    .comm-feed {
        width: 100%;
        order: 1; /* Le fil d'actu en premier */
    }

    .comm-sidebar-right {
        display: none; /* On cache la colonne de droite sur mobile pour gagner de la place */
    }

    /* Ajustement des filtres en mode "boutons horizontaux" sur mobile */
    .comm-sidebar-left {
        display: flex;
        overflow-x: auto; /* Scroll horizontal si ça dépasse */
        gap: 10px;
        padding: 10px;
        white-space: nowrap;
    }
    .filter-btn {
        width: auto;
        margin-bottom: 0;
        background: #1f2a48;
    }
}

/* =======================================================
   DESIGN COMMUNAUTÉ V3 (Largeur & Commentaires Propres)
   ======================================================= */

/* 1. LAYOUT : On réduit un peu les côtés pour laisser de la place au centre */
.community-layout {
    display: grid;
    grid-template-columns: 220px 1fr 250px; /* Côtés plus fins = Centre plus large */
    gap: 20px;
    max-width: 1300px; /* On autorise plus de largeur totale */
    margin: 30px auto;
    padding: 0 15px;
    align-items: start;
}

/* 2. AVATARS (FORCE TAILLE) */
img.user-avatar-small, .post-header img, .create-post-box img, .comment-avatar {
    width: 45px !important; height: 45px !important;
    min-width: 45px !important; max-width: 45px !important;
    border-radius: 50% !important; object-fit: cover !important;
    display: block !important;
}
.comment-avatar { width: 35px !important; height: 35px !important; min-width: 35px !important; }

/* 3. COMMENTAIRES (Design Chat) */
.comments-list {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2a3b55;
    display: none; /* Masqué par défaut */
}
.comments-list.open { display: block; animation: fadeIn 0.3s; }

.single-comment {
    display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-start;
}

.comment-bubble {
    background: #0f172a; /* Fond très sombre */
    padding: 10px 15px;
    border-radius: 0 15px 15px 15px; /* Forme de bulle */
    flex: 1;
    border: 1px solid #2a3b55;
}

.comment-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 5px; font-size: 0.85rem;
}
.comment-author { color: #e0e0e0; font-weight: bold; }
.comment-like-btn {
    background: none; border: none; cursor: pointer; color: #6c757d; font-size: 0.8rem;
    transition: color 0.2s;
}
.comment-like-btn:hover { color: #ff4757; }
.comment-like-btn.liked { color: #ff4757; }

/* 4. ZONE DE RÉPONSE (Jolie) */
.comment-input-area {
    display: flex; gap: 10px; margin-top: 15px; align-items: center;
    background: #0f172a; padding: 5px; border-radius: 30px; border: 1px solid #2a3b55;
}
.input-comment {
    flex: 1; background: transparent; border: none; color: white;
    padding: 10px 15px; font-family: 'Nunito', sans-serif; outline: none;
}
.btn-send-comment {
    background: #4361ee; color: white; border: none;
    width: 35px; height: 35px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.btn-send-comment:hover { background: #3a0ca3; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* MOBILE */
@media (max-width: 900px) {
    .community-layout { display: flex; flex-direction: column-reverse; }
    .comm-sidebar-left { overflow-x: auto; display: flex; gap: 10px; padding-bottom: 10px; }
    .filter-btn { white-space: nowrap; width: auto; }
    .comm-sidebar-right { display: none; }
}

/* =======================================================
   ⬇️ PATCH FINAL : LARGEUR & DESIGN MODERNE ⬇️
   ======================================================= */

/* 1. ON ÉLARGIT TOUT (Pour remplir l'écran) */
.community-layout {
    max-width: 1600px !important; /* Beaucoup plus large (c'était 1100px) */
    width: 96% !important;        /* Prend 96% de la largeur de l'écran */
    grid-template-columns: 300px 1fr 350px !important; /* Colonnes latérales plus larges */
    gap: 40px !important;         /* Plus d'espace pour respirer */
}

/* 2. LE CHAMP "RÉPONDRE" (Transformation Totale) */
/* Le conteneur (la bulle autour du champ) */
.comment-input-area {
    background-color: #0b101e !important; /* Fond noir/bleu très profond */
    border: 1px solid #2a3b55 !important;
    border-radius: 50px !important;       /* Forme de pilule bien ronde */
    padding: 10px 20px !important;
    margin-top: 20px !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5) !important; /* Légère ombre interne */
}

/* Le champ de texte lui-même */
.input-comment {
    background: transparent !important;   /* Transparent pour garder le fond sombre */
    border: none !important;
    color: #e0e0e0 !important;            /* Texte blanc cassé */
    width: 100% !important;
    font-size: 1.05rem !important;        /* Texte plus grand */
    font-family: 'Nunito', sans-serif !important;
    outline: none !important;             /* Enlève le cadre bleu moche au clic */
}

/* Le bouton "Envoyer" (La flèche) */
.btn-send-comment {
    background: #4cc9f0 !important;       /* Bleu Cyan */
    color: #1a1a2e !important;            /* Flèche sombre */
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;        /* Rond parfait */
    font-size: 1.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 15px !important;
    cursor: pointer !important;
    border: none !important;
    transition: transform 0.2s, background 0.2s !important;
}
.btn-send-comment:hover {
    transform: scale(1.1);
    background: #fff !important; /* Devient blanc au survol */
}

/* 3. ON AGGRANDIT LES TEXTES & L'ESPACE */
.social-post {
    padding: 25px !important; /* Plus d'espace dans les cartes */
    border-radius: 20px !important;
    margin-bottom: 40px !important;
    border: 1px solid #2a3b55 !important;
    background: #16213e !important;
}

.post-body p {
    font-size: 1.15rem !important; /* Texte des messages plus grand */
    line-height: 1.7 !important;   /* Plus aéré */
    color: #ecf0f1 !important;     /* Blanc plus éclatant */
}

.post-info h4 {
    font-size: 1.1rem !important;
}

/* Les commentaires déjà postés */
.single-comment {
    margin-bottom: 15px !important;
}
.comment-bubble {
    background-color: #1f2a48 !important;
    padding: 12px 18px !important;
    border-radius: 18px !important;
    font-size: 1rem !important; /* Commentaires plus lisibles */
}

/* 4. RESPONSIVE (Toujours propre sur mobile) */
@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 250px 1fr !important; /* On cache la droite sur tablette */
    }
    .comm-sidebar-right { display: none !important; }
}

@media (max-width: 900px) {
    .community-layout {
        display: flex !important;
        flex-direction: column-reverse !important;
        width: 100% !important;
        padding: 10px !important;
    }
    .comm-sidebar-left {
        width: 100% !important;
        overflow-x: auto !important; /* Scroll horizontal pour les filtres */
        padding-bottom: 15px !important;
    }
}

/* =======================================================
   ⬇️ PATCH FINAL : RESPONSIVE UNIVERSEL (PC & MOBILE) ⬇️
   ======================================================= */

/* 1. BASE (PC) : On utilise la largeur mais sans forcer bêtement */
.community-layout {
    display: grid;
    /* On définit les tailles : Gauche (250px) - Milieu (Auto) - Droite (300px) */
    grid-template-columns: 250px 1fr 300px; 
    gap: 30px;
    max-width: 1400px;
    width: 95%;
    margin: 30px auto;
    padding: 0 15px;
    align-items: start;
}

/* 2. TABLETTE (On cache la droite pour gagner de la place) */
@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 220px 1fr; /* Plus que 2 colonnes */
    }
    .comm-sidebar-right {
        display: none; /* Bye bye la colonne de droite */
    }
}

/* 3. MOBILE (LE PLUS IMPORTANT POUR TOI) */
@media (max-width: 850px) {
    /* On empêche le zoom horizontal */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* On passe tout en colonne unique */
    .community-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 10px !important;
        gap: 15px !important;
    }

    /* La colonne de gauche (Filtres) devient une barre horizontale défilante */
    .comm-sidebar-left {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        display: flex !important;
        overflow-x: auto !important; /* Scroll horizontal */
        padding-bottom: 10px !important;
        white-space: nowrap !important;
        border: none !important;
        background: transparent !important;
    }

    /* Les boutons de filtre sur mobile */
    .filter-btn {
        width: auto !important;
        display: inline-block !important;
        margin-right: 10px !important;
        background: #16213e !important;
        padding: 8px 15px !important;
        border: 1px solid #2a3b55 !important;
    }

    /* Le fil d'actu prend toute la place */
    .comm-feed {
        width: 100% !important;
    }

    /* On cache la droite */
    .comm-sidebar-right {
        display: none !important;
    }

    /* Ajustement de la bannière profil sur mobile */
    .profile-info-container-v2 {
        flex-direction: column;
        text-align: center;
        margin-top: -60px;
        align-items: center;
    }
    
    .profile-avatar-v2 {
        width: 130px !important;
        height: 130px !important;
        border: 4px solid #1a1a2e;
    }

    /* Correction des textes qui se rentrent dedans */
    .hero-content h1 { font-size: 2rem !important; }
    .hero-section { min-height: auto !important; padding-bottom: 50px; }
}

/* =======================================================
   💬 STYLE DU TCHAT (Bulles façon Messenger)
   ======================================================= */

/* Le corps du chat où les messages défilent */
.chat-messages-area {
    height: 300px;
    overflow-y: auto; /* Scroll si trop de messages */
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #0b101e;
}

/* Une ligne de message (contient la bulle) */
.msg-row {
    display: flex;
    width: 100%;
}

/* Mes messages (à droite) */
.msg-row.me {
    justify-content: flex-end;
}

/* Messages de l'autre (à gauche) */
.msg-row.other {
    justify-content: flex-start;
}

/* La Bulle elle-même */
.msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

/* Couleur Bulle MOI */
.msg-bubble.blue {
    background: #4cc9f0;
    color: #0f172a;
    border-bottom-right-radius: 2px; /* Petit effet coin */
}

/* Couleur Bulle AUTRE */
.msg-bubble.grey {
    background: #1f2a48;
    color: white;
    border: 1px solid #2a3b55;
    border-bottom-left-radius: 2px;
}

/* Zone de saisie en bas du chat */
.chat-input-zone {
    padding: 10px;
    border-top: 1px solid #2a3b55;
    display: flex;
    gap: 10px;
    background: #16213e;
}

.chat-input-field {
    flex: 1;
    background: #0b101e;
    border: 1px solid #2a3b55;
    color: white;
    border-radius: 20px;
    padding: 8px 12px;
    outline: none;
}

.chat-send-btn {
    background: #4cc9f0;
    border: none;
    width: 35px; height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}