/* ============================================================
   HallaSawal — Dark Theme, Youth-Energy Design
   Sawal uthao. Halla machao.
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --bg-main: #0a0a0a;
  --bg-card: #111;
  --bg-surface: #1a1a1a;
  --bg-surface-hover: #222;
  --text-primary: #fff;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #ff3333;
  --accent-hover: #e62e2e;
  --accent-glow: rgba(255, 51, 51, 0.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #222;
  --border-light: #333;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
  --transition: .2s ease;
  --transition-slow: .4s ease;
  --nav-height: 60px;
  --container-max: 800px;
  --container-wide: 1100px;

  /* Topic colors */
  --topic-corruption: #ff3333;
  --topic-politics: #3b82f6;
  --topic-education: #f59e0b;
  --topic-infrastructure: #a855f7;
  --topic-healthcare: #22c55e;
  --topic-environment: #10b981;
  --topic-employment: #f97316;
  --topic-other: #6b7280;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: #ff5555; }

img { max-width: 100%; display: block; }

button { cursor: pointer; font-family: inherit; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ================================================================
   NAV BAR
   ================================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 10, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 1px;
  display: flex;
  gap: 4px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-halla { color: var(--accent); }
.logo-sawal { color: var(--text-primary); }

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

.nav-link {
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.nav-auth,
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-username {
  color: var(--text-primary);
  font-weight: 500;
  font-size: .9rem;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, .97);
  z-index: 999;
  flex-direction: column;
  padding: 24px;
  gap: 8px;
}
.mobile-menu.open { display: flex; }
.mobile-link {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

@media (max-width: 768px) {
  .nav-links, .nav-auth, .nav-user { display: none; }
  .nav-hamburger { display: flex; }
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
}
.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #16a34a; }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-xs { padding: 4px 10px; font-size: .75rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

.btn-back {
  margin-bottom: 16px;
  font-size: .85rem;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label,
.form-group .form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .95rem;
  transition: border-color var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .95rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.form-error {
  font-size: .75rem;
  color: var(--accent);
  margin-top: 4px;
  display: block;
  min-height: 1em;
}

.form-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.char-counter {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ================================================================
   VIEWS — Generic
   ================================================================ */
.view {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 8px;
}
.page-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.text-accent { color: var(--accent); }

/* ================================================================
   HERO — Landing
   ================================================================ */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
}

/* Subtle grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,51,51,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,51,51,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-content {
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
  font-style: italic;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stat-bar {
  display: flex;
  gap: 40px;
  justify-content: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat-label {
  font-size: .8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ================================================================
   SECTIONS — Landing
   ================================================================ */
.section {
  padding: 80px 20px;
  max-width: var(--container-wide);
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 48px;
}

/* Features */
.features-section {
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition-slow);
}
.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.feature-icon-discuss { background: rgba(59,130,246,.15); color: #3b82f6; }
.feature-icon-animate { background: rgba(168,85,247,.15); color: #a855f7; }
.feature-icon-lead    { background: rgba(255,51,51,.15);  color: var(--accent); }

.feature-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature-desc {
  color: var(--text-secondary);
  font-size: .9rem;
}

/* Lead Section */
.lead-section {
  border-top: 1px solid var(--border);
}

.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .lead-card { grid-template-columns: 1fr; }
}

.lead-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.lead-desc {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.lead-steps {
  list-style: decimal;
  padding-left: 20px;
  margin-bottom: 20px;
}
.lead-steps li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: .9rem;
}
.lead-steps li strong { color: var(--accent); }

.lead-cta-text {
  color: var(--text-secondary);
  font-size: .85rem;
  margin-bottom: 12px;
}

.lead-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lead-badge-display {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.jurisdiction-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 16px;
}

.jurisdiction-value {
  display: block;
  font-weight: 600;
  margin-top: 4px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
}

.footer-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  text-align: center;
}

.footer-tagline {
  color: var(--text-muted);
  font-style: italic;
  font-size: .85rem;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}
.footer-links a {
  color: var(--text-secondary);
  font-size: .85rem;
}
.footer-links a:hover { color: var(--text-primary); }

.footer-copy {
  color: var(--text-muted);
  font-size: .8rem;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-candidate {
  background: rgba(255,51,51,.15);
  color: var(--accent);
  border: 1px solid rgba(255,51,51,.3);
}

.badge-admin {
  background: rgba(168,85,247,.15);
  color: #a855f7;
  border: 1px solid rgba(168,85,247,.3);
}

.badge-moderator {
  background: rgba(59,130,246,.15);
  color: #3b82f6;
  border: 1px solid rgba(59,130,246,.3);
}

.badge-lg {
  padding: 6px 16px;
  font-size: .8rem;
}

/* ================================================================
   TOPIC TAGS
   ================================================================ */
.topic-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.topic-tag[data-topic="corruption"],
.topic-tag.topic-corruption { background: rgba(255,51,51,.12); color: var(--topic-corruption); }
.topic-tag[data-topic="politics"],
.topic-tag.topic-politics { background: rgba(59,130,246,.12); color: var(--topic-politics); }
.topic-tag[data-topic="education"],
.topic-tag.topic-education { background: rgba(245,158,11,.12); color: var(--topic-education); }
.topic-tag[data-topic="infrastructure"],
.topic-tag.topic-infrastructure { background: rgba(168,85,247,.12); color: var(--topic-infrastructure); }
.topic-tag[data-topic="healthcare"],
.topic-tag.topic-healthcare { background: rgba(34,197,94,.12); color: var(--topic-healthcare); }
.topic-tag[data-topic="environment"],
.topic-tag.topic-environment { background: rgba(16,185,129,.12); color: var(--topic-environment); }
.topic-tag[data-topic="employment"],
.topic-tag.topic-employment { background: rgba(249,115,22,.12); color: var(--topic-employment); }
.topic-tag[data-topic="other"],
.topic-tag.topic-other { background: rgba(107,114,128,.12); color: var(--topic-other); }

/* ================================================================
   TOPIC FILTER BAR & CHIPS
   ================================================================ */
.topic-bar {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: var(--nav-height);
  background: var(--bg-main);
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.topic-bar::-webkit-scrollbar { display: none; }

.topic-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}
.topic-chip:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}
.topic-chip-active,
.topic-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Topic Selector (create post) */
.topic-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ================================================================
   SORT TABS
   ================================================================ */
.sort-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 0;
}

.sort-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.sort-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.sort-tab-active,
.sort-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ================================================================
   FEED
   ================================================================ */
.feed-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================================================
   POST CARDS
   ================================================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 80px;
}

