/* UW Seattle Color Palette */
:root {
  --uw-purple: #4b2e83;
  --uw-purple-dark: #32006e;
  --uw-purple-light: #7f6aa3;
  --uw-gold: #b7a57a;
  --uw-gold-dark: #9d8b5c;
  --uw-gold-light: #d4c99a;
  --uw-white: #ffffff;
  --uw-gray-light: #f5f5f5;
  --uw-gray-medium: #d9d9d9;
  --uw-gray-dark: #4d4d4d;
  --text-primary: #2d2d2d;
  --text-secondary: #5a5a5a;
  
  /* UC Official Color Palette */
  --uc-blue: #1295D8;
  --uc-blue-dark: #005581;
  --uc-blue-light: #72CDF4;
  --uc-gold: #FFB511;
  --uc-gold-dark: #FFD200;
  --uc-gold-light: #FFE552;
  
  /* Active theme variables (default to UW) */
  --primary: var(--uw-purple);
  --primary-dark: var(--uw-purple-dark);
  --primary-light: var(--uw-purple-light);
  --accent: var(--uw-gold);
  --accent-dark: var(--uw-gold-dark);
  --accent-light: var(--uw-gold-light);
}

/* UC Theme Override */
body.theme-uc {
  --primary: var(--uc-blue);
  --primary-dark: var(--uc-blue-dark);
  --primary-light: var(--uc-blue-light);
  --accent: var(--uc-gold);
  --accent-dark: var(--uc-gold-dark);
  --accent-light: var(--uc-gold-light);
}

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

body {
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.5s ease;
}

/* UC Theme - Blue/Gold gradient background like official UC sites */
body.theme-uc {
  background: linear-gradient(135deg, #72CDF4 0%, #1295D8 50%, #005581 100%);
}

/* Header */
.uw-header {
  background: var(--primary);
  color: var(--uw-white);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.5s ease;
}

/* UC Theme - Vibrant blue gradient header */
body.theme-uc .uw-header {
  background: linear-gradient(90deg, #005581 0%, #1295D8 100%);
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--accent-light);
  font-weight: 400;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  transition: color 0.3s ease;
}

.disclaimer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300;
  line-height: 1.5;
  max-width: 700px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  transition: border-color 0.3s ease;
}

.subtitle br {
  margin-bottom: 0.5rem;
}

.subtitle a {
  color: var(--uw-white);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.disclaimer a {
  color: var(--accent-light);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.disclaimer a:hover {
  color: var(--uw-white);
}

/* School Tabs */
.school-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--primary-dark);
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.tab-btn {
  flex: 0 1 200px;
  padding: 1rem 2rem;
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.7);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  background: rgba(75, 46, 131, 0.6);
  color: var(--uw-white);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--uw-white);
  border-bottom-color: var(--accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

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

.card {
  background: var(--uw-white);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 6px 24px rgba(75, 46, 131, 0.15);
}

.card h2 {
  color: var(--primary);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* UC Theme - Gold underline for headers */
body.theme-uc .card h2 {
  border-image: linear-gradient(90deg, #FFB511, #FFD200) 1;
}

.card h3 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.instructions {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Test Entry Rows */
#test-entries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.test-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  background: var(--uw-gray-light);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: all 0.2s ease;
}

.test-row:hover {
  background: #fafafa;
  border-left-color: var(--primary);
}

.input-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
  transition: color 0.3s ease;
}

.exam-input,
.score-input {
  padding: 0.75rem;
  border: 2px solid var(--uw-gray-medium);
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--uw-white);
}

.exam-input:focus,
.score-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 46, 131, 0.1);
  transition: all 0.2s ease;
}

.score-input {
  width: 100%;
}

/* Autocomplete Suggestions */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--uw-white);
  border: 2px solid var(--primary);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  transition: border-color 0.3s ease;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--uw-gray-light);
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: var(--primary);
  color: var(--uw-white);
}

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

/* Buttons */
.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

button {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--uw-white);
  box-shadow: 0 2px 8px rgba(75, 46, 131, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(75, 46, 131, 0.4);
}

.btn-secondary {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(183, 165, 122, 0.3);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(183, 165, 122, 0.4);
}

.btn-remove {
  background: #d32f2f;
  color: var(--uw-white);
  padding: 0.5rem 0.85rem;
  font-size: 1.2rem;
  line-height: 1;
  align-self: end;
}

.btn-remove:hover {
  background: #b71c1c;
}

/* Results Section */
.summary-box {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--uw-white);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  transition: background 0.5s ease;
}

/* UC Theme - Blue to Gold gradient for summary */
body.theme-uc .summary-box {
  background: linear-gradient(135deg, #1295D8 0%, #005581 50%, #FFB511 100%);
}

.total-credits,
.course-count {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-box .label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-box .value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-light);
  transition: color 0.3s ease;
}

.no-results {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Table */
.table-container {
  overflow-x: auto;
}

#courses-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#courses-table th,
#courses-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--uw-gray-medium);
}

#courses-table th {
  background: var(--primary);
  color: var(--uw-white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: background 0.3s ease;
}

#courses-table tbody tr {
  transition: background 0.15s ease;
}

#courses-table tbody tr:hover {
  background: var(--uw-gray-light);
}

#courses-table td:nth-child(3) {
  font-weight: 700;
  color: var(--primary);
  transition: color 0.3s ease;
}

/* Requirement Badges */
.requirement-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* UC-specific requirement badges with unique colors */
.requirement-badge[data-requirement*="UC-E"] {
  background: #1976D2;
  color: white;
}

.requirement-badge[data-requirement*="UC-M"] {
  background: #388E3C;
  color: white;
}

.requirement-badge[data-requirement*="UC-H"] {
  background: #7B1FA2;
  color: white;
}

.requirement-badge[data-requirement*="UC-B"] {
  background: #F57C00;
  color: white;
}

.requirement-badge[data-requirement*="UC-S"] {
  background: #C62828;
  color: white;
}

/* Notes Section */
.notes ul {
  list-style: none;
  padding-left: 0;
}

.notes li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.notes li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
  transition: color 0.3s ease;
}

.notes a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.notes a:hover {
  text-decoration: underline;
}

.notes code {
  background: var(--uw-gray-light);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

/* Footer */
.uw-footer {
  background: var(--primary-dark);
  color: var(--accent-light);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.uw-footer a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.uw-footer a:hover {
  color: var(--uw-white);
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .school-tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    flex: 1;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  }
  
  .tab-btn.active {
    border-bottom-color: var(--uw-gold);
  }
  
  .test-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .btn-remove {
    justify-self: start;
  }
  
  .summary-box {
    flex-direction: column;
    gap: 1rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  main {
    margin: 1rem auto;
    padding: 0 1rem 1rem;
  }
}