@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0a0e17;
  --surface: #121a2b;
  --surface2: #1a2438;
  --border: #2a3a5c;
  --text: #e8edf7;
  --muted: #8b9dc3;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --low: #22c55e;
  --medium: #f59e0b;
  --high: #ef4444;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.08), transparent);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.hero h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-row input {
  flex: 1;
  min-width: 220px;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.search-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-row button {
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.search-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.search-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.api-row {
  margin-top: 0.75rem;
}

.api-row input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
}

.api-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.train-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.model-status {
  font-size: 0.8rem;
  color: var(--muted);
}

.status-bar {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-bar.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-bar.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.LOW {
  background: rgba(34, 197, 94, 0.2);
  color: var(--low);
}

.badge.MEDIUM {
  background: rgba(245, 158, 11, 0.2);
  color: var(--medium);
}

.badge.HIGH {
  background: rgba(239, 68, 68, 0.2);
  color: var(--high);
}

.model-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.prob-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.alerts-card h3,
.features-card h3,
.tx-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

#alertsList {
  list-style: none;
}

#alertsList li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  padding-left: 1.25rem;
  position: relative;
}

#alertsList li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  color: var(--medium);
}

#alertsList li.none {
  color: var(--muted);
}

#alertsList li.none::before {
  content: "✓";
  color: var(--low);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.feature-item {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.feature-item .val {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.feature-item .key {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
}

td {
  font-family: "JetBrains Mono", monospace;
  word-break: break-all;
}

.flow-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer .muted {
  margin-top: 0.35rem;
  opacity: 0.7;
}
