/* Code Context - Shared Styles */

:root {
  /* Dark theme with cyan/teal accent - matching Synthetic Sciences */
  --bg-0: #0f0f0f;
  --bg-1: #141414;
  --bg-2: #1a1a1a;
  --bg-3: #242424;
  --bg-4: #333333;
  --border-1: #1e1e1e;
  --border-2: #2a2a2a;
  --text-1: #ededed;
  --text-2: #999999;
  --text-3: #666666;
  --text-4: #444444;
  
  /* Accent - Cyan/Teal */
  --accent: #06b6d4;
  --accent-2: #0891b2;
  --accent-dim: rgba(6, 182, 212, 0.15);
  --accent-glow: rgba(6, 182, 212, 0.4);
  
  /* Status colors */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.12);
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.12);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.12);
  
  /* Layout */
  --sidebar-w: 220px;
  --topbar-h: 48px;
  
  /* Typography */
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Space Mono', 'SF Mono', monospace;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-0);
  border: 1px solid var(--border-1);
  border-radius: 8px;
}

.product-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 120ms ease-out;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.product-tab:hover:not(.active) {
  background: var(--bg-2);
  color: var(--text-2);
}

.product-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 4px rgba(6, 182, 212, 0.3);
}

.topbar-center {
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Legacy nav-link support */
.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  transition: all 120ms ease-out;
}

.nav-link:hover {
  color: var(--text-2);
  background: var(--bg-2);
}

.nav-link.active {
  background: var(--accent);
  color: white;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  box-shadow: 0 4px 20px var(--accent-dim);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.btn-github {
  background: #fff;
  color: #000;
  font-weight: 600;
}

.btn-github:hover:not(:disabled) {
  background: #f0f0f0;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== INPUTS ===== */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

/* ===== CARDS ===== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 24px;
}

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  border-color: var(--border-2);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: var(--green-bg);
  color: var(--green);
}

.badge-warning {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge-error {
  background: var(--red-bg);
  color: var(--red);
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-info {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple);
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
}

.alert-error {
  background: var(--red-bg);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--red);
}

.alert-success {
  background: var(--green-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--green);
}

.alert-info {
  background: var(--accent-dim);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent);
}

/* ===== CODE ===== */
.code {
  font-family: var(--font);
  font-size: 13px;
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent);
}

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: 'Space Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  word-wrap: normal;
  color: var(--text-1);
}

.code-block code,
.code-block pre {
  font-family: inherit;
  background: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  color: inherit;
  white-space: pre;
  overflow-x: auto;
}

/* ===== LOADER ===== */
.loader {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* Stagger children animations */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-4);
}
