/* ═══════════════════════════════════════════
   Forge Bible Bot — Dashboard Styles
   Dark forge theme with warm gold accents
   ═══════════════════════════════════════════ */

:root {
  --bg: #0F0F14;
  --bg-card: #1A1A22;
  --bg-card-hover: #22222C;
  --border: #2A2A35;
  --text: #E0E0E0;
  --text-dim: #8A8A9A;
  --text-muted: #5A5A6A;
  --gold: #D4A017;
  --gold-dim: #A07B0E;
  --gold-glow: rgba(212, 160, 23, 0.15);
  --accent: #4A90D9;
  --success: #2ECC71;
  --error: #E74C3C;
  --twitch: #9146FF;
  --discord: #5865F2;
  --radius: 10px;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-links a { color: var(--text-dim); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.nav-center a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-center a:hover { color: var(--gold); text-decoration: none; }

.nav-sep { color: var(--text-muted); font-size: 0.8rem; }

.nav-user {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-card);
  border-radius: 6px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--gold);
  color: #111;
}
.btn-primary:hover { background: #E5B120; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

.btn-twitch { background: var(--twitch); color: #fff; }
.btn-twitch:hover { background: #7C3AED; text-decoration: none; color: #fff; }

.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752C4; text-decoration: none; color: #fff; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background:
    radial-gradient(ellipse at 50% 0%, var(--gold-glow) 0%, transparent 60%),
    var(--bg);
}

.hero-content { max-width: 720px; margin: 0 auto; }

.hero-tagline {
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hero-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ── FEATURES ── */
.features {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: border-color 0.3s ease;
}

.feature-card:hover {
  border-color: var(--gold-dim);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ── STATS ── */
.stats-section {
  padding: 3rem 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-number, .stat-val {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
}

.stat-label, .stat-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* ── HOW IT WORKS ── */
.how-it-works {
  padding: 4rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
  width: 60px;
  height: 60px;
  line-height: 60px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── COMMUNITY ── */
.community {
  padding: 4rem 2rem;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.community-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0.5rem auto 2rem;
  line-height: 1.7;
}

.community-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
}

.community-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.community-twitch:hover { border-color: var(--twitch); }
.community-discord:hover { border-color: var(--discord); }
.community-support:hover { border-color: #E74C3C; }

.community-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.community-card h3 { color: var(--text); font-size: 1.1rem; margin-bottom: 0.5rem; }
.community-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

/* ── CTA ── */
.cta {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.cta h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.cta p {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* ── LOGIN ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  min-height: 60vh;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-card h1 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}

.login-card > p {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 1.5rem;
  line-height: 1.5;
}

.alert-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #E74C3C;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ── DASHBOARD ── */
.dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
}

.dash-subtitle {
  color: var(--text-dim);
}

.dash-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-active { background: var(--success); box-shadow: 0 0 8px rgba(46, 204, 113, 0.5); }
.status-inactive { background: var(--error); }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

.card-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ── CONNECTIONS ── */
.connections-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.connection-item:last-child { border-bottom: none; }

.connection-item strong {
  min-width: 100px;
  color: var(--text-dim);
  font-weight: 500;
}

.connection-active {
  color: var(--success);
  font-size: 0.9rem;
}

.overlay-url-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.overlay-url-wrap code {
  background: var(--bg);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--gold);
  border: 1px solid var(--border);
  word-break: break-all;
}

.overlay-url-wrap + small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

/* ── FORMS ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea { resize: vertical; }

.input-prefix-wrap {
  display: flex;
  align-items: center;
}

.input-prefix {
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 0.6rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-prefix-wrap input {
  border-radius: 0 6px 6px 0 !important;
}

/* ── TOGGLES ── */
.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.toggle-item input[type="checkbox"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ── SAVE BAR ── */
.save-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, var(--bg) 30%);
  padding-top: 2rem;
}

.save-status {
  font-size: 0.9rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
}

.save-status.visible { opacity: 1; }

/* ── FOOTER ── */
.footer {
  padding: 3rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.footer-col h4 {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.footer-col p { color: var(--text-dim); }

.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.2rem 0;
  text-decoration: none;
}

.footer-col a:hover { color: var(--gold); text-decoration: none; }

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--gold); }

.footer-verse {
  margin-top: 0.5rem;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 2rem; }
  .connection-item { flex-direction: column; align-items: flex-start; }
  .dash-header { flex-direction: column; }
  .community-links { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { gap: 2rem; text-align: center; }
  .nav-center { display: none; }
}

/* ═══════════════════════════════════
   ADMIN DASHBOARD
   ═══════════════════════════════════ */

.nav-admin {
  color: var(--gold) !important;
  font-weight: 700;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(212, 160, 23, 0.05);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.badge-inactive {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.badge-admin {
  background: rgba(212, 160, 23, 0.2);
  color: var(--gold);
  margin-left: 0.5rem;
}

.badge-twitch {
  background: rgba(145, 70, 255, 0.2);
  color: #9146ff;
}

.badge-discord {
  background: rgba(88, 101, 242, 0.2);
  color: #5865f2;
}

.link-twitch {
  color: #9146ff;
  text-decoration: none;
}
.link-twitch:hover { text-decoration: underline; }

.link-discord {
  color: #5865f2;
}

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

.system-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item strong {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-item span {
  font-family: monospace;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-number { font-size: 1.8rem; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 0.5rem; }
}
