/**
 * MPR state / regional forum boards — dark + gold (aligned with forum_general.php).
 * Loaded by forum_*.php state templates and forum_header.php
 */
:root {
  --f-bg: #0b1120;
  --f-surface: #101010;
  --f-surface-2: #151515;
  --f-elevated: #1c1d21;
  --f-border: rgba(255, 255, 255, 0.12);
  --f-text: #f1f5f9;
  --f-muted: #94a3b8;
  --f-gold: #f6d870;
  --f-gold-mid: #d4af37;
  --f-gold-deep: #b8941f;
  --f-gold-hero-end: #f4e4bc;
  --f-accent: var(--f-gold);
  --f-accent-2: var(--f-gold-deep);
  --f-glow: rgba(212, 175, 55, 0.4);
}

/*
 * theme-toggle.css uses body[data-theme="light"] (higher specificity than bare body).
 * .forum-discussion-page is set on California (and can be set on other state boards) so the
 * General-discussion-style dark shell wins in both light and dark global themes.
 */
html[data-theme="light"] body.forum-discussion-page,
body.forum-discussion-page[data-theme="light"],
body.forum-discussion-page {
  background: var(--f-bg) !important;
  background-color: var(--f-bg) !important;
  color: var(--f-text) !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
}

body {
  background: var(--f-bg) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--f-text);
}

/* Hero — matches forum_general .forum-header */
.forum-header {
  background: linear-gradient(135deg, #d4af37 0%, #f4e4bc 100%);
  color: #333;
  padding: 2.5rem 0;
  margin: 0;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
  border-radius: 0;
  border-top: 3px solid #b8941f;
  border-bottom: none;
}
.forum-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: #222 !important;
}
.forum-header h1 i {
  color: #222 !important;
}
.forum-header p,
.forum-header .mb-0 {
  font-size: 1.1rem;
  opacity: 1;
  color: rgba(0, 0, 0, 0.72) !important;
}
@media (max-width: 768px) {
  .forum-header {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
  }
  .forum-header h1 {
    font-size: 1.8rem;
    text-align: center;
  }
  .forum-header p,
  .forum-header .mb-0 {
    font-size: 1rem;
    text-align: center;
  }
}

/* Topic cards — forum_general dark cards */
.topic-card {
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
}
.topic-card:hover {
  border-color: rgba(246, 216, 112, 0.8);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.9);
  transform: translateY(-2px);
  border-left-color: var(--f-gold-mid) !important;
}
.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.topic-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff !important;
  text-decoration: none;
  line-height: 1.3;
}
.topic-title:hover {
  color: var(--f-gold) !important;
}
.topic-badge { flex-shrink: 0; }
.topic-preview {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #151515;
  border-radius: 8px;
  border-left: 3px solid rgba(246, 216, 112, 0.5);
}
.topic-meta,
.meta-left,
.stat-item {
  color: rgba(255, 255, 255, 0.7) !important;
}
.username {
  color: #b8941f !important;
  font-weight: 600;
}
.date {
  color: #9ca3af !important;
}
.topic-content { flex: 1; }
.topic-stats { color: var(--f-muted) !important; }

/* Forms */
.topic-form {
  background: linear-gradient(180deg, #232428 0%, #1c1d21 100%);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.topic-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b8941f, #f6d870, #b8941f);
}
.topic-form .form-label {
  color: var(--f-text) !important;
  font-weight: 700;
}
.topic-form .form-control {
  border: 1px solid var(--f-border);
  border-radius: 10px;
  background: var(--f-bg) !important;
  color: var(--f-text) !important;
}
.topic-form .form-control:focus {
  border-color: var(--f-gold-mid);
  box-shadow: 0 0 0 3px rgba(246, 216, 112, 0.25);
  background: var(--f-surface-2) !important;
}
.topic-form .form-text {
  color: var(--f-muted) !important;
  background: var(--f-surface);
  border-left: 3px solid #b8941f;
}

.auto-save-status {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(246, 216, 112, 0.35);
  color: var(--f-gold);
}
.auto-save-status.saved {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #86efac;
}
.auto-save-status.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

/* Alerts — readable on dark page */
.alert {
  border-radius: 12px;
  border: 1px solid var(--f-border);
}
.alert-success {
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border-left: 4px solid #22c55e;
}
.alert-danger, .alert.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
  border-left: 4px solid #ef4444;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border-left: 4px solid #f59e0b;
}
.alert .btn-close {
  filter: invert(0.85);
}

