/* ===== Threads — S16 ===== */

:root {
  --bg-deep: #05060f;
  --bg-panel: #0d0f1e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(148, 110, 255, 0.35);
  --text-primary: #f4f3fb;
  --text-secondary: #9c9cb8;
  --text-muted: #6b6b8a;
  --accent-blue: #4d7fff;
  --accent-violet: #9b5cff;
  --accent-pink: #c964e0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-full: 999px;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-display);
  background:
    radial-gradient(ellipse 900px 500px at 85% 0%, rgba(155, 92, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 15%, rgba(77, 127, 255, 0.25), transparent 55%),
    radial-gradient(ellipse 600px 400px at 0% 60%, rgba(155, 92, 255, 0.08), transparent 60%),
    var(--bg-deep);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Nav ===== */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-brand::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(77, 127, 255, 0.25), rgba(155, 92, 255, 0.25));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 18px rgba(120, 100, 255, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d7fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-links li a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links li a.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(77, 127, 255, 0.35), rgba(155, 92, 255, 0.35));
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 16px rgba(120, 100, 255, 0.25);
}

#nav-deconnexion {
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.5), rgba(201, 100, 224, 0.4));
  color: #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* ===== Hero ===== */

.hero {
  max-width: 700px;
  margin: 40px auto 0;
  padding: 0 24px;
  text-align: center;
}

.hero::before {
  content: "";
  display: block;
  width: 68px;
  height: 68px;
  margin: 0 auto 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(77, 127, 255, 0.18), rgba(155, 92, 255, 0.18));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 30px rgba(120, 100, 255, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 30px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.hero p,
.hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0;
}

/* ===== Container / section ===== */

.container {
  max-width: 760px;
  margin: 48px auto 64px;
  padding: 0 24px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 14px;
  position: relative;
}

.section-label::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b5cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

.section-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-blue));
}

/* Wrap the whole discussions block visually like the reference panel */
#threads-list {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== Thread cards ===== */

.card-link {
  display: block;
}

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.card::before {
  content: "";
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

.card-link:hover .card {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-soft);
}

.thread-header {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.thread-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.thread-meta a,
.thread-meta {
  color: var(--text-muted);
}

/* Author name styled like the little colored links in the reference */
.thread-meta {
  color: var(--text-muted);
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(155, 92, 255, 0.18);
  color: #c9a8ff;
  border: 1px solid rgba(155, 92, 255, 0.35);
}

.lock-badge::before {
  content: "🔒";
  font-size: 0.7rem;
}

.reply-badge {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  color: #b9c3ff;
  background: rgba(77, 127, 255, 0.12);
  border: 1px solid rgba(77, 127, 255, 0.3);
  white-space: nowrap;
}

/* ===== Empty / loading state ===== */

.empty-card {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Footer ===== */

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 32px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-text::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c9cb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}

/* ===== Responsive ===== */

@media (max-width: 640px) {
  nav {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .card {
    flex-wrap: wrap;
  }
  .thread-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
