:root {
  /* -- Couleurs de base -- */
  --color-background: #f5f7fa;
  --color-surface: #ffffff;
  --color-primary-text: #2d3748;
  --color-secondary-text: #718096;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  --color-black: #000000;

  /* -- Couleurs d'accentuation -- */
  --color-accent: #3182ce;
  --color-accent-hover: #2b6cb0;

  /* -- Couleurs avec transparence -- */
  --color-shadow-sm-rgba: rgba(45, 55, 72, 0.04);
  --color-shadow-md-rgba: rgba(45, 55, 72, 0.08);
  --color-focus-ring-rgba: rgba(49, 130, 206, 0.2);
  --color-hero-overlay-start-rgba: rgba(0, 0, 0, 0.6);
  --color-hero-overlay-end-rgba: rgba(0, 0, 0, 0);

  /* -- Couleurs pour le JS -- */
  --js-shape-color: rgba(49, 130, 206, 0.1);

  /* -- Typographie & Ombres (statiques) -- */
  --font-body: "Lato", sans-serif;
  --font-headings: "Poppins", sans-serif;
  --shadow-sm: 0 2px 4px var(--color-shadow-sm-rgba);
  --shadow-md: 0 4px 12px var(--color-shadow-md-rgba);
  --border-radius: 8px;
}

/* --- Base & Typographie --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-background);
  font-family: var(--font-body);
  color: var(--color-primary-text);
  line-height: 1.7;
}

#geometric-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headings);
  font-weight: 700;
}

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

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

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-headings);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-text);
}
.logo-link:hover {
  color: var(--color-primary-text);
}

.logo {
  height: 40px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-weight: 700;
  color: var(--color-secondary-text);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav-link.active,
.nav-link:hover {
  color: var(--color-primary-text);
  border-bottom-color: var(--color-accent);
}

.cta-button {
  background-color: var(--color-accent);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: var(--border-radius);
  border-bottom: none;
  transition: background-color 0.2s ease;
}
.cta-button:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
  border-bottom: none;
}

/* --- Bannière & Breadcrumb --- */
.hero-banner {
  margin-top: 32px;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}

.banner-image {
  width: 100%;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--color-hero-overlay-start-rgba) 0%,
    var(--color-hero-overlay-end-rgba) 100%
  );
  color: var(--color-white);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-overlay h1 {
  font-size: 2.5rem;
}
.hero-overlay p {
  font-size: 1.1rem;
  max-width: 50%;
}

.breadcrumb-nav {
  padding: 16px 0;
  font-size: 0.9rem;
  color: var(--color-secondary-text);
  display: flex;
  align-items: center;
}
.breadcrumb-nav ol {
  display: flex;
  list-style: none;
  margin-left: 8px;
}
.breadcrumb-nav li:not(:last-child)::after {
  content: "/";
  margin: 0 8px;
  color: var(--color-border);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* --- Grille de contenu & Sidebar --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  margin-top: 16px;
}

.sidebar .widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.sidebar .widget h4 {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.sidebar .widget ul {
  list-style: none;
}
.sidebar .widget li {
  margin-bottom: 8px;
}

.online-users img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  margin-right: -10px;
  transition: transform 0.2s ease;
}
.online-users img:hover {
  transform: translateY(-2px);
}
.online-users span {
  font-size: 0.8rem;
  color: var(--color-secondary-text);
  margin-left: 15px;
}

/* --- Listes (Catégories & Sujets) --- */
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}
.card-header h3 a {
  color: var(--color-primary-text);
}
.card-header p {
  color: var(--color-secondary-text);
  font-size: 0.9rem;
}

.thread-list {
  list-style: none;
}

.thread-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}
.thread-list li:first-child .thread-item {
  border-top: none;
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 16px;
}

.thread-details {
  flex-grow: 1;
}

.thread-title {
  font-weight: 700;
  color: var(--color-primary-text);
  display: block;
}

