/* --------------------------- */
/* General Page Styling */
body {
  font-family: Inter, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg, #f3f7ff 0%, #ffffff 60%);
  color: #1f2937;
  margin: 24px;
  line-height: 1.45;
}

#main-container {
  display: flex;
#main-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}
#calculator-box {
  flex: 1 1 520px;
  max-width: 720px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 26px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(31,41,55,0.08);
  border: 1px solid rgba(99,102,241,0.06);
}

/* Terms row (horizontal layout) */
.terms-row {
#calculator-box {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 26px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(31,41,55,0.08);
  border: 1px solid rgba(99,102,241,0.06);
}
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31,41,55,0.04);
  border: 1px solid rgba(15,23,42,0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

/* Term container */
/* Term container */
.term {
  flex: 1 1 260px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31,41,55,0.04);
  border: 1px solid rgba(15,23,42,0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.term-title {
  border: none;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  background: transparent;
}

.term-title:focus {
  position: absolute;
  top: 120px;
  right: 28px;
  width: 340px;
  z-index: 40;
  background: rgba(255,255,255,0.98);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  border: 1px solid rgba(2,6,23,0.06);
  margin-bottom: 12px;
}
  .course-row .removeCourseBtn {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    background-color: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    margin-left: 8px;
    z-index: 2;
  }
}
  flex-wrap: nowrap;
  align-items: center;
  padding: 6px 0;
  #main-container {
    flex-direction: column;
  }

  .terms-row {
    flex-direction: column;
  }

  #calculator-box {
    width: 100%;
  }

  #customization-panel {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    margin-top: 10px;
  }
  font-weight: 600;
  font-size: 0.95rem;
}

.course-row .grade {
  flex: 0 0 78px;
  min-width: 66px;
}

.course-row .credit {
  flex: 0 0 78px;
  min-width: 66px;
}

.course-row .weighting {
  flex: 0 0 120px;
  min-width: 88px;
}

.course-row .subject {
  flex: 1 1 120px;
  min-width: 90px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #dfe7f3;
  background: #fff;
  font-weight: 700;
  color: #0f172a;
  margin-right: 6px;
}

.course-row .removeCourseBtn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background-color: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* Buttons */
button {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

/* Remove-term (close) button */
.removeTermBtn {
  background-color: #e74c3c;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: bold;
}

.removeTermBtn:hover {
  transform: scale(1.06);
}

#toggle-grade-settings {
  background: linear-gradient(90deg,#6366f1,#3b82f6);
  color: #fff;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 10px;
}

#toggle-grade-settings.closed::after {
  content: "▼";
  float: right;
  transition: transform 0.3s ease;
}

#toggle-grade-settings::after {
  content: "▲";
  float: right;
  transition: transform 0.3s ease;
}

/* Grade Settings Panel */
#grade-settings-panel {
  background-color: #fbfdff;
  padding: 18px;
  border-radius: 10px;
  margin-top: 10px;
}

#flat-weight-inputs,
#base-grade-container,
#weighted-table-container {
  padding: 10px;
  margin-top: 10px;
  border-radius: 8px;
  background-color: #ffffff;
}

/* Primary action buttons */
.addCourseBtn,
#addTermBtn {
  background: linear-gradient(90deg,#10b981,#06b6d4);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  margin-top: 8px;
}

/* Cumulative GPA styling */
#calculator-box > h2:nth-of-type(1) {
  font-size: 1.05rem;
  color: #0f172a;
  margin-top: 18px;
}

#calculator-box p {
  font-size: 0.98rem;
  color: #0f172a;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 800px) {
  #main-container {
    flex-direction: column;
  }

  .terms-row {
    flex-direction: column;
  }

  #calculator-box {
    width: 100%;
  }
}