/* General Page Styling */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 40px;
  background: #FEF6E4;
  color: #333;
}

/* Container */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Disclaimer */
.disclaimer {
  grid-column: 1 / -1;   /* span both columns */
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  font-style: italic;
}

/* Logo */
.logo {
  max-width: 200px;
  display: block;
  margin: 0 auto 20px auto;
}

/* Heading */
h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 20px;
}

/* Form Layout */
form {
  display: grid;
  grid-template-columns: 150px 1fr; /* label + input/select */
  grid-gap: 10px 15px;
  align-items: center;
}

}

label {
  font-weight: 600;
  text-align: right;
}

input, select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

input:focus, select:focus {
  border-color: #3498db;
  outline: none;
}

/* Dropdown Styling */
#term-type {
  width: auto;
  min-width: 80px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-left: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

#term-type:hover {
  border-color: #3498db;
  background: #ecf6fd;
}

#term-type:focus {
  border-color: #3498db;
  box-shadow: 0 0 4px rgba(52,152,219,0.6);
}

/* Button Styling */
button {
  grid-column: 1 / -1;        /* span all columns */
  justify-self: center;       /* center horizontally */
  background: #3498db;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 20px;
}

button:hover {
  background: #2980b9;
}

/* Results Section */
.results, .result {
  display: none;              /* hidden until calculation */
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #2c3e50;
}

.results.show, .result.show {
  display: block;
  opacity: 1;
}

/* Charts Section */
.charts {
  display: none;              /* hidden until calculation */
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}

.charts.show {
  display: flex;
  opacity: 1;
}

.charts canvas {
  width: 600px;
  height: 600px;
  max-width: 90%;
  max-height: 90%;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
}

/* Back Link */
.back-link {
  margin: 2rem;
  display: flex;
  justify-content: center;
}

.back-link a {
  display: inline-block;
  padding: 10px 20px;
  background: #3498db;
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  transition: background 0.3s ease;
}

.back-link a:hover {
  background: #2980b9;
}

/* Responsive Fallback */
@media (max-width: 768px) {
  form {
    grid-template-columns: 1fr;
    text-align: left;
  }
  label {
    text-align: left;
  }
  .charts canvas {
    width: 100%;
    height: auto;
  }
}