.thread-meta {
  font-size: 0.85rem;
  color: var(--color-secondary-text);
}
.thread-meta a {
  color: var(--color-primary-text);
  font-weight: 700;
}
.thread-meta a:hover {
  color: var(--color-accent);
}

.thread-stats {
  text-align: center;
  color: var(--color-secondary-text);
  font-size: 0.8rem;
  width: 80px;
  flex-shrink: 0;
}
.thread-stats span {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-accent);
}

.categories-list .category-item {
  display: flex;
  align-items: center;
  padding: 24px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.category-info {
  flex: 3;
}
.category-info h3 a {
  color: var(--color-primary-text);
}
.category-info p {
  font-size: 0.9rem;
  color: var(--color-secondary-text);
}
.category-stats {
  flex: 1;
  text-align: center;
  color: var(--color-secondary-text);
  font-size: 0.9rem;
}
.category-last-post {
  flex: 2;
  text-align: right;
  font-size: 0.9rem;
  color: var(--color-secondary-text);
}
.category-last-post p a {
  font-weight: 700;
  color: var(--color-primary-text);
}
.category-last-post span a {
  color: var(--color-secondary-text);
}

/* --- Page de Sujet (Thread) --- */
.thread-page-header {
  padding: 24px;
  margin-bottom: 32px;
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.post-list .post-card {
  display: flex;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.post-author-info {
  flex: 0 0 200px;
  padding: 24px;
  text-align: center;
  border-right: 1px solid var(--color-border);
}

.post-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 16px;
}
.post-author-name {
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--color-primary-text);
  font-size: 1.1rem;
  display: block;
}
.post-author-rank {
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 16px;
  display: block;
}
.post-author-stats p {
  font-size: 0.8rem;
  color: var(--color-secondary-text);
}

.post-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-header {
  padding: 16px 24px;
  font-size: 0.85rem;
  color: var(--color-secondary-text);
  border-bottom: 1px solid var(--color-border);
}
.post-content {
  padding: 24px;
  line-height: 1.8;
  flex-grow: 1;
}
.post-content p {
  margin-bottom: 1em;
}
.post-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}
.post-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 16px;
}
.post-footer button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: var(--color-primary-text);
}
.post-footer button:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

/* --- Page de Profil --- */
.profile-header {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.profile-banner {
  height: 200px;
  background-color: var(--color-secondary-text);
  background-size: cover;
  background-position: center;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  max-width: 100%;
}

.profile-header-info {
  padding: 0 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  transform: translateY(-40px);
  margin-bottom: -24px;
}
.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--color-surface);
  background-color: var(--color-surface);
}
.profile-names {
  flex-grow: 1;
  margin-bottom: 16px;
}
.profile-names h1 {
  font-size: 2rem;
  margin: 0;
  line-height: 1;
}
.profile-names p {
  color: var(--color-secondary-text);
  margin: 0;
  font-weight: 700;
}
.profile-header-info .cta-button {
  margin-bottom: 16px;
}
.profile-content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}
.activity-feed {
  list-style: none;
}
.activity-feed li {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.activity-feed li:first-child {
  padding-top: 0;
}
.activity-feed li:last-child {
  border-bottom: none;
}
.activity-feed a {
  font-weight: 700;
}
.activity-feed time {
  display: block;
  font-size: 0.8rem;
  color: var(--color-secondary-text);
  margin-top: 4px;
}
.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.widget h4 {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.widget ul {
  list-style: none;
}
.widget li {
  margin-bottom: 8px;
}

/* --- Pages d'Authentification --- */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.auth-container {
  width: 100%;
  max-width: 400px;
}
.auth-container .logo-link {
  justify-content: center;
  margin-bottom: 32px;
}
.auth-card {
  background-color: var(--color-surface);
  padding: 48px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.auth-card h2 {
  text-align: center;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-body);
}
.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring-rgba);
}
.auth-button {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 8px;
}
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-secondary-text);
  font-weight: 700;
}
.pagination a:hover {
  background-color: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.pagination a.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
  pointer-events: none;
}


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