/* Top nav strip (forum_header) */
.forum-nav-strip {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
  border: none !important;
  border-bottom: 1px solid var(--f-border) !important;
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  position: relative;
}
.forum-nav-title {
  color: #e2e8f0 !important;
}
.forum-nav-title:hover {
  background: rgba(246, 216, 112, 0.12) !important;
}
.forum-nav-dropdown {
  background: var(--f-surface-2) !important;
  border: 1px solid var(--f-border) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}
.forum-nav-dropdown a {
  color: var(--f-text) !important;
}
.forum-nav-dropdown a:hover {
  background: var(--f-elevated) !important;
  color: var(--f-gold) !important;
}

/* Topics section shell */
.topics-section {
  background: #101010;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--f-border);
  overflow: hidden;
  margin-bottom: 2rem;
}
.topics-header {
  background: linear-gradient(180deg, #1a1a1a 0%, #101010 100%);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--f-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.topics-title {
  color: var(--f-text) !important;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topics-title i {
  color: var(--f-gold) !important;
}
.filter-tabs {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--f-border) !important;
  border-radius: 12px;
  padding: 4px;
}
.filter-tab {
  color: var(--f-muted) !important;
}
.filter-tab:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--f-text) !important;
}
.filter-tab.active {
  background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%) !important;
  color: #111111 !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}
.view-controls {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--f-border);
  border-radius: 10px;
}
.view-btn {
  color: var(--f-muted) !important;
}
.view-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--f-text) !important;
}
.view-btn.active {
  background: rgba(184, 148, 31, 0.2) !important;
  color: var(--f-gold) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.topics-list.card-view .topic-card,
.topics-list.list-view .topic-card {
  background: #101010 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.topics-list.list-view {
  background: #101010 !important;
}
.topics-list.list-view .topic-card:hover {
  background: #151515 !important;
  border-left-color: #b8941f !important;
}
.topics-list.list-view .topic-card.reply-level-2 {
  border-left-color: var(--f-gold) !important;
}

.vote-score {
  background: var(--f-elevated) !important;
  color: var(--f-text) !important;
}

/* Widget / stats */
.widget-card {
  background: linear-gradient(135deg, #101010 0%, #181818 100%) !important;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--f-border) !important;
  color: var(--f-text);
}
.widget-card h5, .widget-title {
  color: var(--f-text) !important;
}

/* Primary CTAs — gold; beat main-style.css purple .btn-primary (often needs .widget-card + below) */
.widget-card .btn-primary,
.topics-section .btn-primary,
.forum-main .btn-primary,
.forum-main-layout .btn-primary,
/* Create Topic sits in .mb-3.text-center, NOT inside .widget-card */
.forum-header ~ .container .btn-primary {
  background: linear-gradient(135deg, #f6d870 0%, #d4af37 100%) !important;
  border: none !important;
  color: #111111 !important;
  font-weight: 700;
}
.widget-card .btn-primary:hover,
.topics-section .btn-primary:hover,
.forum-main .btn-primary:hover,
.forum-main-layout .btn-primary:hover,
.forum-header ~ .container .btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px var(--f-glow) !important;
  color: #111111 !important;
  transform: translateY(-1px);
}
.stat-item {
  background: var(--f-surface) !important;
  border-radius: 12px;
  border: 1px solid var(--f-border);
}
.stat-number {
  color: #ffffff !important;
}
.stat-label {
  color: var(--f-muted) !important;
}
.top-poster-item {
  border-bottom-color: var(--f-border) !important;
}
.poster-details h6 {
  color: var(--f-text) !important;
}
.poster-details small, .poster-stats {
  color: var(--f-muted) !important;
}
.post-count {
  color: var(--f-gold) !important;
}
.poster-avatar {
  background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%) !important;
}

/* City grid + pills — forum_general (!important: win over theme / Bootstrap overrides) */
.widget-card .city-links,
.forum-header ~ .container .city-links,
.city-links {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 0.5rem !important;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .widget-card .city-links,
  .forum-header ~ .container .city-links,
  .city-links {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 0.4rem !important;
  }
}
@media (max-width: 480px) {
  .widget-card .city-links,
  .forum-header ~ .container .city-links,
  .city-links {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.3rem !important;
  }
}
.widget-card a.city-link,
.widget-card span.city-link,
.forum-header ~ .container a.city-link,
.forum-header ~ .container span.city-link,
.city-link {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #101010 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border: 2px solid rgba(255, 255, 255, 0.12) !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
}
.city-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(216, 125, 28, 0.1), transparent);
  transition: left 0.4s ease;
}
.city-link:hover {
  background: #f6d870 !important;
  color: #111111 !important;
  border-color: #f6d870 !important;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(216, 125, 28, 0.3);
}
.city-link:hover::before {
  left: 100%;
}
.city-link.current-city {
  background: linear-gradient(135deg, #b8941f 0%, #b8941f 100%) !important;
  color: #ffffff !important;
  border-color: #b8941f !important;
  box-shadow: 0 4px 15px rgba(216, 125, 28, 0.4);
  font-weight: 700;
}

/* Buttons in forum toolbars */
.btn-group .btn.active,
.view-toggle .btn.active {
  background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%) !important;
  border-color: transparent !important;
  color: #111111 !important;
}
.btn-group .btn:hover:not(.active),
.view-toggle .btn:hover:not(.active) {
  border-color: var(--f-gold) !important;
  color: var(--f-gold) !important;
}

