:root {
    --font-body: 'Inter', sans-serif;
    --font-display: 'Roboto Mono', monospace;
    --color-background: #20202C;
    --color-surface: #2C2C3E;
    --color-primary: #9D55E8;
    --color-secondary: #AEF359;
    --color-text-light: #F2F2FF;
    --color-text-medium: #A4A4C8;
    --color-text-dark: #20202C;
    --color-border: #414158;
    --color-shadow-glow-rgb: 157, 85, 232;
    --color-background-blur: rgba(44, 44, 62, 0.8);
    --color-hero-overlay-start: rgba(32, 32, 44, 0.6);
    --color-profile-banner-overlay: rgba(32, 32, 44, 0.1);
    --color-transparent: transparent;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-text-light);
  font-size: 16px;
  line-height: 1.7;
}

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

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

a:hover {
  color: var(--color-text-light);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-light);
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary);
}

/* --- HEADER --- */
.main-header {
  background-color: var(--color-background-blur);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 1px;
}

.logo-image {
  height: 35px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-medium);
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--color-transparent);
  transition: all 0.2s ease;
}

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

.nav-buttons {
  display: flex;
  gap: 1rem;
}

/* --- BOUTONS --- */
.button {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-align: center;
}
.button-primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}
.button-primary:hover {
  background-color: var(--color-transparent);
  color: var(--color-primary);
  box-shadow: 0 0 20px rgba(var(--color-shadow-glow-rgb), 0.2);
}
.button-secondary {
  background-color: var(--color-transparent);
  color: var(--color-primary);
}
.button-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

/* --- HERO BANNER --- */
.hero-banner {
  position: relative;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--color-background) 0%,
    var(--color-hero-overlay-start) 100%
  );
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
}

.hero-content h1 {
  font-size: 4.5rem;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--color-text-medium);
  font-family: var(--font-display);
}

/* --- EFFET GLITCH (pour le H1) --- */
.glitch {
  position: relative;
  color: var(--color-text-light);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-background);
  overflow: hidden;
}
.glitch::before {
  left: 2px;
  text-shadow: -1px 0 var(--color-secondary);
  animation: glitch-anim-1 2s infinite linear reverse;
}
.glitch::after {
  left: -2px;
  text-shadow: -1px 0 var(--color-primary);
  animation: glitch-anim-2 2s infinite linear reverse;
}
@keyframes glitch-anim-1 {
  0%,
  100% {
    clip-path: inset(55% 0 23% 0);
  }
  25% {
    clip-path: inset(0 0 100% 0);
  }
  50% {
    clip-path: inset(83% 0 3% 0);
  }
  75% {
    clip-path: inset(10% 0 90% 0);
  }
}
@keyframes glitch-anim-2 {
  0%,
  100% {
    clip-path: inset(45% 0 33% 0);
  }
  25% {
    clip-path: inset(100% 0 0 0);
  }
  50% {
    clip-path: inset(23% 0 43% 0);
  }
  75% {
    clip-path: inset(80% 0 10% 0);
  }
}

/* --- CONTENU PAGE --- */
.page-content {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.home-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}
.main-column {
  min-width: 0;
}
.sidebar-column {
  min-width: 0;
}

/* --- BREADCRUMB --- */
.breadcrumb {
  margin-bottom: 2rem;
}
.breadcrumb ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.breadcrumb a {
  color: var(--color-text-medium);
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 0.75rem;
  color: var(--color-border);
}

/* --- LISTE DE THREADS --- */
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.thread-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: border-color 0.2s, background-color 0.2s;
}
.thread-item:hover {
  border-color: var(--color-primary);
}
.thread-avatar img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}
.thread-details {
  flex-grow: 1;
}
.thread-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
  display: inline-block;
}
.thread-meta {
  font-size: 0.85rem;
  color: var(--color-text-medium);
}
.thread-meta .separator {
  color: var(--color-border);
}
.thread-meta .meta-link {
  color: var(--color-text-medium);
  font-weight: 600;
  transition: color 0.2s;
}
.thread-meta .meta-link:hover {
  color: var(--color-secondary);
}
.thread-stats {
  text-align: center;
  color: var(--color-text-medium);
  font-size: 0.9rem;
}
.thread-stats strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-display);
  color: var(--color-text-light);
}

