/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* COULEURS */
    --color-primary: #6C63FF;
    --color-secondary: #00B894;
    --color-accent: #FFD6E8;
    --color-background: #F0F2F5;
    --color-text: #2D3436;
    --color-muted: #dfe6e9;
    --color-border: #6c757d;
    --color-light: #ffffff;
    
    /* BACKGROUNDS CATEGORIES (Homepage) */
    --bg-category-1: linear-gradient(135deg, #e0f7fa, #ffffff);
    --bg-category-2: linear-gradient(135deg, #f1f8e9, #ffffff);
    --bg-category-3: linear-gradient(135deg, #fce4ec, #ffffff);
    --bg-category-4: linear-gradient(135deg, #ede7f6, #ffffff);

    /* TYPOGRAPHIE */
    --font-family-primary: 'Poppins', sans-serif;

    /* FONT SIZES */
    --font-size-small: 12px;
    --font-size-regular: 16px;
    --font-size-large: 20px;
    --font-size-xlarge: 28px;
    --font-size-xxlarge: 32px;

    /* BORDER RADIUS */
    --radius-small: 8px;
    --radius-medium: 20px;
    --radius-full: 9999px;

    /* SPACING */
    --spacing-small: 10px;
    --spacing-medium: 20px;
    --spacing-large: 30px;
    --spacing-xlarge: 50px;

    /* SHADOWS */
    --shadow-small: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 25px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding-top: 70px; /* Espace pour le header fixed */
}

p {
    margin: 0 0 1em 0;
}

p a {
    color: var(--color-accent);
    text-decoration: none;
}

p a:hover {
    text-decoration: underline;
}

/* =========================================
   2. HEADER & NAVIGATION (Commun)
   ========================================= */
.new-header {
    background-color: var(--color-primary);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.logo-section {
    display: flex;
    justify-content: start;
    align-items: center;
    flex-direction: row;
    gap: 15px;
}

.logo {
    width: 60px;
    height: auto;
}

.logo-section img:not(.logo) {
    max-height: 40px;
    object-fit: contain;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}

.menu-link {
    text-decoration: none;
    color: var(--color-light); 
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.15); 
    color: var(--color-light);
}

/* =========================================
   3. BREADCRUMB (Commun)
   ========================================= */
.new-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;
    font-size: 0.9em;
}

.breadcrumb-item {
    text-decoration: none;
    color: var(--color-text);
    font-weight: bold;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--color-muted);
}

/* =========================================
   4. HOMEPAGE (Logic preserved)
   ========================================= */
.forum-fluid-layout {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 20px;
}

.forum-section {
    background-color: var(--color-light);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    margin-bottom: 30px;
    border: 1px solid var(--color-muted);
    overflow: hidden; 
}

.forum-section > a {
    text-decoration: none;
    display: block;
}

.forum-header {
    margin: 0;
    padding: 15px 20px;
    font-size: 1.4em;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-muted);
    transition: filter 0.2s;
}

.forum-section > a:hover .forum-header {
    filter: brightness(96%);
}

/* Couleurs alternées pour les headers de catégories */
.forum-section:nth-of-type(4n+1) .forum-header { background: var(--bg-category-1); }
.forum-section:nth-of-type(4n+2) .forum-header { background: var(--bg-category-2); }
.forum-section:nth-of-type(4n+3) .forum-header { background: var(--bg-category-3); }
.forum-section:nth-of-type(4n+4) .forum-header { background: var(--bg-category-4); }

.forum-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-muted);
    gap: 15px;
    transition: background-color 0.2s;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-item:hover {
    background-color: #fcfcfc;
}

.forum-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-muted);
}

.forum-subject {
    flex: 1;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1.05em;
    line-height: 1.3;
}

.forum-subject:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.forum-author {
    font-size: 0.9em;
    min-width: 130px;
    color: var(--color-border);
}

.forum-author a {
    color: var(--color-border);
    text-decoration: none;
    font-weight: 500;
}

.forum-author a:hover {
    color: var(--color-primary);
}

.forum-messages, .forum-last-message {
    font-size: 0.9em;
    color: var(--color-border);
    min-width: 140px;
    text-align: right;
    white-space: nowrap;
}

