/* Gospel Genius — Custom Styles (Tailwind supplement) */

/* ── Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #0D1B2A;
  color: #F9F4EF;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────── */
.font-heading, h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background-color: #C9A84C;
  color: #0D1B2A;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none;
  line-height: 1.25;
}
.btn-primary:hover {
  background-color: #DFC070;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Form inputs ─────────────────────────────────────────────────── */
.input-field {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F9F4EF;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  width: 100%;
}
.input-field::placeholder { color: rgba(249, 244, 239, 0.3); }
.input-field:focus {
  border-color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

select.input-field option { background-color: #1A2F45; color: #F9F4EF; }

/* ── Quiz option buttons ─────────────────────────────────────────── */
.quiz-option-default {
  background-color: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: #F9F4EF;
}
.quiz-option-default:not(:disabled):hover {
  background-color: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.4);
}
.quiz-option-correct {
  background-color: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.5);
  color: #86efac;
}
.quiz-option-wrong {
  background-color: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
}
.quiz-option-selected {
  background-color: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.5);
}

/* ── Nav link active underline ───────────────────────────────────── */
.nav-link { position: relative; transition: color 0.15s; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: #C9A84C;
  transform: scaleX(0);
  transition: transform 0.2s;
  transform-origin: left;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* ── Scrollbar (webkit) ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #060F18; }
::-webkit-scrollbar-thumb { background: #2A3F55; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C9A84C40; }

/* ── Page transitions ────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
}
.pulse-gold { animation: pulse-gold 2s ease-in-out infinite; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.3s ease forwards; }

/* ── Radar chart container ───────────────────────────────────────── */
.radar-container { position: relative; max-width: 360px; margin: 0 auto; }

/* ── Desktop dropdown panels ─────────────────────────────────────── */
.dd-panel {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}
.dd-panel.dd-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0s;
}

/* ── PWA install prompt ──────────────────────────────────────────── */
.pwa-prompt { animation: fadeInUp 0.4s 30s ease both; }

/* ── Responsive table ────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Loading spinner ─────────────────────────────────────────────── */
.spinner {
  width: 2rem; height: 2rem;
  border: 3px solid rgba(201,168,76,0.2);
  border-top-color: #C9A84C;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Streak fire badge ───────────────────────────────────────────── */
.streak-badge {
  background: linear-gradient(135deg, #FF6B35, #FF9A3C);
  color: white;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* ── Offline mode ────────────────────────────────────────────────── */
/* Applied when body has .gg-offline class (set by sw-register.js)   */

/* Links that go to network-only pages */
body.gg-offline a[href="/quiz"],
body.gg-offline a[href="/leagues/create"],
body.gg-offline a[href="/leagues/join"],
body.gg-offline a[href^="/subscriptions/checkout"],
body.gg-offline a[href^="/ministry/sermons"],
body.gg-offline [data-online-only] {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
  -webkit-user-select: none;
  user-select: none;
}

/* Slim offline notice bar (shown/hidden by JS) */
#gg-offline-bar {
  display: none;
  background: #1a2a3a;
  border-bottom: 1px solid rgba(234,179,8,0.25);
  color: rgba(253,224,71,0.85);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.4rem 1rem;
  position: sticky;
  top: 64px;   /* sits just below the sticky nav */
  z-index: 39;
}
body.gg-offline #gg-offline-bar {
  display: block;
}
