/* ===== PALETTE SYNTHWAVE ===== */
:root {
  /* -- Polices -- */
  --font-body: "Lato", sans-serif;
  --font-heading: "Fira Code", monospace;

  /* -- Couleurs dynamiques -- */
  --color-background: #05140D;
  --color-surface: rgba(5, 30, 16, 0.6);
  --color-border: rgba(0, 255, 132, 0.4);
  --color-border-soft: rgba(0, 255, 132, 0.1);
  --color-text: #D9F7E8;
  --color-text-muted: #94B8A3;
  --color-magenta: #00FF84;
  --color-cyan: #A0FFE3;
  --color-sidebar-link-hover-bg: rgba(160, 255, 227, 0.1);
  --color-pagination-hover-bg: #00FF84;
  --color-footer-bg-solid: rgba(5, 20, 13, 0.8);
  --color-grid: rgba(0, 255, 132, 0.2);

  /* -- Ombres et effets (dérivés des couleurs primaires) -- */
  --color-shadow-magenta: 0 0 5px var(--color-magenta), 0 0 10px var(--color-magenta);
  --color-shadow-magenta-hover: 0 0 15px var(--color-magenta), 0 0 25px var(--color-magenta);
  --color-shadow-cyan: 0 0 5px var(--color-cyan), 0 0 10px var(--color-cyan);
}

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

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-magenta);
  text-shadow: var(--color-shadow-magenta);
}

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

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

/* ===== CANVAS DE FOND ===== */
#grid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ===== STRUCTURE PRINCIPALE EN GRILLE ===== */
.site-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* ===== BARRE LATÉRALE ===== */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 3rem;
}
.sidebar-logo {
  width: 80px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px var(--color-cyan));
}
.sidebar-title {
  font-size: 2rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-link {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  border: 1px solid transparent;
}
.sidebar-link.active,
.sidebar-link:hover {
  background: var(--color-sidebar-link-hover-bg);
  border-color: var(--color-border);
  color: var(--color-cyan);
  text-shadow: var(--color-shadow-cyan);
}

/* ===== CONTENU PRINCIPAL ===== */
.main-content {
  overflow-y: auto;
  padding: 2rem;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}
.breadcrumb {
  color: var(--color-text-muted);
}
.breadcrumb a {
  color: var(--color-text-muted);
}
.breadcrumb a:hover {
  color: var(--color-cyan);
}
.breadcrumb-separator {
  margin: 0 0.5rem;
  color: var(--color-text-muted);
}
.breadcrumb-current {
  color: var(--color-text);
  font-weight: 700;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.action-link {
  font-weight: 700;
}
.action-button {
  background: var(--color-magenta);
  color: var(--color-background);
  font-family: var(--font-heading);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  box-shadow: var(--color-shadow-magenta);
  border: none;
  cursor: pointer;
}
.action-button:hover {
  transform: scale(1.05);
  box-shadow: var(--color-shadow-magenta-hover);
  text-shadow: none;
}

/* ===== BANNIÈRE ===== */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-bottom: 2rem;
}
.banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.2;
}
.banner-text {
  position: relative;
  z-index: 2;
  padding: 3rem;
  text-align: center;
}
.banner h2 {
  font-size: 2.5rem;
}
.banner p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

/* ===== LISTE DES FORUMS (PAGE D'ACCUEIL) ===== */
.categories-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Conteneur d'une section de forum (ex: Banque, Entreprise) */
.forum-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* En-tête de la section (Le titre cliquable) */
.forum-section > a {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    text-decoration: none;
}
.forum-section > a:hover {
    background: rgba(255, 255, 255, 0.07);
}

.forum-header {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-magenta);
    text-shadow: var(--color-shadow-magenta);
}

/* Ligne d'un sujet (Item) */
.forum-item {
    display: grid;
    /* Avatar | Sujet (large) | Auteur | Messages | Date */
    grid-template-columns: 50px minmax(200px, 3fr) minmax(100px, 1fr) minmax(80px, 0.5fr) minmax(150px, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-soft);
    transition: background 0.2s ease;
}

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

.forum-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.forum-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-cyan);
    object-fit: cover;
}

.forum-subject {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.3;
}
.forum-subject:hover {
    color: var(--color-cyan);
    text-shadow: var(--color-shadow-cyan);
}

.forum-author, 
.forum-author a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.forum-author a:hover {
    color: var(--color-cyan);
}

.forum-messages {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.forum-last-message {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== CATÉGORIES GÉNÉRIQUES ===== */
.category {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}
.category h3 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-soft);
    padding-bottom: 0.5rem;
}

/* ===== TITRES DE PAGE ===== */
.page-title {
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* ===== PAGE DE SUJET (THREAD) ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.post {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.post-author {
  text-align: center;
  border-right: 1px solid var(--color-border-soft);
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--color-cyan);
  margin-bottom: 0.75rem;
  object-fit: cover;
}
.author-name {
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.author-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.post-body {
    display: flex;
    flex-direction: column;
}
.post-meta {
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-soft);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
}
.post-content {
    font-size: 1rem;
    line-height: 1.7;
}
.post-content p {
  margin-bottom: 1rem;
}
/* Gestion des vidéos Youtube responsive */
.post-content iframe {
    max-width: 100%;
    border: 1px solid var(--color-border);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.reply-form {
  margin-top: 2rem;
  padding: 1.5rem;
}
.reply-form textarea {
  width: 100%;
  min-height: 150px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 1rem;
  font-family: var(--font-body);
  border-radius: 5px;
  margin: 1rem 0;
  resize: vertical;
}
.reply-form textarea:focus {
  outline: none;
  border-color: var(--color-magenta);
  box-shadow: var(--color-shadow-magenta);
}

/* ===== PAGE DE PROFIL UTILISATEUR ===== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-magenta);
  object-fit: cover;
  box-shadow: var(--color-shadow-magenta);
}
.profile-info h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
}
.profile-info p {
  color: var(--color-text-muted);
  font-family: var(--font-heading);
}

.profile-content-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

/* Liste des stats */
.stats-list {
  list-style: none;
  padding: 0;
}
.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
}
.stats-list li:last-child {
    border-bottom: none;
}
.stats-list strong {
  color: var(--color-cyan);
  font-weight: 700;
  text-shadow: var(--color-shadow-cyan);
}

/* Liste d'activité (Gestion de la structure DOM spécifique div dans ul) */
.thread-list {
    list-style: none;
    padding: 0;
}

/* Cible les DIVs directs dans la liste thread-list du profil */
.thread-list > div {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border-soft);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.thread-list > div:last-child {
    border-bottom: none;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
}

.comment-thread-title {
    font-size: 1.1rem;
    margin: 0;
    font-weight: normal;
}
.comment-thread-title a {
    color: var(--color-text);
    font-weight: 700;
}
.comment-thread-title a:hover {
    color: var(--color-cyan);
}

/* ===== PAGES DE CONNEXION/INSCRIPTION ===== */
/* (Styles génériques conservés pour cohérence globale) */
.auth-container {
  max-width: 450px;
  margin: 4rem auto;
  padding: 2rem;
}
.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 5px;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-footer-bg-solid);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-left: -2rem;
  margin-right: -2rem;
  padding: 2rem 2rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-column h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
  text-shadow: none;
  font-family: var(--font-heading);
}
.footer-column p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.footer-column ul {
  list-style: none;
  padding: 0;
}
.footer-column li {
  margin-bottom: 0.5rem;
}
.footer-column a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.footer-column a:hover {
  color: var(--color-cyan);
  text-shadow: var(--color-shadow-cyan);
}
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  padding-bottom: 30px;
}