:root {
    --font-main: 'Poppins', sans-serif;
    --color-background: #000000;
    --color-surface: rgba(29, 9, 44, 0.6);
    --color-surface-hover: rgba(45, 14, 68, 0.8);
    --color-border: rgba(255, 0, 255, 0.2);
    --color-text-primary: #F0F0F0;
    --color-text-secondary: #A0A0A0;
    --color-accent: #FF00FF;
    --color-accent-hover: #ff4dff;
    --color-glow-1: #700B97;
    --color-glow-2: #C300C3;
    --shadow-light: 0 8px 32px 0 rgba(255, 0, 255, 0.1);
    --color-background-translucent: rgba(0, 0, 0, 0.8);
    --color-accent-glow: rgba(255, 0, 255, 0.4);
    --color-background-overlay: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5));
    --color-on-accent: #000000;
    --color-link-on-surface: #FF00FF;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

ul {
    list-style: none;
}

h1, h2, h3 {
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- EFFET AURORE EN ARRIÈRE-PLAN --- */
.aurora-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

.aurora-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.3;
}

.aurora-shape.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--color-glow-1);
    top: -200px;
    left: -200px;
    animation: move-glow-1 20s infinite alternate;
}

.aurora-shape.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--color-glow-2);
    bottom: -150px;
    right: -150px;
    animation: move-glow-2 25s infinite alternate;
}

@keyframes move-glow-1 {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(200px, 300px) rotate(180deg); }
}
@keyframes move-glow-2 {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(-200px, -200px) rotate(360deg); }
}


/* --- COMPOSANTS GLOBAUX (HEADER, FOOTER, BTNS) --- */
.page-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    overflow-wrap: anywhere;
}

.main-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 2rem;
    padding: 1.5rem max(2rem, calc((100% - 1200px) / 2));
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-background-translucent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 0;
}

.logo span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.logo img {
    flex-shrink: 0;
    height: 32px;
    width: auto;
    max-width: 96px;
    object-fit: contain;
    border-radius: 6px;
}

.main-nav {
    display: flex;
    gap: 2rem;
    margin-left: auto;
}

.nav-link {
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-in-out;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.user-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

/* Le balisage n'utilise pas .container : la largeur utile est posée sur la zone de contenu */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-on-accent);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-on-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--color-accent-glow);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.main-footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border);
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--color-text-secondary);
    margin: 0 0.5rem;
}
.footer-links a:hover {
    color: var(--color-text-primary);
}

/* --- FIL D'ARIANE (BREADCRUMB) --- */
.breadcrumb-nav {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.breadcrumb-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb-nav a {
    color: var(--color-text-secondary);
}
.breadcrumb-nav a:hover {
    color: var(--color-text-primary);
}
.breadcrumb-nav .breadcrumb-separator {
    font-size: 0.8rem;
    margin: 0 0.25rem;
}

/* --- PAGE D'ACCUEIL (home.html) --- */
.hero-section {
    position: relative;
    padding: 4rem 2rem;
    border-radius: 12px;
    background-color: var(--color-surface);
    background-size: cover;
    background-position: center;
    text-align: center;
    overflow: hidden;
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-background-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: fit-content;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    /* Panneau translucide : le texte reste lisible quelle que soit la bannière */
    background: var(--color-background-translucent);
    backdrop-filter: blur(6px);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text-secondary);
}

.forum-main-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.category-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
}

.category-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.category-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
}
.category-header h3 a:hover{
    color:var(--color-accent);
}

.thread-list {
    padding: 0;
}

.thread-item {
    display: grid;
    grid-template-columns: 50px 1fr 150px 150px;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s ease;
}

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

.thread-item:hover {
    background-color: var(--color-surface-hover);
}

.thread-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
}

.thread-title {
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}
.thread-title:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
}

