/* ═══════════════════════════════════════════════════════════
   Genesis Block Workshop — Design System
   SWC Alaska • Solana-themed dark mode
   ═══════════════════════════════════════════════════════════ */

/* ─── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  --sol-purple: #9945FF;
  --sol-green: #14F195;
  --sol-gradient: linear-gradient(135deg, #9945FF, #14F195);
  --sol-gradient-reverse: linear-gradient(135deg, #14F195, #9945FF);

  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-card: rgba(26, 26, 46, 0.8);
  --bg-card-hover: rgba(37, 37, 66, 0.9);

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0b0;
  --text-muted: #666680;

  --border: rgba(153, 69, 255, 0.2);
  --border-hover: rgba(153, 69, 255, 0.4);

  --danger: #ff4466;
  --warning: #ffaa22;
  --success: #14F195;
  --info: #4488ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(153, 69, 255, 0.15);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Background Ambiance ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(153, 69, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(20, 241, 149, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  background: var(--sol-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--sol-purple);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--sol-green); }

/* ─── Layout ────────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--sol-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(153, 69, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--sol-purple);
  background: var(--bg-card-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: #0a0a12;
  font-weight: 700;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--sol-purple);
  box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.15);
}

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

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--sol-purple);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success { background: rgba(20, 241, 149, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 170, 34, 0.15); color: var(--warning); }
.badge-danger  { background: rgba(255, 68, 102, 0.15); color: var(--danger); }
.badge-info    { background: rgba(68, 136, 255, 0.15); color: var(--info); }

/* ─── Live Elements ─────────────────────────────────────── */
.live-count {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  background: var(--sol-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ─── Progress ──────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--sol-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ─── Tables ────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; }

th, td { padding: 0.75rem 1rem; text-align: left; }

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td { border-top: 1px solid var(--border); }

tr:hover td { background: rgba(153, 69, 255, 0.05); }

/* ─── Toasts ────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.toast-success { border-color: var(--success); }
.toast-error   { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ─── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--sol-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

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

/* ─── Stat Grid ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

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

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sol-green);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ─── Quiz Options ──────────────────────────────────────── */
.quiz-option {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.quiz-option:hover {
  border-color: var(--sol-purple);
  transform: translateX(4px);
}

.quiz-option.selected {
  border-color: var(--sol-purple);
  background: rgba(153, 69, 255, 0.1);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(20, 241, 149, 0.1);
}

.quiz-option.incorrect {
  border-color: var(--danger);
  background: rgba(255, 68, 102, 0.1);
}

.quiz-option:disabled {
  cursor: default;
  transform: none !important;
}

/* ─── Result Bars (polls / quiz results) ────────────────── */
.result-bar {
  margin-bottom: 1rem;
}

.result-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.result-bar-track {
  height: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  background: var(--sol-gradient);
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
  min-width: 2px;
}

/* ─── Header ────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* ─── Logo ──────────────────────────────────────────────── */
.logo {
  width: 64px;
  height: 64px;
  background: var(--sol-gradient);
  border-radius: var(--radius);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ─── Success Screen ────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 3rem 1rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(20, 241, 149, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
}

/* ─── Timer ─────────────────────────────────────────────── */
.timer {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  text-align: center;
  padding: 2rem;
}

.timer.warning { color: var(--warning); }
.timer.danger  { color: var(--danger); animation: pulse 1s ease-in-out infinite; }

/* ─── Wallet Address ────────────────────────────────────── */
.wallet-address {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* ─── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--sol-purple);
  border-bottom-color: var(--sol-purple);
}

/* ─── Grid Utilities ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ─── Spacing Utilities ─────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ─── Mobile Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .container { padding: 1.25rem 1rem; }
  .container-wide { padding: 1.25rem 1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .timer { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }
}
