/* ============================================================
   slushycalc.com — style.css
   Bootstrap 5 base + custom overrides
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Raleway:wght@400;600;800&family=Roboto:wght@400;500;700&family=Lora:wght@600&display=swap');

/* ---- Base ---- */

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: url('background.jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* ---- Main container ---- */

.form-container {
  background-color: #fff;
  border-radius: 10px;
  max-width: 680px;
  width: 100%;
  padding: 0 2rem 2rem;
  margin: 0 auto;
}

/* ---- Header ---- */

header {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

header .the {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 0.75rem;
  margin: 0;
  color: #333;
}

header h1 {
  font-family: 'Pacifico', cursive;
  font-size: 4rem;
  font-weight: 400;
  line-height: 1;
  color: #2a9d8f;
  margin: 0 0 0.1rem;
}

header .byline {
  font-size: 0.75rem;
  color: #333;
  margin: 0 0 0.75rem;
}

header .description {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0;
}

/* ---- Section headings ---- */

.step-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #333;
  letter-spacing: 0.3px;
  margin-bottom: 0.5rem;
}

/* ---- Body text ---- */

p {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ---- Dividers ---- */

hr {
  margin: 1.75rem 0;
  border-color: #e0e0e0;
}

/* ---- Form elements ---- */

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.25rem;
}

.form-control,
.form-select {
  border-radius: 5px;
  border: 1px solid #ced4da;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #2a9d8f;
  box-shadow: 0 0 0 0.2rem rgba(42, 157, 143, 0.25);
}

.form-check-input:checked {
  background-color: #2a9d8f;
  border-color: #2a9d8f;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(42, 157, 143, 0.25);
}

.form-check {
  padding-top: 0.25rem;
}

/* ---- Ingredient rows ---- */

#ingredient-list li {
  margin-bottom: 0.75rem;
}

.ingredient-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  background-color: #f8f9fa;
}

.ingredient-row-top {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.ingredient-row-top .ingredient-name {
  flex: 1 1 auto;
  background-color: #fff;
}

.ingredient-row-top .btn-remove {
  flex: 0 0 auto;
}

.ingredient-row-bottom .input-group {
  width: 100%;
}

.ingredient-row-bottom .ingredient-quantity {
  flex: 0 0 4.5rem;
  max-width: 4.5rem;
  background-color: #fff;
}

.ingredient-row-bottom .ingredient-unit {
  flex: 1 1 auto;
  min-width: 0;
  background-color: #fff;
}

.ingredient-row-bottom .ingredient-abv {
  flex: 0 0 4.5rem;
  max-width: 4.5rem;
  background-color: #fff;
}

/* ---- Optional sections ---- */

#optional-steps {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 1.75rem 1rem 1.5rem 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
}

#optional-steps section + section {
  margin-top: 0;
}

.btn-primary {
  background-color: #2a9d8f;
  border-color: #2a9d8f;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #21867a;
  border-color: #21867a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn-secondary {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #333;
  font-size: 0.875rem;
}

.btn-secondary:hover {
  background-color: #dee2e6;
  color: #333;
}

#calculate-btn {
  margin-top: 0.5rem;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ---- Error alert ---- */

.alert-danger {
  font-size: 0.875rem;
}

/* ---- Results ---- */

#results {
  padding-top: 2rem;
}

.results-title {
  font-family: 'Pacifico', cursive;
  font-size: 2rem;
  font-weight: 400;
  color: #2a9d8f;
  margin-bottom: 0.25rem;
}

