/*
 * fistbump.css — Unified theme for all Fistbump projects
 * Include this before project-specific styles.
 */

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

:root {
  /* Background */
  --fb-bg:          #09090b;
  --fb-bg-raised:   #111113;
  --fb-bg-card:     #18181b;
  --fb-bg-input:    #1e1e22;
  --fb-bg-hover:    #27272a;

  /* Borders */
  --fb-border:      #27272a;
  --fb-border-light:#3f3f46;

  /* Text */
  --fb-text:        #fafafa;
  --fb-text-muted:  #a1a1aa;
  --fb-text-dim:    #71717a;

  /* Accent */
  --fb-accent:      #57c7ed;
  --fb-accent-dim:  rgba(87, 199, 237, 0.4);
  --fb-accent-bg:   rgba(87, 199, 237, 0.08);

  /* Semantic colors */
  --fb-blue:        #60a5fa;
  --fb-blue-bg:     rgba(96, 165, 250, 0.12);
  --fb-yellow:      #fbbf24;
  --fb-yellow-bg:   rgba(251, 191, 36, 0.12);
  --fb-red:         #f87171;
  --fb-red-bg:      rgba(248, 113, 113, 0.12);
  --fb-green:       #4ade80;
  --fb-green-bg:    rgba(74, 222, 128, 0.12);
  --fb-purple:      #c084fc;
  --fb-purple-bg:   rgba(192, 132, 252, 0.12);
  --fb-teal:        #5eead4;
  --fb-teal-bg:     rgba(94, 234, 212, 0.12);

  /* Typography */
  --fb-font-sans:   -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --fb-font-mono:   "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Menlo, monospace;
  --fb-text-xs:     11px;
  --fb-text-sm:     13px;
  --fb-text-base:   14px;
  --fb-text-lg:     16px;
  --fb-text-xl:     18px;
  --fb-text-2xl:    22px;
  --fb-leading:     1.6;

  /* Spacing */
  --fb-space-xs:    4px;
  --fb-space-sm:    8px;
  --fb-space-md:    12px;
  --fb-space-base:  16px;
  --fb-space-lg:    24px;
  --fb-space-xl:    40px;
  --fb-space-2xl:   48px;

  /* Radii */
  --fb-radius-sm:   4px;
  --fb-radius:      8px;
  --fb-radius-lg:   12px;
  --fb-radius-pill: 9999px;
}

html { scroll-padding-top: var(--fb-space-lg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--fb-font-sans);
  background: var(--fb-bg);
  color: var(--fb-text);
  line-height: var(--fb-leading);
  font-size: var(--fb-text-base);
}

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

code, pre, .mono {
  font-family: var(--fb-font-mono);
}

/* Inline code */
code {
  font-size: var(--fb-text-sm);
  background: var(--fb-bg-card);
  padding: 2px 6px;
  border-radius: var(--fb-radius-sm);
  color: var(--fb-accent);
}
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Code blocks */
pre {
  background: var(--fb-bg-raised);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: var(--fb-space-base);
  font-size: var(--fb-text-sm);
  line-height: var(--fb-leading);
  overflow-x: auto;
  color: var(--fb-text-muted);
}

/* Inputs */
input, textarea, select {
  font-family: var(--fb-font-sans);
  font-size: var(--fb-text-sm);
  color: var(--fb-text);
  background: var(--fb-bg-input);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: 0 var(--fb-space-md);
  height: 34px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: var(--fb-space-sm) var(--fb-space-md); }
