/* ==========================================================================
   SlotRescue — Design System
   Palette: cool slate base, deep indigo primary, amber reserved ONLY for
   urgency/live-rescue moments (countdowns, "slot open now" badges).
   Type: Geist (display/body) + JetBrains Mono (numbers, logs, code) — the
   mono face is the nod to "this is an automation engine", not a generic
   SaaS choice.
   ========================================================================== */

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

:root {
  /* Backgrounds */
  --bg-main: #F6F7F9;
  --bg-surface: #EEF0F4;
  --bg-card: #FFFFFF;

  /* Text */
  --text-main: #12151C;
  --text-muted: #565E6D;
  --text-light: #8B93A1;

  /* Borders */
  --border-color: #E2E5EA;

  /* Brand */
  --btn-primary: #3730A3;
  --btn-primary-hover: #2E2887;
  --btn-primary-text: #FFFFFF;

  /* Semantic */
  --accent-rescue: #D97706;   /* urgency only — countdowns, live badges */
  --success: #0F766E;
  --success-bg: #F0FDFA;
  --danger: #B91C1C;
  --danger-bg: #FEF2F2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(18,21,28,0.04), 0 1px 8px rgba(18,21,28,0.04);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--text-muted); }
a { color: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.section-padding { padding: 4.5rem 0; }
@media (max-width: 640px) { .section-padding { padding: 2.75rem 0; } }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-12 { grid-template-columns: 1fr; }
  .grid-12 > [style*="grid-column"] { grid-column: auto !important; }
}

/* ---- Status dot — signature motif used on dashboard, claim page, hero ---- */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); position: relative; margin-right: 6px;
}
.status-dot.live::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--success); animation: pulse 1.8s ease-out infinite;
}
.status-dot.idle { background: var(--text-light); }
.status-dot.urgent { background: var(--accent-rescue); }
.status-dot.urgent::after { background: var(--accent-rescue); animation: pulse 1.2s ease-out infinite; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot.live::after, .status-dot.urgent::after { animation: none; }
}

/* ---- Navbar ---- */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1.5rem; }
.brand-logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text-main); display: flex; align-items: baseline; gap: 0.4rem; }
.brand-tag { font-size: 0.65rem; font-weight: 600; color: var(--text-light); font-family: 'JetBrains Mono', monospace; border: 1px solid var(--border-color); border-radius: 4px; padding: 1px 6px; }
.nav-links { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-main); }
.nav-actions { display: flex; gap: 0.6rem; align-items: center; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.7rem 1.3rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.92rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform 0.05s ease, opacity 0.15s ease; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-primary); color: var(--btn-primary-text); }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text-main); border-color: var(--border-color); }
.btn-secondary:hover { border-color: var(--text-light); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #FCA5A5; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---- Cards / metrics ---- */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-card); }
.card-slate { background: var(--bg-surface); border-color: var(--border-color); }
.metric-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; }
.metric-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); font-weight: 700; margin-bottom: 0.35rem; }
.metric-value { font-family: 'JetBrains Mono', monospace; font-size: 1.65rem; font-weight: 700; }
.metric-sub { font-size: 0.8rem; color: var(--text-light); margin-top: 0.35rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-main); }
.form-hint { font-size: 0.76rem; color: var(--text-light); margin-top: 0.3rem; }
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 0.92rem; font-family: inherit;
  background: var(--bg-card); color: var(--text-main);
}
.form-control:focus, .form-select:focus, textarea:focus {
  outline: 2px solid var(--btn-primary); outline-offset: 1px; border-color: var(--btn-primary);
}
.range-slider-container { display: flex; align-items: center; gap: 0.75rem; }
.range-slider-container input[type=range] { flex: 1; accent-color: var(--btn-primary); }
.range-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; min-width: 3.2rem; text-align: right; }

/* ---- Code / terminal ---- */
.code-block {
  background: #12151C; color: #D6D9E0; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto;
  white-space: pre; line-height: 1.6;
}
.terminal-window { border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; background: #0D0F14; }
.terminal-header { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 1rem; background: #171A21; border-bottom: 1px solid #262A33; }
.terminal-title { font-size: 0.78rem; color: #9199A8; font-family: 'JetBrains Mono', monospace; }
.terminal-body { padding: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: #C7CBD4; height: 260px; overflow-y: auto; }
.log-line { margin-bottom: 0.45rem; }
.log-time { color: #5B6270; margin-right: 0.6rem; }
.log-msg.highlight { color: #F0B429; }
.log-msg.success { color: #34D399; }

/* ---- Table (dashboard) ---- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border-color); }
table.data-table td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--border-color); }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-open { background: #FEF3C7; color: #92400E; }
.badge-claimed { background: var(--success-bg); color: var(--success); }
.badge-expired { background: #F1F2F4; color: var(--text-light); }

/* ---- Modals ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(18,21,28,0.55); z-index: 999; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.active { display: flex; }
.modal-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.75rem; max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 0.9rem; right: 1rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-light); line-height: 1; }
.tab-nav { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border-color); }
.tab-btn { background: none; border: none; padding: 0.5rem 0.2rem; margin-right: 1rem; font-weight: 600; color: var(--text-light); border-bottom: 2px solid transparent; cursor: pointer; }
.tab-btn.active { color: var(--btn-primary); border-color: var(--btn-primary); }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--border-color); background: var(--bg-card); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.footer-col-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-bottom: 0.8rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a, .footer-links button { background: none; border: none; padding: 0; color: var(--text-muted); text-decoration: none; font-size: 0.87rem; cursor: pointer; font-family: inherit; }
.footer-links a:hover, .footer-links button:hover { color: var(--text-main); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 1.25rem 0; border-top: 1px solid var(--border-color); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Misc ---- */
.ad-container { margin-top: 2rem; }
.ad-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-light); letter-spacing: 0.05em; }
.affiliate-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-light); }
:focus-visible { outline: 2px solid var(--btn-primary); outline-offset: 2px; }
