:root {
  /* -- Thème Clair (défaut) -- */
  --color-bg: #FFF8E1;
  --color-surface: #FFFFFF;
  --color-border: #FFECB3;
  --color-text-primary: #423B1B;
  --color-text-secondary: #756941;
  --color-accent: #FFA000;
  --color-accent-hover: #FF8F00;
  
  /* -- Couleurs fixes -- */
  --color-text-on-accent: #FFFFFF;
  --color-banner-overlay: rgba(20, 30, 40, 0.5);
  --color-banner-text-primary: #FFFFFF;
  --color-banner-text-secondary: #E5E7EB;

  /* -- Polices & Espacements -- */
  --font-family: 'Inter', sans-serif;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
}

body.dark-mode {
  /* -- Thème Sombre -- */
  --color-bg: #2E280C;
  --color-surface: #423A1B;
  --color-border: #574B24;
  --color-text-primary: #FFF8E1;
  --color-text-secondary: #D1C6A4;
  --color-accent: #FFCA28;
  --color-accent-hover: #FFD54F;
}

/* ===== CONFIGURATION GLOBALE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== HEADER ===== */
.site-header {
  border-bottom: 1px solid var(--color-border);
  transition: border-color 0.3s ease;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-decoration: none;
}
.logo img {
  height: 40px;
}
.main-nav {
  display: flex;
  gap: 2rem;
}
.main-nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--color-accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
#theme-toggle:hover {
  background-color: var(--color-bg);
  color: var(--color-accent);
}
.login-button {
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.login-button:hover {
  background-color: var(--color-accent-hover);
}

/* ===== BANNIÈRE ===== */
.banner {
  text-align: center;
  border-radius: var(--radius);
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.banner-content {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    /* Superposition sombre fixe pour garantir le contraste */
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.banner h1 {
  font-size: 2.5rem;
  /* Couleur claire fixe */
  color: #FFFFFF;
}
.banner p {
  font-size: 1.1rem;
  /* Couleur claire fixe */
  color: #E5E7EB;
  margin-top: 0.5rem;
}

/* ===== CONTENU PRINCIPAL ===== */
.main-content {
  padding: 2rem 0;
}
.category-section {
  margin-bottom: 3rem;
}
.category-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
}
.category-title a{
    text-decoration: none;
    color: inherit;
}
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.thread-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.thread-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.thread-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 150px;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}
.thread-author:hover {
    color: var(--color-accent);
}
.thread-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.thread-author span {
  font-weight: 500;
}
.thread-details {
  flex-grow: 1;
}
.thread-details h3 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem 0;
}
.thread-details h3 a {
  color: var(--color-text-primary);
  text-decoration: none;
}
.thread-details h3 a:hover {
  color: var(--color-accent);
}
.thread-meta {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}
.thread-meta a {
  font-weight: 500;
  color: var(--color-text-secondary);
}
.thread-meta a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}
.thread-stats {
  display: flex;
  gap: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.stat-item strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* ===== ANIMATION AU SCROLL ===== */
[data-animate="fade-in"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="fade-in"].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
  padding: 2rem 0;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
}
.footer-nav a {
  font-weight: 500;
  color: var(--color-text-secondary);
}
.footer-nav a:hover {
  color: var(--color-accent);
}

/* ===== STYLES DES AUTRES PAGES ===== */
.page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.button {
    background-color: var(--color-accent);
    color: var(--color-text-on-accent);
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.button:hover {
    background-color: var(--color-accent-hover);
}
.breadcrumb {
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--color-accent);
}
.breadcrumb span {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* ===== PAGE CATÉGORIES ===== */
.category-list-full {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
a.category-card-full {
    text-decoration: none;
    color: var(--color-text-primary);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.category-card-full {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
a.category-card-full:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-info h3 {
    font-size: 1.3rem;
    transition: color 0.2s ease;
}
a.category-card-full:hover .category-info h3 {
    color: var(--color-accent);
}
.category-info p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.category-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.pagination a, .pagination span {
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    color: var(--color-text-secondary);
}
.pagination a:hover {
    background-color: var(--color-surface);
    border-color: var(--color-pagination-border-hover);
}
.pagination .page-active {
    background-color: var(--color-accent);
    color: var(--color-text-on-accent);
    border-color: var(--color-accent);
}

/* ===== PAGE SUJET (THREAD) ===== */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.post-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.author-name {
    font-weight: 700;
    color: var(--color-text-primary);
    text-decoration: none;
}
.post-date {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.post-content {
    padding: 1.5rem;
    line-height: 1.7;
}
.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.reply-form {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}
.reply-form h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}
.reply-form textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* ===== PAGE PROFIL ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: 2rem;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.profile-info h1 {
    margin: 0;
}
.profile-info p {
    color: var(--color-text-secondary);
}
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: flex-start;
}
.profile-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.profile-card-title {
    font-size: 1.2rem;
    text-align: left;
    margin-top: 0;
}
.profile-section {
    margin-bottom: 2rem;
}
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
}
.activity-item:hover {
    border-color: var(--color-accent);
}
.activity-title {
    color: var(--color-text-secondary);
    font-weight: 500;
}
.activity-title strong {
    color: var(--color-text-primary);
}
.activity-date {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    margin-left: 1rem;
}

/* ===== CONNEXION/INSCRIPTION ===== */
.auth-container {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 450px;
    margin: 2rem auto;
    box-shadow: var(--shadow);
}
.auth-container h2 {
    text-align: center;
    margin-top: 0;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
}
.auth-container .button {
    width: 100%;
    margin-top: 1rem;
}
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.auth-switch a {
    color: var(--color-accent);
}

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

/* .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;
} */
