/* ============================================================
   WhoWinsAI Community — forum_style.css
   Dark premium UI matching the main site aesthetic
   ============================================================ */

:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #1a1a24;
  --bg4:       #22222f;
  --border:    #2a2a3a;
  --border2:   #3a3a4f;
  --text:      #e8e8f0;
  --text2:     #9090a8;
  --text3:     #5a5a72;
  --accent:    #e8593c;
  --accent2:   #ff7a5c;
  --blue:      #4a9eff;
  --blue2:     #2d7de0;
  --gold:      #f0c040;
  --green:     #4ecb71;
  --purple:    #9b7fe8;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue2); }

img { max-width: 100%; border-radius: var(--radius); }

/* ── Nav ──────────────────────────────────────────────────── */
.forum-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent2); }

.nav-links {
  display: flex;
  gap: 24px;
  flex: 1;
}

.nav-links a {
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-username {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.notif-link {
  position: relative;
  font-size: 18px;
  color: var(--text2);
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn, .btn-sm, .btn-primary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover, .btn-sm:hover { background: var(--bg4); border-color: var(--border2); }

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); color: #fff; }

.btn-danger {
  background: transparent;
  border-color: #c0392b;
  color: #e74c3c;
}
.btn-danger:hover { background: #c0392b22; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text2);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

/* ── Layout ──────────────────────────────────────────────── */
.forum-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.page-header p {
  color: var(--text2);
  margin-top: 6px;
  font-size: 15px;
}

.layout-cols {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout-cols { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ── Section list (forum home) ───────────────────────────── */
.section-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-row {
  display: grid;
  grid-template-columns: 56px 1fr 120px 80px;
  align-items: center;
  gap: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
}
.section-row:hover {
  border-color: var(--border2);
  background: var(--bg3);
}

.section-icon {
  font-size: 28px;
  text-align: center;
  line-height: 1;
}

.section-info h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.section-info p  { font-size: 13px; color: var(--text2); }

.section-stats { text-align: right; }
.section-stats .stat-num  { font-size: 16px; font-weight: 700; color: var(--text); }
.section-stats .stat-label{ font-size: 11px; color: var(--text3); }

/* ── Thread list ─────────────────────────────────────────── */
.thread-list { display: flex; flex-direction: column; gap: 6px; }

.thread-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.15s;
}
.thread-row:hover { border-color: var(--border2); }
.thread-row.pinned { border-left: 3px solid var(--gold); }

.thread-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--blue); }

.thread-meta {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.thread-meta .author { color: var(--text2); font-weight: 500; }

.thread-counts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.thread-counts span {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
}

.pin-tag { color: var(--gold); font-size: 11px; font-weight: 700; margin-right: 6px; }
.lock-tag { color: var(--text3); font-size: 11px; }

/* ── Single thread / reply ───────────────────────────────── */
.thread-body-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.thread-body-card .thread-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.reply-list { display: flex; flex-direction: column; gap: 10px; }

.reply-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
}
.reply-card.helpful { border-color: var(--green); }

.reply-body { color: var(--text); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.upvote-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.upvote-btn:hover, .upvote-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg4);
  border: 2px solid var(--border2);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.avatar-lg { width: 80px; height: 80px; font-size: 28px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ── User info inline ────────────────────────────────────── */
.user-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-inline .username {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.user-inline .user-meta {
  font-size: 12px;
  color: var(--text3);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.badge-gold   { background: #f0c04022; color: var(--gold); border: 1px solid #f0c04044; }
.badge-blue   { background: #4a9eff22; color: var(--blue); border: 1px solid #4a9eff44; }
.badge-green  { background: #4ecb7122; color: var(--green); border: 1px solid #4ecb7144; }
.badge-purple { background: #9b7fe822; color: var(--purple); border: 1px solid #9b7fe844; }
.badge-red    { background: #e8593c22; color: var(--accent); border: 1px solid #e8593c44; }
.badge-gray   { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); }

.role-mod   { background: #2d7de022; color: var(--blue); border: 1px solid #2d7de044; }
.role-admin { background: #e8593c22; color: var(--accent); border: 1px solid #e8593c44; }

/* ── Profile page ────────────────────────────────────────── */
.profile-hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-card .lbl { font-size: 11px; color: var(--text3); margin-top: 3px; }

.social-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text2);
  transition: all 0.15s;
}
.social-link:hover { border-color: var(--border2); color: var(--text); }

/* ── Forms ───────────────────────────────────────────────── */
.form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
}

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

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type=text],
input[type=password],
input[type=file],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 120px; }

.form-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 5px;
}

.error-msg {
  background: #e8593c18;
  border: 1px solid #e8593c44;
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 18px;
}

.success-msg {
  background: #4ecb7118;
  border: 1px solid #4ecb7144;
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--green);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

.lb-tab {
  flex: 1;
  padding: 8px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.lb-tab.active { background: var(--bg4); color: var(--text); }

.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.lb-row:hover { border-color: var(--border2); }

.lb-rank {
  font-size: 20px;
  font-weight: 800;
  color: var(--text3);
  text-align: center;
}
.lb-rank.gold   { color: var(--gold); }
.lb-rank.silver { color: #aaa; }
.lb-rank.bronze { color: #cd7f32; }

.lb-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}
.lb-score-label { font-size: 11px; color: var(--text3); }

/* ── Fusion Gallery ──────────────────────────────────────── */
.fusion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.fusion-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.fusion-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.fusion-card.featured { border-color: var(--gold); }

.fusion-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg3);
}
.fusion-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.3s;
}
.fusion-card:hover .fusion-img-wrap img { transform: scale(1.04); }

.fusion-featured-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 100px;
}

.fusion-info { padding: 14px; }
.fusion-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.fusion-chars { font-size: 12px; color: var(--text2); margin-bottom: 10px; }

.fusion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Arena / Battle ──────────────────────────────────────── */
.battle-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.battle-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.battle-fighter {
  text-align: center;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.battle-fighter .char-name {
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
}
.battle-fighter .player-name {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
}

.vs-badge {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.battle-status {
  text-align: center;
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
}

.verdict-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text2);
  white-space: pre-wrap;
  margin-top: 16px;
}

.vote-bar {
  background: var(--bg3);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0;
}
.vote-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.5s;
}

/* ── Predictions ─────────────────────────────────────────── */
.prediction-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}

.prediction-chars {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pred-char-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.pred-char-btn:hover { border-color: var(--blue); color: var(--blue); }
.pred-char-btn.selected { border-color: var(--accent); background: #e8593c18; color: var(--accent); }
.pred-char-btn.correct  { border-color: var(--green); background: #4ecb7118; color: var(--green); }
.pred-char-btn.wrong    { border-color: #e74c3c; background: #e74c3c18; color: #e74c3c; opacity: 0.6; }

.prediction-timer {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
}
.page-link {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.page-link:hover { border-color: var(--border2); color: var(--text); }
.page-link.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.forum-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ── Misc ────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg4);
  color: var(--text2);
  border: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text2); }

.sidebar .card { margin-bottom: 14px; }
.sidebar-title { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }

.online-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; }

.breadcrumb {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text3); }

@media (max-width: 600px) {
  .forum-main { padding: 16px; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .battle-vs { grid-template-columns: 1fr; gap: 8px; }
  .section-row { grid-template-columns: 40px 1fr; }
  .section-row .section-stats { display: none; }
  .nav-links { display: none; }
}