.thread-meta, .thread-author {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.thread-author {
    color: var(--color-text-primary);
}
.thread-author:hover {
    color: var(--color-accent);
}

.thread-stats, .thread-last-post {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: right;
}

.thread-stats span {
    display: block;
}

.thread-last-post a {
    font-weight: 500;
}

/* --- PAGE CATÉGORIES (categories.html) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.card-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.card-footer strong {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* --- PAGE SUJET (thread.html) --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.post-item.is-op {
    border-left: 3px solid var(--color-accent);
}

.post-author-info {
    min-width: 0;
    text-align: center;
    border-right: 1px solid var(--color-border);
    padding-right: 2rem;
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    border: 2px solid var(--color-border);
    display: block;
}

.author-name {
    display: block;
    overflow-wrap: anywhere;
    font-weight: 600;
    font-size: 1.1rem;
}

.author-role {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}
.is-op .author-role {
    color: var(--color-accent);
    font-weight: 500;
}

.post-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-header {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.post-body {
    flex-grow: 1;
    overflow-wrap: anywhere;
}

.post-body img,
.post-body video,
.post-body iframe {
    max-width: 100%;
}
.post-body img,
.post-body video {
    height: auto;
}
.post-body iframe {
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}
.post-body pre {
    white-space: pre-wrap;
}
.post-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.post-body p {
    margin-bottom: 1em;
}

.post-body a {
    color: var(--color-link-on-surface);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-body a:hover {
    color: var(--color-accent-hover);
}

/* --- PAGE PROFIL (user.html) --- */
.profile-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--color-accent);
}
.profile-name {
    font-size: 2.2rem;
    font-weight: 700;
}
.profile-meta {
    color: var(--color-text-secondary);
}
.profile-stats {
    margin-left: auto;
    display: flex;
    gap: 2rem;
    text-align: center;
}
.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 600;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.user-activity h2 {
    margin-bottom: 1.5rem;
}
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}
.activity-item {
    background: var(--color-surface);
    padding: 1.5rem;
}
.activity-type {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}
.activity-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.activity-excerpt {
    display: block;
    border-left: 3px solid var(--color-border);
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: var(--color-text-secondary);
    font-style: italic;
}
.activity-date {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    display: block;
    margin-top: 0.5rem;
}

/* --- PAGES DE FORMULAIRE (login.html, register.html) --- */
body.form-page-background {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.form-container {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    padding: 3rem;
}
.form-logo {
    justify-content: center;
    margin-bottom: 1.5rem;
}
.form-container h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: var(--color-background);
}

.form-button {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.form-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.form-switch a {
    color: var(--color-accent);
    font-weight: 500;
}
.form-switch a:hover {
    text-decoration: underline;
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    min-width: 45px;
    text-align: center;
    background: var(--color-surface);
    transition: all 0.3s ease;
}
.pagination a:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}
.pagination span.current-page {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: 700;
}

/* .forum-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 3fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.forum-item:first-of-type {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.forum-item:last-of-type {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 0;
}
.forum-item:only-of-type {
    border-radius: 8px;
} */

.forum-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
}

/* .forum-subject {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.4;
}
.forum-subject:hover {
    text-decoration: underline;
}

.forum-author,
.forum-messages,
.forum-last-message {
    font-size: 0.9rem;
}

.forum-author a {
    font-weight: 600;
    text-decoration: none;
}
.forum-author a:hover {
    text-decoration: underline;
}

.forum-messages {
    text-align: center;
}

.forum-last-message {
    text-align: right;
    white-space: nowrap;
} */

/* ---=== Balisage généré par Forum.php : .forum-section > a > h2.forum-header + .forum-item ===--- */
/* Les règles .forum-item ci-dessus sont en commentaire : les fils s'affichaient en texte brut.
   Même carte que .category-section, ligne de fil reprise de .thread-item (cf. docs/forums_generation.md §7). */
