/* NextRound Design System */
:root {
  --ink: #0a0a0f;
  --paper: #fafaf8;
  --warm: #f5f0e8;
  --accent: #2d5a27;
  --accent-light: #e8f0e6;
  --accent-dark: #1e3d1b;
  --muted: #6b6b6b;
  --border: #e2e0db;
  --danger: #c53030;
  --danger-light: #fef2f2;
  --warning: #b45309;
  --warning-light: #fffbeb;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.15;
}

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

/* Layout */
.page-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 100vh;
}

.page-container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 100vh;
}

/* Nav */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 1px;
  vertical-align: middle;
}

.nav-meta {
  font-size: 13px;
  color: var(--muted);
}

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.card-sm { padding: 20px; }
.card-flush { padding: 0; }

/* Typography */
.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--warm);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-full { width: 100%; }

.btn-ghost {
  background: none;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 13px;
}

.btn-ghost:hover { color: var(--ink); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f3f4f6; color: var(--muted); }
.badge-dark { background: var(--ink); color: white; }

/* Score circle */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  margin: 0 auto;
}

.score-circle .score-number {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.score-circle .score-label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-high { background: var(--accent-light); color: var(--accent); border: 3px solid var(--accent); }
.score-mid { background: var(--warning-light); color: var(--warning); border: 3px solid var(--warning); }
.score-low { background: var(--danger-light); color: var(--danger); border: 3px solid var(--danger); }

/* Chat bubbles */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bubble {
  max-width: 85%;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.7;
  animation: fadeIn 0.3s ease;
}

.bubble-ai {
  background: var(--accent-light);
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
}

.bubble-user {
  background: var(--warm);
  border-radius: 16px 16px 4px 16px;
  align-self: flex-end;
  color: #444;
}

.bubble-feedback {
  background: white;
  border: 1px solid var(--accent);
  border-radius: 12px;
  align-self: flex-start;
  font-size: 14px;
  color: var(--accent-dark);
}

.bubble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.ai-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: 'Space Grotesk', sans-serif;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--muted);
  font-size: 15px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: #fafafa; }

/* Utility */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  max-width: 400px;
  margin: 0 auto;
}

/* Toast / success box */
.success-box {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.success-box h3 {
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 8px;
}

/* Candidate cards */
.candidate-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.candidate-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(45, 90, 39, 0.08);
}

.candidate-card.expanded {
  border-color: var(--accent);
}

.candidate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.candidate-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.candidate-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.candidate-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
}

.candidate-email {
  font-size: 13px;
  color: var(--muted);
}

.candidate-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.candidate-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  display: none;
}

.candidate-card.expanded .candidate-details {
  display: block;
}

/* Response cards in dashboard */
.response-item {
  padding: 16px;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 8px;
}

.response-item .q-text {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.response-item .a-text {
  font-size: 14px;
  color: #444;
  margin-bottom: 6px;
  line-height: 1.6;
}

.response-item .r-score {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* Copy button */
.copy-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Strength/improvement items */
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 15px;
  line-height: 1.5;
}

.insight-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 2px;
}

.insight-green .insight-icon { background: var(--accent-light); color: var(--accent); }
.insight-amber .insight-icon { background: var(--warning-light); color: var(--warning); }

/* Responsive */
@media (max-width: 640px) {
  .page-container, .page-container-wide { padding: 24px 16px; }
  .card { padding: 20px; }
  .page-title { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .candidate-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .score-circle { width: 100px; height: 100px; }
  .score-circle .score-number { font-size: 36px; }
}
