/* ==========================================================================
   LockInPay — Ultra-Minimalist Design System
   Strict Black & White Canvas + Electric Emerald Green Accent
   ========================================================================== */

:root {
  color-scheme: dark light;
  --bg-primary: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-raised: #121212;
  --bg-surface-hover: #181818;
  --border-subtle: #222222;
  --border-strong: #333333;
  --border-active: #555555;
  
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #888888;
  
  --emerald: #10b981;
  --emerald-dim: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Geist", "Inter", -system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Geist Mono", "JetBrains Mono", Menlo, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Theme Parity */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-surface: #f8fafc;
  --bg-surface-raised: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-active: #94a3b8;
  
  --text-primary: #0a0a0a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --emerald: #047857;
  --emerald-dim: #065f46;
  --emerald-glow: rgba(4, 120, 87, 0.12);
  --emerald-border: rgba(4, 120, 87, 0.35);
}

[data-theme="light"] .btn-primary {
  background: var(--emerald);
  color: #ffffff;
  border-color: var(--emerald);
}

[data-theme="light"] .btn-primary:hover {
  background: var(--emerald-dim);
  border-color: var(--emerald-dim);
  box-shadow: 0 0 14px var(--emerald-glow);
}

[data-theme="light"] .badge-pending {
  background: rgba(180, 83, 9, 0.1);
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.3);
}

[data-theme="light"] .code-box {
  background: #0f172a;
  color: #a3e635;
  border-color: #1e293b;
}

[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.65);
}

[data-theme="light"] .creator-hero {
  background: linear-gradient(180deg, var(--bg-surface-raised) 0%, var(--bg-surface) 100%);
  border-color: var(--border-strong);
}

[data-theme="light"] .pricing-card.featured {
  border-color: var(--emerald);
  box-shadow: 0 0 20px rgba(4, 120, 87, 0.12);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tabular figures for numbers */
.num, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Header & Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--emerald);
  font-size: 14px;
  font-weight: 700;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.brand-title span {
  color: var(--emerald);
}

.edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--emerald);
  background: var(--emerald-glow);
  border: 1px solid var(--emerald-border);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px var(--emerald); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Mode Switcher Nav */
.view-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.nav-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.nav-pill:hover {
  color: var(--text-primary);
}

.nav-pill.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--emerald);
  color: #000000;
  font-weight: 600;
  border-color: var(--emerald);
}

.btn-primary:hover {
  background: #34d399;
  border-color: #34d399;
  box-shadow: 0 0 14px var(--emerald-glow);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-sm {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Grid & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.1;
}

.card-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

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

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Table Styles */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--bg-surface-raised);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-surface-hover);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-family: var(--font-mono);
}

.badge-active {
  background: var(--emerald-glow);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Creator Portal Layout */
.creator-hero {
  background: linear-gradient(180deg, var(--bg-surface-raised) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.link-box-container {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-top: 14px;
}

.link-box-container input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
}

/* Live Event Ticker */
.event-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}

.event-row:hover {
  border-color: var(--border-strong);
}

.event-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.pricing-card.featured {
  border-color: var(--emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.pricing-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pricing-price {
  font-size: 44px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 24px;
  line-height: 1;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  flex: 1;
}

.pricing-features li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li.active {
  color: var(--text-primary);
}

.pricing-features li::before {
  content: "✓";
  color: var(--emerald);
  font-weight: bold;
}

/* Code block snippet */
.code-box {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a3e635;
  overflow-x: auto;
  position: relative;
  margin: 12px 0;
}

/* Interactive Simulator */
.simulator-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.sim-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.input-field {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.input-field:focus {
  border-color: var(--emerald);
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  padding: 24px;
  position: relative;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: var(--bg-surface-raised);
  border: 1px solid var(--emerald-border);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-primary);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .view-switcher {
    width: 100%;
    overflow-x: auto;
  }
}
