@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;600&display=swap");

:root {
  /* --- PALETTE DE BASE --- */
  --white: #ffffff;
  --black: #0f172a;
  --transparent: transparent;

  /* --- ARRIÈRE-PLANS --- */
  --bg-body: #1e293b;
  --bg-card: #334155;
  --bg-glass: rgba(51, 65, 85, 0.85);
  --bg-message: #475569;
  --bg-darker: #0f172a;
  --bg-nav-pill: rgba(203, 213, 225, 0.05);
  --bg-hover-light: rgba(226, 232, 240, 0.1);
  --bg-overlay-dark: rgba(15, 23, 42, 0.6);
  --bg-overlay-light: rgba(51, 65, 85, 0.3);

  /* --- MARQUE & ACCENTS --- */
  --brand-gradient: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  --accent: #93c5fd;
  --accent-glow: rgba(147, 197, 253, 0.4);
  --logo-shadow: rgba(96, 165, 250, 0.3);

  /* --- TEXTE --- */
  --text-main: #f8fafc;
  --text-bright: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-darker: #334155;
  --text-italic: #cbd5e1;

  /* --- BORDURES --- */
  --border-light: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(147, 197, 253, 0.5);
  --border-avatar: #475569;

  /* --- OMBRES --- */
  --shadow-sm: rgba(0, 0, 0, 0.2);
  --shadow-md: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --shadow-text: rgba(15, 23, 42, 0.7);

  /* --- DÉCORATION --- */
  --grad-orb-1: rgba(96, 165, 250, 0.1);
  --grad-orb-2: rgba(167, 139, 250, 0.08);
  --grad-auth-orb: rgba(147, 197, 253, 0.15);

  /* --- FONTS --- */
  --font-head: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;
}

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

body {
  background-color: var(--bg-body);
  background-image: radial-gradient(
      circle at 15% 50%,
      var(--grad-orb-1),
      var(--transparent) 25%
    ),
    radial-gradient(circle at 85% 30%, var(--grad-orb-2), var(--transparent) 25%);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul {
  list-style: none;
}

/* --- HEADER GLASS --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: 70px;
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-area img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 8px var(--logo-shadow));
}

.site-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--transparent);
}

nav ul {
  display: flex;
  background: var(--bg-nav-pill);
  padding: 5px;
  border-radius: 50px;
  border: 1px solid var(--border-light);
}

nav a {
  padding: 8px 20px;
  border-radius: 30px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--text-main);
  background: var(--bg-hover-light);
}

nav a.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 10px var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* --- BANNIÈRE --- */
.banner-container {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, var(--black) 60%, var(--transparent) 100%);
  -webkit-mask-image: linear-gradient(to bottom, var(--black) 60%, var(--transparent) 100%);
  background: var(--bg-card);
}

.banner-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
}

/* --- MAIN CONTAINER --- */
.main-container {
  width: 100%;
  max-width: 1080px;
  margin: -50px auto 40px;
  padding: 0 25px;
  position: relative;
  z-index: 10;
  flex: 1;
}

/* --- TYPOGRAPHY & BREADCRUMB --- */
h1.page-title {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 10px;
  text-shadow: 0 10px 30px var(--shadow-text);
}

p.page-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin-bottom: 40px;
}

.breadcrumb {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-overlay-dark);
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.breadcrumb-separator {
  margin: 0 8px;
  color: var(--border-light);
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-item:hover {
  color: var(--accent);
}

/* --- CATEGORIES & LISTS --- */
.forum-section {
  margin-bottom: 40px;
}

.forum-header {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.forum-header::before {
  content: "";
  display: block;
  width: 4px;
  height: 24px;
  background: var(--brand-gradient);
  border-radius: 2px;
}

.forum-item {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  padding: 18px 24px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.forum-item:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-md);
}

.forum-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-right: 20px;
  border: 2px solid var(--border-avatar);
  object-fit: cover;
}

.forum-subject {
  flex: 1;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  padding-right: 20px;
}

.forum-subject:hover {
  color: var(--accent);
}

.forum-author a {
  color: var(--text-bright);
  font-weight: 600;
  font-size: 0.9rem;
}

.forum-messages {
  background: var(--bg-hover-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 20px;
  border: 1px solid var(--border-light);
}

.forum-last-message {
  width: 200px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* --- THREAD & COMMENTS --- */
.comment-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease;
}

.comment-sidebar {
  width: 150px;
  flex-shrink: 0;
  text-align: center;
  background: var(--bg-card);
  padding: 20px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  height: fit-content;
}

.comment-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 3px solid var(--bg-body);
  box-shadow: 0 0 0 2px var(--accent);
}

.comment-author-name {
  display: block;
  font-weight: 700;
  font-family: var(--font-head);
  margin-bottom: 5px;
  color: var(--text-main);
}

.comment-body {
  flex: 1;
  background: var(--bg-message);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.comment-meta {
  background: var(--bg-overlay-light);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.comment-content {
  padding: 25px;
  color: var(--text-bright);
  font-size: 1rem;
}

/* Style des liens dans les messages */
.comment-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comment-content a:hover {
  color: var(--white);
}

/* --- USER PROFILE --- */
.profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.profile-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--brand-gradient);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bg-body);
  box-shadow: 0 0 20px var(--accent-glow);
}

.profile-info h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  margin-bottom: 5px;
}

.profile-job {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 15px;
  display: block;
}

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.stat-badge {
  background: var(--bg-hover-light);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.profile-col h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 10px;
}

.profile-col > div {
  background: var(--bg-card);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.comment-thread-title a {
  font-weight: 600;
  color: var(--text-main);
}

.comment-thread-title a:hover {
  color: var(--accent);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 5px 0;
}

.comment {
  font-size: 0.9rem;
  color: var(--text-italic);
  font-style: italic;
}

/* --- PAGINATION --- */
.pagination {
  margin-top: 30px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.page-link,
.current-page {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.page-link {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.page-link:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.current-page {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* --- FOOTER --- */
footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-light);
  padding: 60px 0 30px;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 25px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  font-family: var(--font-head);
  color: var(--text-main);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.footer-bottom {
  text-align: center;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
  color: var(--text-darker);
  font-size: 0.85rem;
}

/* --- LOGIN / REGISTER --- */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px var(--shadow-lg);
  position: relative;
  z-index: 10;
}

.auth-form {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--grad-auth-orb),
    var(--transparent) 50%
  );
  height: 80vh;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  background: var(--bg-darker);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  outline: none;
  transition: 0.3s;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-full {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  background: var(--bg-message);
  color: var(--white);
  transition: 0.3s;
}

.btn-full:hover {
  background: var(--bg-card); /* Légère variation au survol */
  transform: translateY(-2px);
}

.btn-full.btn-register {
  background: var(--brand-gradient);
}

.btn-register, .btn-submit {
  margin-left: 10px;
  background: var(--brand-gradient);
  border-radius: 26px;
  padding: 7px;
  padding-left: 15px;
  padding-right: 15px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}