.forum-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}
.forum-section:has(> a > .forum-header):not(:has(.forum-item)) {
    display: none;
}
.forum-section > a {
    display: block;
    color: inherit;
}
.forum-section > a > .forum-header {
    display: block;
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
}
.forum-section > a:hover > .forum-header {
    color: var(--color-accent);
}
.forum-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 6.5rem 15.5rem;
    column-gap: 1.5rem;
    row-gap: 0.15rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s ease;
}
.forum-item:last-child {
    border-bottom: none;
}
.forum-item:hover {
    background-color: var(--color-surface-hover);
}
.forum-item .forum-avatar {
    grid-column: 1;
    grid-row: 1 / span 2;
    object-fit: cover;
    border: 2px solid var(--color-border);
}
.forum-subject {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    min-width: 0;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
}
.forum-subject:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
}
.forum-author {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    min-width: 0;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}
.forum-author a {
    color: var(--color-text-primary);
}
.forum-author a:hover {
    color: var(--color-accent);
}
.forum-messages,
.forum-last-message {
    grid-row: 1 / span 2;
    justify-self: end;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
    text-align: right;
    white-space: nowrap;
}
.forum-messages {
    grid-column: 3;
}
.forum-last-message {
    grid-column: 4;
}

/* --- MOBILE --- */
@media (max-width: 1100px) {
    .main-header {
        position: static;
        padding: 1rem 2rem;
    }
    .logo {
        flex: 1 1 100%;
    }
    .main-nav {
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    .forum-item {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        column-gap: 1rem;
        padding: 1rem 1.25rem;
    }
    .forum-item .forum-avatar {
        grid-row: 1 / span 3;
    }
    .forum-subject {
        grid-column: 2 / -1;
    }
    .forum-author {
        align-self: baseline;
    }
    .forum-messages {
        grid-column: 3;
        grid-row: 2;
        align-self: baseline;
    }
    .forum-last-message {
        grid-column: 2 / -1;
        grid-row: 3;
        justify-self: start;
        text-align: left;
        white-space: normal;
    }

    .post-item {
        grid-template-columns: 140px minmax(0, 1fr);
        gap: 1.5rem;
    }
    .post-author-info {
        padding-right: 1.5rem;
    }
}

@media (max-width: 560px) {
    .main-header {
        padding: 1rem;
        gap: 0.75rem 1rem;
    }
    .logo {
        font-size: 1.2rem;
    }
    .main-nav {
        gap: 1.5rem;
    }
    .user-actions {
        flex: 1 1 100%;
        margin-left: 0;
        gap: 0.75rem;
    }
    .user-actions .btn {
        flex: 1 1 0;
        padding: 0.5rem 0.75rem;
        text-align: center;
    }

    .content-area {
        padding: 0 1rem;
    }
    .breadcrumb-nav {
        margin-bottom: 1.25rem;
    }
    .hero-section {
        padding: 2rem 1rem;
    }
    .hero-content {
        padding: 1.25rem 1rem;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .forum-main-content {
        gap: 1.5rem;
    }
    .page-title {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
    }

    .forum-section > a > .forum-header {
        padding: 0.9rem 1rem;
        font-size: 1.2rem;
    }
    .forum-item {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        column-gap: 0.75rem;
        padding: 1rem;
    }
    .forum-item .forum-avatar {
        width: 40px;
        height: 40px;
        align-self: start;
    }
    .forum-subject {
        font-size: 1rem;
    }

    .post-list {
        gap: 1.25rem;
    }
    .post-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        padding: 1.25rem 1rem;
    }
    .post-author-info {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
        text-align: left;
        border-right: none;
        padding-right: 0;
    }
    .post-author-info .avatar {
        width: 48px;
        height: 48px;
        margin: 0;
    }
    .author-name {
        min-width: 0;
        font-size: 1rem;
    }
    .post-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .profile-header {
        flex-wrap: wrap;
        gap: 1.25rem;
        padding: 1.5rem;
    }
    .profile-info {
        min-width: 0;
    }
    .profile-name {
        font-size: 1.6rem;
        overflow-wrap: anywhere;
    }
    .profile-stats {
        margin-left: 0;
    }

    .main-footer {
        padding: 2rem 1rem;
    }
}
