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

body {
  font-family: "Cabin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #25344f;
  color: #E1E1E1;
  line-height: 1.6;
}

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

header {
  margin-bottom: 2rem;
  text-align: center;
}

h1 {
  font-family: "Crimson Text", serif;
  font-size: 2.5rem;
  color: #E1E1E1;
  margin-bottom: 0.5rem;
}


h2 {
  font-family: "Crimson Text", serif;
  font-size: 1.75rem;
  color: #E1E1E1;
  border-bottom: 2px solid #7b96c2;
  padding-bottom: 0.5rem;
  text-align: center;
  max-width: 550px;
  margin: 0 auto 1.5rem;
}

p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #E1E1E1;
}

header p {
    color: #E1E1E1;
}

ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  margin-bottom: 0.5rem;
}

a {
  color: #FFC107;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: #E1E1E1;
  text-decoration: underline;
}

.card {
  background: #374e73;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  border: 1px solid #7b96c2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

input, select {
  padding: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
  border: 1px solid #7b96c2;
  background-color: #25344f;
  color: #E1E1E1;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#calculator,
#inputs {
  max-width: 550px;
  margin: 0 auto;
}

input:focus {
  outline: none;
  border-color: #E1E1E1;
  box-shadow: none;
}

.invalid-input, .invalid-input:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  outline: none;
}

button {
  background-color: #7b96c2;
  color: #25344f;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  transition: background-color 0.2s ease-in-out;
}

button:hover {
  background-color: #374e73;
  color: #E1E1E1;
}

footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #7b96c2;
  color: #E1E1E1;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  .card {
    padding: 1.5rem;
  }
  .calculator-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .calculator-row input {
    width: 100%;
    flex-basis: auto;
  }
  h1 {
    font-size: 2rem;
  }
}

#output {
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  display: none;
}

#output.success {
  display: block;
  background-color: #2e5a5a;
  border: 1px solid #5cb85c;
  color: #E1E1E1;
}

#output.error {
  display: block;
  background-color: #4a2c2c;
  border: 1px solid #d9534f;
  color: #E1E1E1;
}

#output strong {
  color: #ffffff;
  font-weight: 700;
}


.grade-input-section {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #7b96c2;
  padding-bottom: 1.5rem;
}

.grade-input-section:last-of-type {
  border-bottom: none;
}

.grade-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.input-row .course-select {
  flex: 3;
  margin-bottom: 0;
}

.input-row .grade-input {
  flex: 1;
  margin-bottom: 0;
}

#calculate-rutherford-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  margin-top: 1rem;
}


#results-summary {
  margin-bottom: 2rem;
}

.results-summary-card {
  background-color: #25344f;
  border: 2px solid #7b96c2;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.total-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #5cb85c;
  margin-bottom: 0;
}

#results-details {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.grade-result-card {
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #7b96c2;
}

.grade-result-card.eligible {
  background-color: #2e5a5a;
  border-left: 5px solid #5cb85c;
}

.grade-result-card.ineligible {
  background-color: #374e73;
  border-left: 5px solid #7b96c2;
}

.grade-result-card h3 {
  margin-top: 0;
  border-bottom: 1px solid #7b96c2;
  padding-bottom: 0.5rem;
}

.result-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.grade-result-card ul {
  list-style-type: none;
  padding-left: 0;
  columns: 2;
}

.grade-result-card li {
  margin-bottom: 0.5rem;
}

/* Homepage Tool Grid Styles */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background-color: #25344f;
  border: 1px solid #7b96c2;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: #E1E1E1;
  text-decoration: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.tool-card .tool-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.tool-card h3 {
  font-family: "Crimson Text", serif;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #FFC107;
}

.tool-card p {
  font-size: 0.95rem;
  color: #E1E1E1;
  margin-bottom: 0;
  flex-grow: 1;
}

/* --- Custom Scrollbar Styles --- */
/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #7b96c2 #25344f;
}

/* For Webkit-based browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #25344f;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #7b96c2;
  border-radius: 10px;
  border: 2px solid #25344f;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #E1E1E1;
}

/* --- Improve Number Inputs --- */
/* Hide spinners on number inputs for Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide spinners on number inputs for Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

/* --- Outcome Calculator Specific Styles --- */
.calculator-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.calculator-row label {
  margin-bottom: 0; /* Override default margin */
}
.calculator-row input {
  flex-basis: 100px; /* Give a fixed base width */
  flex-grow: 0;
  flex-shrink: 0;
  width: 100px;
  margin-bottom: 0; /* Override default margin */
}