/* Breadcrumbs — readable on dark page */
.breadcrumb-item a {
  color: #94a3b8 !important;
}
.breadcrumb-item a:hover {
  color: #b8941f !important;
}
.breadcrumb-item.active {
  color: var(--f-gold) !important;
}

/* Duplicate .forum-nav-strip block (some pages) — keep consistent */
.forum-nav-content .forum-nav-title {
  color: #e2e8f0 !important;
}

@media (max-width: 768px) {
  .topic-form { padding: 1rem; }
  .topic-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .topics-header { flex-direction: column; align-items: stretch; }
  .widget-card { padding: 1rem; }
}

/* .forum-hero background: forum_dark_theme.css only — do not override with flat gold here. */
.forum-page-wrapper {
  background: var(--f-bg);
}

/* --- body.forum-discussion-page: last-mile wins (Bootstrap + light theme + main-style purple) --- */
body.forum-discussion-page .widget-card .btn-primary,
body.forum-discussion-page .topics-section .btn-primary,
body.forum-discussion-page .forum-main .btn-primary,
body.forum-discussion-page .forum-main-layout .btn-primary,
body.forum-discussion-page .forum-header ~ .container .btn-primary {
  background: linear-gradient(135deg, #f6d870 0%, #d4af37 100%) !important;
  border: none !important;
  color: #111111 !important;
  font-weight: 700 !important;
}
body.forum-discussion-page .widget-card .btn-primary:hover,
body.forum-discussion-page .topics-section .btn-primary:hover,
body.forum-discussion-page .forum-main .btn-primary:hover,
body.forum-discussion-page .forum-main-layout .btn-primary:hover,
body.forum-discussion-page .forum-header ~ .container .btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px var(--f-glow) !important;
  color: #111111 !important;
}
body.forum-discussion-page .widget-card .city-links,
body.forum-discussion-page .forum-header ~ .container .city-links,
body.forum-discussion-page .city-links {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 0.5rem !important;
  margin-top: 1rem;
}
body.forum-discussion-page .widget-card a.city-link,
body.forum-discussion-page .widget-card span.city-link,
body.forum-discussion-page .forum-header ~ .container a.city-link,
body.forum-discussion-page .forum-header ~ .container span.city-link {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
