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

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #64748b;
  --accent-light: #94a3b8;
  --border: #475569;
  --success: #4ade80;
  --warning: #fbbf24;
  --info: #60a5fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header a {
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

header a:hover {
  color: var(--text-primary);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  font-size: 1.15rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--border);
}

body.light-mode {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #475569;
  --accent-light: #64748b;
  --border: #cbd5e1;
  --success: #16a34a;
  --warning: #d97706;
  --info: #2563eb;
}

body.light-mode .pathway-item.held {
  background: rgba(22, 163, 74, 0.08);
}

body.light-mode .pathway-item.next {
  background: rgba(37, 99, 235, 0.08);
}

body.light-mode .pathway-item.future {
  background: rgba(100, 116, 139, 0.06);
}

body.light-mode .status-badge.held {
  background: rgba(22, 163, 74, 0.12);
}

body.light-mode .status-badge.next {
  background: rgba(37, 99, 235, 0.12);
}

body.light-mode .status-badge.future {
  background: rgba(100, 116, 139, 0.1);
}

body.light-mode .experience-note {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.25);
}

body.light-mode .disclaimer {
  background: rgba(217, 119, 6, 0.04);
  border-color: rgba(217, 119, 6, 0.2);
}

body.light-mode .explanation-item {
  border-bottom-color: rgba(203, 213, 225, 0.6);
}

body.light-mode .degree-note {
  background: rgba(100, 116, 139, 0.06);
  border-color: rgba(100, 116, 139, 0.2);
}

body.light-mode select,
body.light-mode input[type="number"] {
  background: #f8fafc;
}

body.light-mode .cert-item {
  background: #f8fafc;
}

body.light-mode .cert-item:hover {
  background: var(--border);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.arch-flow {
  text-align: center;
  padding: 1rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

select,
input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  appearance: auto;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-light);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.cert-item:hover {
  background: var(--border);
}

.cert-item input[type="checkbox"] {
  accent-color: var(--accent-light);
  margin: 0;
}

button[type="submit"] {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--accent);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover {
  background: var(--accent-light);
  color: var(--bg-primary);
}

.pathway-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.pathway-item.held {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid var(--success);
  color: var(--success);
}

.pathway-item.next {
  background: rgba(96, 165, 250, 0.1);
  border-left: 3px solid var(--info);
  color: var(--info);
}

.pathway-item.future {
  background: rgba(148, 163, 184, 0.08);
  border-left: 3px solid var(--text-muted);
  color: var(--text-muted);
}

.status-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.status-badge.held {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.status-badge.next {
  background: rgba(96, 165, 250, 0.2);
  color: var(--info);
}

.status-badge.future {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.experience-note {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  padding: 1rem;
  color: var(--warning);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.explanation-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(71, 85, 105, 0.4);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.explanation-item:last-child {
  border-bottom: none;
}

.rule-tag {
  display: inline-block;
  background: rgba(96, 165, 250, 0.15);
  color: var(--info);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  font-family: monospace;
}

.coverage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coverage-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.check-icon {
  color: var(--success);
  font-weight: bold;
}

.coverage-summary {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.evidence-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.evidence-detail span {
  color: var(--text-secondary);
}

.disclaimer {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.rules-list {
  list-style: none;
  padding: 0;
}

.rules-list li {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.degree-note {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    text-align: center;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .container {
    padding: 1rem;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }

  .coverage-grid {
    grid-template-columns: 1fr;
  }
}
