:root {
  --primary: #2563eb;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem;
}

.container {
  width: 100%;
  max-width: 1200px;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.input-card, .results-card {
  height: fit-content;
}

h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2.5rem;
  font-weight: 700;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
  border: 1px solid #e5e7eb;
}

textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

button#evaluateBtn {
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s, transform 0.2s;
}

button#evaluateBtn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

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

#resultsSection {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#resultsSection.visible {
  opacity: 1;
  transform: translateY(0);
}

#resultsSection h2 {
  color: var(--primary);
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

#resultsSection h3 {
    font-weight: 600;
    margin-bottom: 1rem;
}

pre {
  background: #f3f4f6;
  padding: 1.25rem;
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
}

#metricsTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

#metricsTable th,
#metricsTable td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

#metricsTable th {
  background: #f9fafb;
  font-weight: 600;
}

#metricsTable tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Advanced hyperparameters */
details.advanced {
  margin: 1rem 0 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

details.advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--primary);
}

details.advanced[open] > summary {
  border-bottom: 1px solid #e5e7eb;
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
  padding: 1rem;
}


/* Model provider and hint styles */
.model-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e5e7eb;
}

.badge.openai { background: #eef2ff; color: #3730a3; }
.badge.google { background: #ecfdf5; color: #065f46; }
.badge.microsoft { background: #eff6ff; color: #1e40af; }
.badge.meta { background: #fef3c7; color: #92400e; }
.badge.tinyllama { background: #f3e8ff; color: #6b21a8; }
.badge.alibaba { background: #fff7ed; color: #9a3412; }
.badge.default { background: #f3f4f6; color: #374151; }

.hint-text {
  color: var(--muted);
}

