/* ======================================================
   Soulboard — Shared Stylesheet
   Dark theme / amber accent / no external dependencies
   ====================================================== */

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

:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --surface-hi:  #1a1a1a;
  --border:      #2a2a2a;
  --accent:      #f59e0b;
  --accent-hover:#d97706;
  --success:     #10b981;
  --error:       #ef4444;
  --text:        #f5f5f5;
  --text-sec:    #a3a3a3;
  --text-muted:  #666666;
  --mono:        "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  --font:        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius:      12px;
  --radius-sm:   8px;
  --max-w:       1200px;
  --transition:  0.15s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

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

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

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

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
@media (max-width: 768px) { .section { padding: 48px 0; } }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }

p { color: var(--text-sec); }

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

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none; white-space: nowrap; font-family: var(--font);
}
.btn-primary   { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); color: #000; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-muted); background: var(--surface-hi); color: var(--text); }
.btn-destructive { background: var(--error); color: #fff; }
.btn-destructive:hover { background: #dc2626; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-sec); }
.btn-ghost:hover { color: var(--text); background: var(--surface-hi); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-hi {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── Inputs ── */
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }
textarea.input { resize: vertical; min-height: 120px; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-hi);
  color: var(--text-sec);
  border: 1px solid var(--border);
}
.badge-new   { background: rgba(245,158,11,0.15); color: var(--accent); border-color: rgba(245,158,11,0.3); }
.badge-green { background: rgba(16,185,129,0.15); color: var(--success); border-color: rgba(16,185,129,0.3); }
.badge-red   { background: rgba(239,68,68,0.15); color: var(--error); border-color: rgba(239,68,68,0.3); }

/* ── Header / Nav ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  flex-shrink: 0;
}
.nav-mark-cell {
  width: 7px; height: 7px;
  border-radius: 1px;
  background: var(--accent);
}
.nav-mark-cell.empty { background: transparent; border: 1px solid var(--border-hi, #444); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-sec); font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* Mobile nav */
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: var(--transition); }
.nav-mobile { display: none; border-top: 1px solid var(--border); padding: 16px 0; }
.nav-mobile.open { display: block; }
.nav-mobile a { display: block; padding: 12px 0; color: var(--text-sec); font-size: 0.95rem; border-bottom: 1px solid var(--border); }
.nav-mobile a:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text-sec); }
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }
@media (max-width: 768px) { .footer-inner { flex-direction: column; align-items: flex-start; } }

/* ── Grid ── */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pulse dot (Lightning status) ── */
.pulse-dot {
  display: inline-block; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
  animation: pulse-ring 1.5s ease infinite;
  flex-shrink: 0;
}
.pulse-dot.success { background: var(--success); animation: none; }
.pulse-dot.error   { background: var(--error); animation: none; }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(245,158,11,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

/* ── Code block ── */
.code-block {
  background: var(--surface-hi); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  font-family: var(--mono); font-size: 0.82rem; color: var(--text);
  overflow-x: auto; white-space: pre; line-height: 1.5;
}

/* ── Key display ── */
.key-display {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-hi); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.key-value {
  font-family: var(--mono); font-size: 0.85rem; color: var(--accent);
  flex: 1; overflow-x: auto; white-space: nowrap;
}

/* ── Warning box ── */
.warning {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm); padding: 14px 16px;
  color: var(--accent); font-size: 0.88rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; max-width: 480px; width: 100%;
}
.modal h3 { margin-bottom: 12px; }
.modal p  { margin-bottom: 20px; font-size: 0.9rem; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 8px 20px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font); font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--text-sec); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Form labels ── */
label.form-label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text-sec); margin-bottom: 6px;
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Plan radio cards ── */
.plan-option {
  display: flex; align-items: flex-start; gap: 14px;
  border: 2px solid var(--border); border-radius: var(--radius); padding: 18px;
  cursor: pointer; transition: var(--transition);
}
.plan-option.selected, .plan-option:has(input:checked) { border-color: var(--accent); background: rgba(245,158,11,0.05); }
.plan-option input[type="radio"] { margin-top: 3px; accent-color: var(--accent); }
.plan-option-info { flex: 1; }
.plan-option-price { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.plan-option-sub { font-size: 0.82rem; color: var(--text-muted); }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 40px;
}
.pagination-info { color: var(--text-muted); font-size: 0.88rem; }

/* ── Category pill filters ── */
.filter-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px;
}
.pill {
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-sec); font-size: 0.82rem;
  font-weight: 500; cursor: pointer; font-family: var(--font); transition: var(--transition);
  white-space: nowrap;
}
.pill:hover { border-color: var(--text-muted); color: var(--text); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

/* ── Config card ── */
.config-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition); cursor: pointer;
}
.config-card:hover { border-color: var(--text-muted); }
.config-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.config-card-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.config-card-role { font-size: 0.85rem; color: var(--text-sec); }
.config-card-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.config-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.config-card-version { font-size: 0.78rem; color: var(--text-muted); font-family: var(--mono); }

/* ── Detail drawer ── */
.detail-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.5);
}
.detail-overlay.hidden { display: none; }
.detail-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 151;
  width: min(520px, 100vw); background: var(--surface);
  border-left: 1px solid var(--border); overflow-y: auto; padding: 32px;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.detail-drawer.open { transform: translateX(0); }
@media (max-width: 768px) {
  .detail-drawer { width: 100vw; border-left: none; border-top: 1px solid var(--border); }
}
.detail-close { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.soul-preview {
  background: var(--surface-hi); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-sec);
  white-space: pre-wrap; word-break: break-word; max-height: 300px;
  overflow-y: hidden; position: relative;
}
.soul-preview.expanded { max-height: none; }
.soul-preview-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(transparent, var(--surface-hi));
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted); font-size: 0.95rem;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 16px; }

/* ── Alert / notice ── */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.88rem; margin: 12px 0; }
.alert-warn { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: var(--accent); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--error); }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--success); }

/* ── Checkout minimal header ── */
.header-minimal {
  padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 48px;
}

/* ── Lightning timer ── */
.ln-timer { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); color: var(--text); }
.ln-timer.urgent { color: var(--error); }

/* ── QR container ── */
.qr-container {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: var(--radius); padding: 16px;
  width: 220px; height: 220px; margin: 0 auto;
}

/* ── Status row ── */
.status-row { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }

/* ── Utility ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* ── Responsive scroll pills ── */
@media (max-width: 768px) {
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .filter-pills::-webkit-scrollbar { display: none; }
}
