/* GPA Calculator - Ubersuggest Color Palette */
/* Clean, responsive, sans-serif. Orange accent, navy text, light grays. */
/*
  Ubersuggest hex codes:
  #FA633D - Orange (buttons, links, highlights)
  #E8532D - Orange hover
  #1A202C - Navy (text, navigation)
  #E4E8ED - Light gray (backgrounds)
  #F5F6F7 - White/off-white (main content areas)
*/

:root {
  /* Ubersuggest brand colors */
  --orange: #FA633D;           /* Main accent: buttons, links, highlights */
  --orange-hover: #E8532D;    /* Darker orange for hover states */
  --orange-light: rgba(250, 99, 61, 0.12);  /* Light orange tint for result boxes */
  --navy: #1A202C;            /* Primary text and navigation */
  --bg-light: #E4E8ED;        /* Light gray backgrounds */
  --bg-content: #F5F6F7;      /* Main content areas (cards, etc.) */
  --white: #ffffff;           /* Pure white for nav, inputs */
  /* Supporting grays */
  --gray-200: #d1d5db;
  --gray-300: #9ca3af;
  --gray-400: #6b7280;
  --gray-500: #4b5563;
  /* Semantic colors (GPA thresholds) */
  --green-500: #22c55e;
  --green-600: #16a34a;
  --amber-500: #f59e0b;
  --red-500: #ef4444;
  --font-sans: Arial, Helvetica, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy);
  background: var(--bg-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Navigation */
nav {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--orange);      /* #FA633D */
  text-decoration: none;
}

nav .logo img {
  height: 36px;
  width: auto;
  display: block;
}

nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
}

nav .nav-links a {
  color: var(--navy);        /* #1A202C */
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

nav .nav-links a:hover,
nav .nav-links a.active {
  color: var(--orange);      /* #FA633D */
}

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

h1 {
  font-size: 1.75rem;
  color: var(--navy);        /* #1A202C */
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  color: var(--navy);        /* #1A202C */
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

h3 {
  font-size: 1.1rem;
  color: var(--navy);        /* #1A202C */
  margin: 1.5rem 0 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--gray-500);
}

/* Cards & Forms */
.card {
  background: var(--bg-content);  /* #F5F6F7 */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--navy);        /* #1A202C */
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.2s;
}

select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  padding-right: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--orange);  /* #FA633D */
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--orange);     /* #FA633D */
  color: var(--white);
}

.btn-primary:hover {
  background: var(--orange-hover);  /* #E8532D */
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--navy);            /* #1A202C */
}

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

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Course rows */
.course-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.course-row .btn-remove {
  align-self: end;
  min-height: 2.5rem;
}

.course-row:has(.course-weight) {
  grid-template-columns: 1fr 1fr 1fr auto;
}

@media (max-width: 600px) {
  .course-row {
    grid-template-columns: 1fr 1fr;
  }
  .course-row:has(.course-weight) {
    grid-template-columns: 1fr 1fr;
  }
  .course-row .btn-remove {
    grid-column: 1 / -1;
  }
}

/* GPA Result */
.gpa-result {
  background: var(--orange-light);  /* rgba(250, 99, 61, 0.12) */
  border: 1px solid rgba(250, 99, 61, 0.35);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  text-align: center;
}

.gpa-result .gpa-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--orange);        /* #FA633D */
}

.gpa-result.gpa-high .gpa-value { color: var(--green-600); }
.gpa-result.gpa-mid .gpa-value { color: var(--amber-500); }
.gpa-result.gpa-low .gpa-value { color: var(--red-500); }

/* Badge */
.badge-svg {
  max-width: 160px;
  width: 160px;
  height: auto;
  margin: -0.5rem auto 0.5rem;
  display: block;
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-content);  /* #F5F6F7 */
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);        /* #1A202C */
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--bg-light);  /* #E4E8ED */
}

.accordion-header::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--orange);      /* #FA633D */
}

.accordion-item.active .accordion-header::after {
  content: '−';
}

.accordion-question {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
  max-height: 300px;
}

.accordion-content-inner {
  padding: 1rem 1.25rem;
  background: var(--bg-light);  /* #E4E8ED */
  border-top: 1px solid var(--gray-200);
}

/* Slider */
.slider-container {
  margin: 1rem 0;
}

.slider-container label {
  display: block;
  margin-bottom: 0.5rem;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--gray-200);
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--orange);  /* #FA633D */
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--orange);  /* #FA633D */
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 250px;
  margin: 1.5rem 0;
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--gray-500);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 3rem;
}

footer .footer-nav {
  margin-bottom: 0.5rem;
  background: transparent;
}

footer .footer-nav a {
  color: var(--orange);
  text-decoration: none;
}

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

footer .footer-sep {
  margin: 0 0.5rem;
  color: var(--gray-300);
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  nav .nav-inner {
    padding: 0.75rem 1rem;
  }
  
  nav .logo {
    font-size: 1.1rem;
  }
  
  nav .logo img {
    height: 32px;
  }
  
  nav .nav-links {
    gap: 0.25rem 1rem;
  }
  
  nav .nav-links a {
    font-size: 0.9rem;
    padding: 0.5rem 0.25rem;
  }
  
  .gpa-result .gpa-value {
    font-size: 2rem;
  }
  
  .badge-svg {
    max-width: 140px;
    width: 140px;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }
  
  .btn-small {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }
  
  .modal-content {
    margin: 1rem;
    max-width: none;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 1rem 0.75rem;
  }
  
  h1 {
    font-size: 1.35rem;
  }
  
  h2 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
  }
  
  .card {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .course-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .course-row:has(.course-weight) {
    grid-template-columns: 1fr 1fr;
  }
  
  .course-row .form-group:has(.course-weight) {
    grid-column: 1 / -1;
  }
  
  .chart-container {
    height: 220px;
  }
  
  input[type="range"]::-webkit-slider-thumb,
  input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  min-width: 280px;
}
th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--gray-200);
}
th {
  background: var(--bg-light);  /* #E4E8ED */
  font-weight: 500;
}

/* Error state */
.input-error {
  border-color: var(--red-500) !important;
}

.error-message {
  color: var(--red-500);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Success message */
.success-message {
  color: var(--green-600);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 44, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg-content);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.modal-content .modal-message {
  margin-bottom: 1.25rem;
  color: var(--navy);
}

.modal-content .modal-close {
  min-width: 100px;
}

/* 404 Page */
.page-404 {
  text-align: center;
  padding: 3rem 2rem;
}

.page-404 h1 {
  font-size: 4rem;
  color: var(--orange);
  margin-bottom: 0.25rem;
}

.page-404 h2 {
  border: none;
  margin-top: 0;
}

.page-404 .btn {
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .page-404 h1 {
    font-size: 3rem;
  }
}