/* --- SIDEBAR & CATEGORIES --- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-border);
  transition: all 0.2s;
}
.category-item:hover {
  border-left-color: var(--color-secondary);
}
.category-name {
  color: var(--color-text-light);
  font-weight: 600;
}
.category-count {
  font-size: 0.8rem;
  color: var(--color-text-medium);
  background-color: var(--color-background);
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- FOOTER --- */
.main-footer {
  background-color: var(--color-surface);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-column .logo {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.footer-tagline {
  color: var(--color-text-medium);
  font-size: 0.9rem;
  max-width: 300px;
}
.footer-column h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}
.footer-column ul {
  list-style: none;
}
.footer-column ul li {
  margin-bottom: 0.5rem;
}
.footer-column ul a {
  color: var(--color-text-medium);
  font-weight: 400;
}
.footer-column ul a:hover {
  color: var(--color-text-light);
}
.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-medium);
}

/* --- PAGE DE CATÉGORIES (categories.html) --- */
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 2.5rem;
}
.category-list-full {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.category-card-full {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}
.category-card-full h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.category-card-full h3 a {
  color: var(--color-text-light);
}
.category-card-full p {
  color: var(--color-text-medium);
  font-size: 0.95rem;
}
.category-stats {
  text-align: right;
  color: var(--color-text-medium);
  flex-shrink: 0;
}
.category-stats span {
  font-size: 1.8rem;
  font-family: var(--font-display);
  color: var(--color-text-light);
  display: block;
}

/* --- PAGINATION (category.html) --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}
.page-number,
.page-arrow,
.page-dots {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  border-radius: 4px;
  color: var(--color-text-medium);
}
.page-number:hover,
.page-arrow:hover {
  background-color: var(--color-surface);
  color: var(--color-text-light);
}
.page-number.current {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  font-weight: bold;
}
.page-arrow {
  font-size: 1.2rem;
}
.page-dots {
  padding: 0.5rem 0.2rem;
}

/* --- PAGE DE SUJET (thread.html) --- */
.post-stream {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.post {
  display: flex;
  gap: 1.5rem;
  background-color: var(--color-surface);
  padding: 2rem;
  border: 1px solid var(--color-border);
}
.post-author {
  flex-shrink: 0;
  width: 150px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 2px solid var(--color-primary);
}
.author-name {
  font-weight: bold;
  color: var(--color-text-light);
  font-size: 1.1rem;
}
.author-role {
  font-size: 0.9rem;
  color: var(--color-secondary);
}
.author-posts {
  font-size: 0.8rem;
  color: var(--color-text-medium);
  margin-top: 0.25rem;
}
.post-body {
  flex-grow: 1;
}
.post-meta {
  font-size: 0.9rem;
  color: var(--color-text-medium);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.post-content p {
  margin-bottom: 1rem;
}
.post-content a {
  color: var(--color-secondary);
  font-weight: bold;
  background-image: linear-gradient(
    var(--color-secondary),
    var(--color-secondary)
  );
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: color 0.3s ease;
}
.post-content a:hover {
  color: var(--color-primary);
}

/* --- PAGE DE PROFIL (user.html) --- */
.profile-header {
  height: 250px;
  position: relative;
  background-color: var(--color-surface);
}
.profile-banner-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.1;
}
.profile-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    var(--color-background) 0%,
    var(--color-transparent) 100%
  );
}
.profile-page.page-content {
  padding-top: 0;
}
.profile-card {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-top: -80px; /* Fait remonter la carte sur la bannière */
  position: relative;
  z-index: 5;
  margin-bottom: 1rem;
}
.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid var(--color-background);
  background: var(--color-surface);
}
.profile-username {
  font-size: 2.5rem;
  line-height: 1;
}
.profile-role {
  font-size: 1.2rem;
  color: var(--color-primary);
  font-family: var(--font-display);
}
.profile-meta {
  color: var(--color-text-medium);
}
.user-activity {
  margin-top: 3rem;
}
.user-activity .thread-item .thread-avatar {
  display: none;
} /* On cache l'avatar car c'est redondant */

/* --- FORMULAIRES (login.html, register.html) --- */
.form-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.form-container {
  max-width: 450px;
  margin: 3rem auto;
  background-color: var(--color-surface);
  padding: 2.5rem;
  border: 1px solid var(--color-border);
}
.form-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-primary);
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text-medium);
}
.form-input {
  width: 100%;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-shadow-glow-rgb), 0.2);
}
.form-button {
  width: 100%;
  padding: 15px;
  margin-top: 1rem;
}
.form-switch-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--color-text-medium);
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-column {
    margin-top: 3rem;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 3rem;
  }
  .main-nav {
    display: none;
  }
  .post {
    flex-direction: column;
  }
  .post-author {
    width: 100%;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  .author-avatar {
    width: 50px;
    height: 50px;
    margin-bottom: 0;
  }
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-avatar {
    width: 120px;
    height: 120px;
  }
}


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