:root {
  --bg: #0f0f0f;
  --text: #eaeaea;
  --bg-secondary: #1a1a1a;
  --muted: #888;
  --border: #2c2c2c;
  --radius: 6px;
  --font-mono: "Roboto Mono", monospace;
  --font-sans: "Inter", sans-serif;
  --hover-bg: #181818;
}

.light {
  --bg: #ffffff;
  --text: #1a1a1a;
  --bg-secondary: #f7f7f7;
  --muted: #666;
  --border: #dddddd;
  --hover-bg: #efefef;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.7;
  font-size: 16px;
}

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

h1,
.tagline {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

h1 {
  font-size: 2.2rem;
}

.tagline {
  font-size: 1.1rem;
  color: var(--muted);
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 2rem;
}

.gpa-table,
.gpa-summary {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.gpa-table thead {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.gpa-table th,
.gpa-table td,
.gpa-summary th,
.gpa-summary td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.gpa-table td:last-child {
  text-align: center;
}

.gpa-table input,
.gpa-table select {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border 0.2s, background 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.gpa-table input:focus,
.gpa-table select:focus {
  outline: 0;
  border-color: var(--text);
  background: var(--hover-bg);
}

.gpa-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  font-family: var(--font-mono);
  color: var(--text);
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--text);
  color: var(--bg);
}

.delete-button {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.delete-button img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  filter: invert(100%) grayscale(100%) brightness(80%);
  transition: opacity 0.2s, transform 0.2s, filter 0.2s;
}

.delete-button:hover img {
  opacity: 1;
  transform: scale(1.1);
  filter: invert(100%) grayscale(0%) brightness(100%);
}

.light .delete-button img {
  filter: invert(0%) grayscale(100%) brightness(40%);
}

.light .delete-button:hover img {
  filter: invert(0%) grayscale(0%) brightness(0%);
}

.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  margin-top: 2rem;
  background: var(--bg-secondary);
  overflow-x: auto;
}

.gpa-summary thead {
  background: var(--bg-secondary);
}

.gpa-summary td {
  font-weight: 500;
}

@media (max-width: 600px) {
  .gpa-table thead {
    display: none;
  }

  .gpa-table tr {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
  }

  .gpa-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 0.5rem 0;
    position: relative;
  }

  .gpa-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    margin-right: 1rem;
    flex: 1;
  }

  .inline-result {
    font-size: 0.75rem;
    min-width: auto;
  }

  .gpa-table .course-name {
    min-width: 150px;
  }

  .gpa-table .credit-input {
    max-width: 50px;
  }

  .gpa-table .grade-select {
    max-width: 80px;
  }

  .gpa-summary td,
  .gpa-summary th {
    font-size: 0.85rem;
  }
}

.grade-scale {
  width: 100%;
  max-width: 400px;
  border-collapse: collapse;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.grade-scale th,
.grade-scale td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.grade-scale th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.grade-scale tr:last-child td {
  border-bottom: none;
}

.grade-scale {
  margin-left: auto;
  margin-right: auto;
}