.results-subtitle {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.results-section-heading {
  font-family: 'Raleway', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.additions-heading {
  color: #2a9d8f;
  border-bottom-color: #2a9d8f;
}

.results-ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

.results-ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.results-ingredient-item:last-child {
  border-bottom: none;
}

.ing-name {
  font-weight: 600;
  color: #222;
  padding-right: 1rem;
}

.results-ingredient-addition .ing-name {
  color: #2a9d8f;
}

.ing-amount {
  font-size: 0.875rem;
  color: #666;
  white-space: nowrap;
}

.results-notes-text {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0;
}

/* Machine note */
.machine-note {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.machine-note .fa-snowflake {
  color: #2a9d8f;
  margin-right: 0.3rem;
}

/* ---- Links ---- */

a {
  color: #2a9d8f;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Footer ---- */

footer {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  padding-top: 1rem;
}

footer p {
  font-size: 0.75rem;
  color: #888;
}

#url-display {
  display: none;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 767px) {

  body {
    padding: 0.5rem 0;
  }

  .form-container {
    border-radius: 8px;
    padding: 0 1rem 1.5rem;
    margin: 0.75rem;
    max-width: 100%;
  }

  header h1 {
    font-size: 2.75rem;
  }

  .step-title {
    font-size: 1.1rem;
  }

  /* Stack ingredient rows on mobile */
  .ingredient-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .ingredient-name {
    flex: 1 1 100%;
  }

  .ingredient-quantity {
    flex: 1 1 calc(33% - 0.4rem);
  }

  .ingredient-unit {
    flex: 1 1 calc(33% - 0.4rem);
  }

  .ingredient-abv-group {
    flex: 1 1 calc(33% - 0.4rem);
  }

  .btn-remove {
    flex: 0 0 auto;
    align-self: flex-end;
  }

  .result-value {
    font-size: 1.4rem;
  }

  #calculate-btn {
    font-size: 1rem;
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {

  html, body {
    background: none !important;
    display: block;
    padding: 0;
    margin: 0;
    height: 100%;
  }

  .form-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: none !important;
    background: none !important;
    border-radius: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Hide all input sections and interactive elements */
  #section-name,
  #section-ingredients,
  #section-brix,
  #section-syrup,
  #section-volume,
  #optional-steps,
  #calculate-btn,
  #error-alert,
  button,
  hr {
    display: none !important;
  }

  /* Show only header, results, footer */
  header,
  #results,
  footer {
    display: block !important;
  }

  header {
    flex: 0 1 auto;
    text-align: left;
    padding: 0;
    margin-top: 0;
    padding-top: 0;
  }

  header h1 {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: #000;
    text-align: left;
  }

  header .the {
    text-align: left;
    font-size: 0.7rem;
    margin: 0;
  }

  header .byline {
    text-align: left;
    font-weight: bold;
    margin: 0;
  }

  header .description {
    display: none;
  }

  #url-display {
    display: inline;
  }

  /* Two-column results layout for print */
  .results-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: 2rem;
    align-items: flex-start;
  }

  .results-col-original {
    flex: 0 0 30%;
  }

  .results-col-scaled {
    flex: 1 1 auto;
  }

  /* Results */
  #results {
    flex: 0 1 auto;
    padding-top: 1.5rem;
    margin-top: 0;
  }

  .results-title {
    font-family: 'Lora', serif;
    font-size: 2.25rem;
    color: #000;
    margin-bottom: 0.1rem;
  }

  header h1 {
    color: #2a9d8f;
  }

  .results-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 1.25rem;
  }

  .results-section-heading {
    font-family: 'Raleway', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    border-bottom: 3px solid #000;
    padding-bottom: 3px;
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
  }

  .additions-heading {
    color: #000;
    border-bottom-color: #000;
  }

  .results-ingredient-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .results-ingredient-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: none;
    font-size: 0.85rem;
  }

  .ing-name {
    font-weight: 600;
    color: #000;
  }

  .results-ingredient-addition .ing-name {
    color: #000;
  }

  .ing-amount {
    color: #000;
    font-size: 0.85rem;
  }

  .results-notes-text {
    font-size: 0.85rem;
    color: #000;
  }

  .machine-note {
    font-size: 0.75rem;
    font-style: italic;
    color: #555;
    text-align: left;
    margin-top: 1rem;
  }

  /* Footer */
  footer {
    font-size: 0.7rem;
    color: #555;
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: 1rem;
    text-align: center;
  }

  footer p {
    font-size: 0.7rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  /* Suppress shadows, borders, backgrounds globally */
  * {
    box-shadow: none !important;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  .form-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .form-container > *:not(header):not(#results):not(footer) {
    display: none !important;
  }
}