input[type="checkbox"], input[type="radio"] { height: auto; }
input::placeholder, textarea::placeholder { color: var(--fb-text-dim); }
input:focus, textarea:focus, select:focus { border-color: var(--fb-accent); box-shadow: 0 0 0 3px rgba(87, 199, 237, 0.1); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 36px;
  background: var(--fb-bg-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  color: var(--fb-text-muted);
  font-family: var(--fb-font-sans);
  font-size: var(--fb-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
  line-height: 1;
  box-sizing: border-box;
}
.btn:hover { border-color: var(--fb-border-light); color: var(--fb-text); text-decoration: none; }
.btn.primary { background: var(--fb-accent); border-color: var(--fb-accent); color: #fff; }
.btn.primary:hover { opacity: 0.85; }
.btn.danger { background: var(--fb-red); border-color: var(--fb-red); color: #fff; }
.btn.danger:hover { opacity: 0.85; }
.btn.disabled { opacity: 0.35; pointer-events: none; }

/* Cards */
.fb-card {
  background: var(--fb-bg-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius-lg);
  overflow: hidden;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px var(--fb-space-base);
  font-size: var(--fb-text-xs);
  font-weight: 600;
  color: var(--fb-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--fb-border);
  background: var(--fb-bg-raised);
}
td {
  padding: 10px var(--fb-space-base);
  font-size: var(--fb-text-base);
  border-bottom: 1px solid var(--fb-bg-input);
}
tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px var(--fb-space-sm);
  border-radius: var(--fb-radius-sm);
  font-size: var(--fb-text-sm);
  font-weight: 500;
  text-transform: uppercase;
  margin: 1px 2px;
}
.badge-count  { margin-left: 1px; font-weight: 700; }
.badge-count::before { content: '\00d7'; margin-right: 1px; font-weight: 400; }
.badge-green  { background: var(--fb-green-bg);  color: var(--fb-green);  }
.badge-red    { background: var(--fb-red-bg);    color: var(--fb-red);    }
.badge-yellow { background: var(--fb-yellow-bg); color: var(--fb-yellow); }
.badge-blue   { background: var(--fb-blue-bg);   color: var(--fb-blue);   }
.badge-purple { background: var(--fb-purple-bg); color: var(--fb-purple); }
.badge-gray   { background: var(--fb-bg-hover);  color: var(--fb-text-muted); }
.badge-teal   { background: var(--fb-teal-bg);   color: var(--fb-teal);   }

/* Stat boxes */
.fb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--fb-border);
  border-radius: var(--fb-radius-lg);
  overflow: hidden;
}
.fb-stat {
  background: var(--fb-bg-card);
  padding: var(--fb-space-base) 20px;
}
.fb-stat-label {
  font-size: var(--fb-text-xs);
  color: var(--fb-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--fb-space-xs);
}
.fb-stat-value {
  font-size: 15px;
  font-weight: 600;
}

/* List / Row */
.fb-list {
  display: flex;
  flex-direction: column;
  gap: var(--fb-space-base);
}
.fb-row {
  display: flex;
  align-items: center;
  gap: var(--fb-space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--fb-border);
}
.fb-row:last-child { border-bottom: none; }
.fb-row label:not(.switch) {
  width: 80px;
  font-size: var(--fb-text-sm);
  color: var(--fb-text-muted);
  flex-shrink: 0;
}
.fb-row input:not([type="checkbox"]):not([type="radio"]) {
  flex: 1;
}
.fb-row select {
  flex: 1;
  -webkit-appearance: none;
}

/* Utility */
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.muted { color: var(--fb-text-dim); }
.green { color: var(--fb-green); }
.red   { color: var(--fb-red); }

/* Terminal windows */
.fb-terminal {
  background: var(--fb-bg-raised);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius-lg);
  overflow: hidden;
}
.fb-terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  background: rgba(24, 24, 27, 0.8);
  border-bottom: 1px solid var(--fb-border);
}
.fb-terminal-dot { width: 11px; height: 11px; border-radius: 50%; }
.fb-terminal-dot:nth-child(1) { background: var(--fb-red); }
.fb-terminal-dot:nth-child(2) { background: var(--fb-yellow); }
.fb-terminal-dot:nth-child(3) { background: var(--fb-green); }
.fb-terminal-title {
  margin-left: auto; font-size: var(--fb-text-xs);
  color: var(--fb-text-dim); font-family: var(--fb-font-mono);
}
.fb-terminal-body { padding: 12px 16px; overflow-x: auto; }
.fb-terminal-body code {
  font-size: var(--fb-text-sm); line-height: 1.7;
  color: var(--fb-text-muted);
  background: none; border-radius: 0;
  display: inline-block; white-space: pre; min-width: 100%;
}

/* Terminal syntax */
.t-prompt { color: var(--fb-green); font-weight: 600; user-select: none; margin-right: 1ch; }
.t-dim { color: var(--fb-text-dim); }
.t-accent { color: var(--fb-accent); }
.t-str { color: var(--fb-yellow); }

/* Background glow */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(87, 199, 237, 0.07) 0%, transparent 70%);
}

/* Glass panels */
.fb-glass {
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(87, 199, 237, 0.08);
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fb-border-light); border-radius: 2px; }
