/* Import modern font */
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap");

/* Reset and Base Styles */
:root {
  font-size: 18px;
}

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

body {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8fafc;
  color: #475569;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
}

/* Base Typography */


h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: .5rem;
}

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

/* Explanation Section */
.explanation {
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: rem 0;
  margin-bottom: .5rem;
}

.explanation-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

explanation-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.explanation-content p {
  margin-bottom: .4rem;
  font-size: 1rem;
}

.explanation ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  padding-left: 0;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
  margin-top: 0.5rem;
}

.explanation li {
  margin-bottom: 0.5rem;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
}

.explanation ul > li:first-child {
  margin-top: 0;
}

.explanation ul > li:last-child {
  margin-bottom: 0;
}

/* Links */
.elegant-link {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.elegant-link:hover {
  border-color: #2563eb;
}

/* Input Section */
.input-pane {
  background-color: #fff;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  height: fit-content;
}

.input-group {
  margin-bottom: .8rem;
}

.input-group label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0rem;
}

input[type="number"] {
  width: 6ch;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background-color: #fff;
  text-align: center;
}

input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="number"]:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
}

/* Form Elements - Base Styles */
input[type="number"],
select,
.custom-input {
  padding: 0.3rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background-color: #fff;
}

/* Specific widths for different input types */
input[type="number"] {
  width: 6ch;
  text-align: center;
}

select {
  width: auto;
  min-width: 10px;
}

.custom-input {
  width: 200px;
  text-align: left;
  margin-left: 0.5rem;
}

/* Form Elements - States */
input[type="number"]:focus,
select:focus,
.custom-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="number"]:disabled,
select:disabled,
.custom-input:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
}

/* Flex container for measurement type */
.flex-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
button {
  width: 100%;
  padding: 0.875rem;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover:not(:disabled) {
  background-color: #1d4ed8;
}

button:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* Cards */
.card {
  max-width: 800px;
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  margin-bottom: 1.5rem;
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0rem;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.card-content li {
  margin-bottom: 0.5rem;
  color: #475569;
}

.card-content p {
  color: #475569;
  margin-bottom: 1rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
  font-size: 1rem;
}

th {
  background-color: #f8fafc;
  font-weight: 500;
  color: #475569;
}

td {
  color: #1e293b;
}

/* Plot Container */
.plot-container {
  width: 100%;
  min-height: 400px;
  height: 100%;
  margin-top: 1.5rem;
}

/* Summary Stats */
.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stat-item {
  padding: 1rem;
  background-color: #f8fafc;
  border-radius: 0.5rem;
  color: #475569;
  font-size: 0.925rem;
}

.stat-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-group ul {
  margin-left: 1.5rem;
  color: #475569;
}

.stat-group li {
  margin-bottom: 0.5rem;
}

/* Error Messages */
.error-message {
  color: #dc2626;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background-color: #fff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 1rem;
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 1rem;
  }

  .explanation-content {
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .explanation-content {
    padding: 0 1rem;
  }

  .plot-container {
    min-height: 300px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .explanation-content p {
    font-size: 1rem;
  }

  .size-inputs {
    flex-wrap: wrap;
  }
}