/* =========================================
   5. THREAD PAGE (Adapté au DOM fourni)
   ========================================= */
.thread-container {
    max-width: 1000px;
    margin: 30px auto 60px;
    padding: 0 20px;
}

/* En-tête du sujet */
.thread-header {
    text-align: center;
    margin-bottom: var(--spacing-medium);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-medium);
}

.thread-title {
    font-size: var(--font-size-xlarge);
    color: var(--color-primary);
    margin: 0 0 10px 0;
}

.thread-meta {
    font-size: var(--font-size-small);
    color: var(--color-primary);
}

/* Liste des réponses */
/* Le DOM a des sections imbriquées, on gère l'espacement ici */
.replies {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
}

/* Reset pour les sections imbriquées afin d'éviter les doubles marges */
.replies .replies {
    gap: var(--spacing-medium);
    margin: 0;
}

.post {
    background: var(--color-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    padding: var(--spacing-medium);
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
}

/* Bloc Auteur (dans le DOM c'est un <a class="..."> direct) */
.post > a {
    display: flex;
    align-items: center;
    gap: var(--spacing-small);
    text-decoration: none;
    border-bottom: 1px solid #eee;
    padding-bottom: var(--spacing-small);
}

.post .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.post .author-name {
    font-weight: bold;
    color: var(--color-primary);
    margin: 0;
    font-size: var(--font-size-regular);
}

.post-content {
    font-size: var(--font-size-regular);
    color: var(--color-text);
}

/* Réponse rapide */
.quick-reply {
    background: var(--color-light);
    padding: var(--spacing-medium);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-small);
    border: 1px solid var(--color-border);
    margin-top: var(--spacing-large);
}

.reply-title {
    font-size: var(--font-size-large);
    margin-top: 0;
    margin-bottom: var(--spacing-small);
    color: var(--color-primary);
}

.reply-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small);
}

.reply-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: var(--spacing-small);
    border: 1px solid var(--color-muted);
    border-radius: var(--radius-small);
    min-height: 120px;
    font-family: inherit;
    font-size: var(--font-size-regular);
    resize: vertical;
}

.reply-button {
    align-self: flex-end;
    background: var(--color-secondary);
    color: var(--color-light);
    padding: 10px 25px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.reply-button:hover {
    background: var(--color-primary);
}

/* =========================================
   6. USER PROFILE PAGE
   ========================================= */
.profile-container {
    max-width: 900px;
    margin: 30px auto 60px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
}

.profile-header {
    background: var(--color-light);
    padding: var(--spacing-large);
    border-radius: var(--radius-medium);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-background);
    box-shadow: var(--shadow-medium);
}

.profile-name {
    margin: 5px 0 0 0;
    font-size: var(--font-size-xxlarge);
    color: var(--color-primary);
}

.profile-role {
    margin: 0;
    color: var(--color-muted);
    font-size: var(--font-size-regular);
}

.profile-info, 
.profile-topics {
    background: var(--color-light);
    padding: var(--spacing-medium);
    border-radius: var(--radius-medium);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-small);
}

.info-title, 
.topics-title {
    font-size: var(--font-size-large);
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: var(--spacing-medium);
    padding-bottom: 5px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.info-list, 
.topics-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-list li {
    font-size: var(--font-size-regular);
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 5px;
}

.info-list li:last-child {
    border-bottom: none;
}

/* =========================================
   7. FOOTER (Commun)
   ========================================= */
.new-footer {
    background-color: var(--color-text);
    color: var(--color-muted);
    padding: 40px 20px;
    text-align: center;
    margin-top: auto; /* Push footer to bottom if content is short */
}

.footer-top {
    margin-bottom: 15px;
    color: var(--color-light);
    font-size: 0.9em;
}

.footer-bottom {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--color-light);
    text-decoration: underline;
}

/* =========================================
   8. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .menu-list {
        flex-wrap: wrap;
        justify-content: center;
    }

    body {
        padding-top: 130px; 
    }

    /* Homepage Mobile */
    .forum-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .forum-avatar {
        display: none;
    }
    .forum-author, 
    .forum-messages, 
    .forum-last-message {
        text-align: left;
        font-size: 0.8em;
    }

    /* Thread Mobile */
    .thread-title {
        font-size: var(--font-size-large);
    }
}