.post-list-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.post-list-empty p { margin-top: 12px; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}
.post-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--accent);
  flex-shrink: 0;
}
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: .7rem;
}

.post-author-info {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-primary);
}
.post-author-name:hover { color: var(--accent); }

.post-time {
  font-size: .75rem;
  color: var(--text-muted);
}

.post-card-body {
  margin-bottom: 14px;
}

.post-content {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Votes */
.post-votes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: all var(--transition);
}
.vote-btn:hover { color: var(--text-primary); background: var(--bg-surface); }
.vote-btn.voted-up { color: var(--success); }
.vote-btn.voted-down { color: var(--accent); }

.vote-count {
  font-weight: 700;
  font-size: .9rem;
  min-width: 24px;
  text-align: center;
}

.post-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: .85rem;
  transition: all var(--transition);
}
.post-comment-btn:hover { color: var(--text-primary); background: var(--bg-surface); }

/* Stickman in card */
.post-card-stickman { margin-bottom: 14px; }

/* FAB */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all var(--transition);
  z-index: 100;
}
.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 28px rgba(255,51,51,.4);
}

/* ================================================================
   POST DETAIL
   ================================================================ */
.post-detail-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.post-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.post-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.post-detail-body {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-detail-votes {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Stickman Display */
.stickman-display {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.stickman-display-title {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.stickman-canvas-container {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.stickman-canvas-sm { height: 150px; }
.stickman-canvas-lg { height: 450px; }
.stickman-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stickman-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ================================================================
   COMMENTS
   ================================================================ */
.comments-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.comments-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.comments-count { color: var(--text-muted); font-weight: 400; }

.comment-form {
  margin-bottom: 24px;
}

.comment-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .9rem;
  resize: vertical;
  min-height: 60px;
  transition: border-color var(--transition);
}
.comment-input:focus {
  outline: none;
  border-color: var(--accent);
}
.comment-input::placeholder { color: var(--text-muted); }

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-primary);
}
.comment-author:hover { color: var(--accent); }

.comment-time {
  font-size: .75rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: .9rem;
  color: var(--text-primary);
  line-height: 1.5;
  padding-left: 36px;
}

.comment-actions {
  padding-left: 36px;
  margin-top: 6px;
}

.comments-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ================================================================
   AUTH
   ================================================================ */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 8px;
}
.auth-header .logo-halla,
.auth-header .logo-sawal {
  font-size: 1.6rem;
}

.auth-tagline {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .95rem;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form { margin-top: 4px; }

.auth-switch {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 16px;
}
.auth-switch a { font-weight: 600; }

/* ================================================================
   PROFILE
   ================================================================ */
.profile-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 200px; }

.profile-display-name {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.profile-username {
  color: var(--text-muted);
  font-size: .9rem;
}

.profile-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-top: 8px;
}

.profile-jurisdiction {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: .85rem;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.profile-stats {
  display: flex;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-stat-num {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.profile-stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.profile-posts-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* Edit profile */
.edit-profile-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

/* ================================================================
   CANDIDATES
   ================================================================ */
.candidates-container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.candidates-header {
  text-align: center;
  margin-bottom: 32px;
}

.candidates-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.candidates-filters .form-input,
.candidates-filters .form-select {
  flex: 1;
  min-width: 200px;
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: all var(--transition);
}
.candidate-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.candidate-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.candidate-name {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.candidate-title {
  color: var(--text-muted);
  font-size: .8rem;
  display: block;
  margin-bottom: 8px;
}

.candidate-jurisdiction {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: .85rem;
  margin-bottom: 10px;
}

.candidate-bio {
  color: var(--text-secondary);
  font-size: .85rem;
  line-height: 1.5;
}

.candidate-card .badge {
  position: absolute;
  top: 16px;
  right: 16px;
}

.candidates-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

/* ================================================================
   ADMIN
   ================================================================ */
.admin-container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-section-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-search-bar .form-input { flex: 1; }

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--bg-surface); }

.admin-promote-form {
  margin-top: 8px;
}

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 900px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
}

/* ================================================================
   STICKMAN PLAYGROUND
   ================================================================ */
.stickman-playground-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stickman-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.toolbar-items {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar-btn {
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}
.toolbar-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.toolbar-btn.active {
  border-color: var(--accent);
  background: rgba(255,51,51,.1);
  color: var(--accent);
}

.stickman-canvas-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}
.stickman-canvas-area:hover {
  border-color: var(--border-light);
}

.stickman-canvas-placeholder {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: .85rem;
}
.stickman-canvas-placeholder p { margin-top: 8px; }

.stickman-playground-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ================================================================
   TOASTS
   ================================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in .3s ease forwards;
}
.toast.toast-out {
  animation: toast-out .3s ease forwards;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--accent); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid #3b82f6; }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-message { flex: 1; font-size: .85rem; }

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 2px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ================================================================
   LOADING SPINNER
   ================================================================ */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
  font-size: .85rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   SCROLL REVEAL
   ================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   SCROLL SENTINEL
   ================================================================ */
.scroll-sentinel {
  height: 1px;
  width: 100%;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stat-bar {
    gap: 24px;
  }

  .hero-stat-num {
    font-size: 1.4rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .lead-card {
    padding: 24px;
  }

  .post-detail {
    padding: 20px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .modal {
    margin: 10px;
    border-radius: var(--radius-lg);
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
  }

  .profile-actions {
    width: 100%;
  }
  .profile-actions .btn { flex: 1; }

  .profile-stats {
    justify-content: space-around;
  }

  .admin-table {
    font-size: .75rem;
  }

  .stickman-toolbar {
    overflow-x: auto;
  }

  .fab {
    bottom: 20px;
    right: 20px;
  }
}

/* ================================================================
   UTILITY
   ================================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
