/* ADAPT Core Intelligence — GeckoRegen skin.
   Tokens and motion from Frontend UI.txt. Component markup is injected by app.js. */

:root {
  --bg: #07090B;
  --surface: #111416;
  --glass: rgba(12, 14, 18, 0.7);
  --charcoal-border: rgba(148, 163, 184, 0.08);
  --glass-border: rgba(255, 176, 0, 0.12);
  --amber: #FFB000;
  --amber-glow: #FFBF00;
  --primary: #ffd597;
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --error: #ffb4ab;
  --error-container: #93000a;
  --healthy: #FFB000;
  --degraded: #d7c4ac;
  --broken: #ffb4ab;
  --healing: #FFBF00;
  --font: "Hanken Grotesk", system-ui, sans-serif;
}

body {
  background-color: var(--bg);
  font-family: var(--font);
}

.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--charcoal-border);
  box-shadow: inset 0 0 20px rgba(255, 176, 0, 0.02);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--glass-border);
  box-shadow: inset 0 0 30px rgba(255, 176, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.amber-highlight-top {
  border-top: 1px solid rgba(255, 176, 0, 0.4);
}

.accent-strip-amber { border-left: 4px solid #FFB000; }
.accent-strip-charcoal { border-left: 4px solid rgba(148, 163, 184, 0.2); }
.accent-strip-error { border-left: 4px solid #ffb4ab; }

.btn-primary {
  background-color: #FFB000;
  color: #07090B;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(255, 176, 0, 0.4);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: rgba(12, 14, 18, 0.2);
  border: 1px solid #FFB000;
  color: #FFB000;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: rgba(255, 176, 0, 0.1);
  box-shadow: inset 0 0 10px rgba(255, 176, 0, 0.2);
}

.data-row {
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
  transition: background 0.2s ease;
}
.data-row:hover {
  background: linear-gradient(90deg, rgba(255, 176, 0, 0.05) 0%, transparent 100%);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #07090B; }
::-webkit-scrollbar-thumb { background: #333537; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #47494e; }

html { scroll-behavior: smooth; }

/* Sliding nav underline */
.nav-links {
  position: relative;
  align-items: center;
}
.nav-link {
  position: relative;
  padding-bottom: 6px;
  color: #94A3B8;
  font-weight: 400;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
  font-size: 16px;
  line-height: 1.5;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
}
.nav-link:hover,
.nav-link.is-active {
  color: #ffd597;
  font-weight: 700;
}
.nav-underline {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #ffd597;
  border-radius: 1px;
  pointer-events: none;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LIVE pill */
.live-connected .live-dot {
  background: #FFB000;
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.6);
  animation: live-pulse 2s ease infinite;
}
.live-connected .live-label { color: #FFB000; }
.live-error .live-dot { background: #ffb4ab; }
.live-error .live-label { color: #ffb4ab; }

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Runtime pipeline */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}
.pipeline-stage {
  flex: 1;
  min-width: 120px;
  padding: 14px 12px;
  background: rgba(12, 14, 18, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
  opacity: 0.42;
  transition: opacity 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.pipeline-stage.on {
  opacity: 1;
  border-color: rgba(255, 176, 0, 0.35);
}
.pipeline-stage.active {
  opacity: 1;
  border-color: #FFB000;
  background: rgba(255, 176, 0, 0.08);
  box-shadow: inset 0 0 20px rgba(255, 176, 0, 0.08);
}
.pipeline-file {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 6px;
}
.pipeline-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F8FAFC;
}
.pipeline-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #94A3B8;
}
.pipeline-arrow {
  width: 14px;
  flex-shrink: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 0, 0.35), transparent);
  opacity: 0.4;
}
.pipeline-stage.active + .pipeline-arrow,
.pipeline-stage.on + .pipeline-arrow {
  opacity: 1;
}

/* Health grid — NODE ALPHA style overlays */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  min-height: 420px;
  align-content: start;
}

.reg-card {
  background: rgba(12, 14, 18, 0.7);
  backdrop-filter: blur(24px);
  border: 1px solid var(--charcoal-border);
  border-radius: 0.5rem;
  padding: 16px;
  border-left-width: 4px;
  border-left-style: solid;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.reg-card:hover { transform: translateY(-2px); border-color: var(--glass-border); }

.reg-card.healthy { border-left-color: #FFB000; }
.reg-card.degraded { border-left-color: rgba(148, 163, 184, 0.35); }
.reg-card.broken { border-left-color: #ffb4ab; }
.reg-card.healing { border-left-color: #FFBF00; }
.reg-card.unknown { border-left-color: rgba(148, 163, 184, 0.2); }

.reg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.reg-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.reg-juris {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.reg-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.status-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.healthy .status-dot { background: #FFB000; box-shadow: 0 0 8px rgba(255, 176, 0, 0.5); }
.healthy .status-text { color: #FFB000; }
.degraded .status-dot { background: #d7c4ac; }
.degraded .status-text { color: #d7c4ac; }
.broken .status-dot { background: #ffb4ab; box-shadow: 0 0 8px rgba(255, 180, 171, 0.5); }
.broken .status-text { color: #ffb4ab; }
.healing .status-dot {
  background: #FFBF00;
  animation: live-pulse 1.2s ease infinite;
}
.healing .status-text { color: #FFBF00; }

.reg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.meta-val {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
}

.pulse-broken { animation: pulse-red 0.6s ease; }
.pulse-healed { animation: pulse-amber 0.6s ease; }
@keyframes pulse-red {
  30% { box-shadow: 0 0 24px rgba(255, 180, 171, 0.45); }
}
@keyframes pulse-amber {
  30% { box-shadow: 0 0 24px rgba(255, 176, 0, 0.45); }
}

/* Change feed — telemetry rows */
.change-feed { max-height: 520px; overflow-y: auto; }
.change-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
  border-left: 4px solid rgba(148, 163, 184, 0.2);
}
.change-item:hover {
  background: linear-gradient(90deg, rgba(255, 176, 0, 0.05) 0%, transparent 100%);
}
.change-item.sev-critical { border-left-color: #ffb4ab; }
.change-item.sev-warning { border-left-color: #d7c4ac; }
.change-item.sev-info { border-left-color: #FFB000; }

.change-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.change-reg {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.change-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.change-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 4px 0 6px;
  max-width: 72ch;
}
.change-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.change-link { color: #FFB000; text-decoration: none; }
.change-link:hover { color: #FFBF00; }

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid var(--charcoal-border);
}
.badge-critical { background: #93000a; color: #ffdad6; border-color: transparent; }
.badge-warning { color: #d7c4ac; }
.badge-info { color: #FFB000; border-color: rgba(255, 176, 0, 0.3); }
.badge-new { background: #FFB000; color: #07090B; border-color: transparent; }

/* Heal timeline — node telemetry rows */
.heal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
  border-left: 4px solid rgba(148, 163, 184, 0.2);
  gap: 12px;
}
.heal-item:hover {
  background: linear-gradient(90deg, rgba(255, 176, 0, 0.05) 0%, transparent 100%);
}
.heal-item.success { border-left-color: #FFB000; }
.heal-item.failed { border-left-color: #ffb4ab; }
.heal-reg {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.heal-detail {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.heal-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.heal-rate {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.heal-item.success .heal-rate { color: #FFB000; }
.heal-item.failed .heal-rate { color: #ffb4ab; }

/* Event / anomaly log */
.event-log { font-size: 13px; }
.event-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}
.event-time {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.5);
}
.event-type {
  color: #FFB000;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.event-data { color: var(--text-secondary); word-break: break-word; line-height: 1.4; }

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Guide page */
.guide-hero { padding: 24px 0 8px; }
.guide-hero h1 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.guide-hero p {
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.6;
}
.guide-section {
  padding: 8px 0 16px;
}
.guide-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.guide-section p,
.guide-section li {
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}
.guide-section ol, .guide-section ul { padding-left: 20px; }
.guide-step {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
.guide-step-num {
  font-size: 20px;
  font-weight: 600;
  color: #FFB000;
  min-width: 1.5ch;
}
.guide-step-body strong { color: var(--text); }
.guide-grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-dot.green { background: #FFB000; }
.legend-dot.yellow { background: #d7c4ac; }
.legend-dot.red { background: #ffb4ab; }
.guide-cta { text-align: center; padding: 24px 0 8px; }

@media (max-width: 900px) {
  .health-grid { grid-template-columns: 1fr; min-height: 0; }
  .pipeline { flex-direction: column; }
  .pipeline-arrow {
    width: 100%;
    height: 10px;
    background: linear-gradient(180deg, transparent, rgba(255, 176, 0, 0.35), transparent);
  }
}
