/* General Styles */
body {
  background: linear-gradient(120deg, #334155, #475569 60%, #64748b);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Calculator Container */
#descriptive-calculator {
  font-family: "Playfair Display", serif;
  color: #1e293b;
  max-width: 960px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 40px;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9 80%);
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Heading */
#descriptive-calculator h2 {
  text-align: center;
  color: #1e293b;
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

#descriptive-calculator p {
  text-align: center;
  color: #64748b;
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
}

/* Input Group */
#descriptive-calculator > div {
  max-width: 100%;
  margin-bottom: 25px;
}

#descriptive-calculator label {
  font-weight: bold;
  display: block;
  margin: 12px 0 6px;
  color: #1e293b;
  font-size: 1.2rem;
}

#descriptive-calculator input {
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  margin-bottom: 10px;
  box-sizing: border-box;
  background: #ffffff;
  transition: all 0.3s ease;
}

#descriptive-calculator input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.25);
  background: #f8fafc;
  outline: none;
}

#descriptive-calculator small {
  display: block;
  margin-top: -6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #64748b;
}

/* Buttons */
#descriptive-calculator .buttons {
  display: flex;
  gap: 20px;
  margin-top: 25px;
  max-width: 100%;
}

#descriptive-calculator #calculate-stats,
#descriptive-calculator #clear-stats {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 8px;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  cursor: pointer;
  background: #0ea5e9;
  color: white;
  transition: all 0.3s ease;
}

#descriptive-calculator #calculate-stats:hover,
#descriptive-calculator #clear-stats:hover {
  background: #0284c7;
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Results Section */
#descriptive-calculator #results {
  margin-top: 40px;
  padding: 30px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #d1d9e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

#descriptive-calculator #results h3 {
  color: #1e293b;
  font-size: 1.8rem;
  margin-bottom: 25px;
  border-bottom: 3px solid #0ea5e9;
  padding-bottom: 10px;
}

#descriptive-calculator #results p {
  text-align: left;
  margin: 15px 0;
  color: #334155;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mean Visualization */
#descriptive-calculator #results p:has(#mean-result) {
  position: relative;
  padding-left: 30px;
}

#descriptive-calculator #results p:has(#mean-result)::before {
  content: "μ";
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  background: #0ea5e9;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#descriptive-calculator #results span {
  color: #0ea5e9;
  font-weight: bold;
}

/* Larger Graph */
#descriptive-calculator #results canvas {
  margin: 40px auto 30px;
  display: block;
  width: 100% !important;
  max-width: 900px;
  height: 450px !important;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Enhanced Explanation Section */
#descriptive-calculator #explanation {
  margin-top: 35px;
}

#descriptive-calculator #explanation h4 {
  color: #1e293b;
  font-size: 1.5rem;
  margin-bottom: 25px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0ea5e9;
  letter-spacing: 0.5px;
}

#descriptive-calculator #explanation div {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #d1d9e6;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  max-width: 100%;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #475569;
}

/* Style explanation paragraphs as boxed steps */
#descriptive-calculator #explanation div p {
  margin: 15px 0;
  padding: 15px;
  position: relative;
  background: #f8fafc;
  border: 2px solid #0ea5e9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

/* Create a heading container for "Step X: Compute the [Stat]" */
#descriptive-calculator #explanation div p strong:first-child,
#descriptive-calculator #explanation div p strong:nth-child(2),
#descriptive-calculator #explanation div p strong:first-child + text {
  display: inline;
  white-space: nowrap; /* Keep heading on one line */
  color: #1e293b;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 5px 10px;
  background: rgba(14, 165, 233, 0.2);
  border-radius: 4px;
  margin-bottom: 10px;
  width: fit-content;
}

/* Remove line breaks and flow text */
#descriptive-calculator #explanation div p br {
  display: inline; /* Prevent line breaks */
  content: " "; /* Replace with a space */
}

/* Style details to flow continuously */
#descriptive-calculator #explanation div p > *:not(strong) {
  margin-left: 10px; /* Indent details */
  display: inline; /* Flow text */
}

/* Numbering for steps */
#descriptive-calculator #explanation div p::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 15px;
  top: 15px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Reset counter */
#descriptive-calculator #explanation div {
  counter-reset: step;
}

/* Ensure text wraps and aligns properly */
#descriptive-calculator #explanation div p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Adjust for long text (e.g., Variance step) */
#descriptive-calculator #explanation div p:nth-child(5) {
  padding-bottom: 20px; /* Extra space for long equations */
}
.navbar {
  background-color: #000;
  width: calc(100% - 2rem); /* w-96 equivalent */
  color: #fff;
  margin-bottom: 1rem; /* m-4 equivalent */
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Arial, sans-serif;
  border-radius: 7px;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #ddd;
}

.nav-link.active {
  color: #379f51; /* Gold color for active link */
  font-weight: bold;
}

/* Optional: Style for your calculator cards if you want to keep them consistent */
.calculator-selection {
  margin: 1rem;
}
