/* cement-mix-calculator.css */

#cement-mix-tool {
  max-width: 740px;
  margin: 40px auto;
  padding: 30px;
  background: #f7fafd;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  font-family: 'Segoe UI', sans-serif;
  color: #1f1f1f;
}

#cement-mix-tool h1 {
  text-align: center;
  font-size: 30px;
  margin-bottom: 30px;
  color: #084c8d;
}

fieldset {
  margin: 30px 0;
  padding: 22px 26px;
  border: 1px solid #d3e1ef;
  border-radius: 10px;
  background: #ffffff;
}

legend {
  font-weight: bold;
  padding: 0 12px;
  color: #084c8d;
  font-size: 18px;
}

.form-row {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-row label {
  flex: 1 1 220px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-row input,
.form-row select {
  flex: 2 1 280px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  transition: border 0.3s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #007acc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

input[readonly] {
  background: #e9ecef;
}

.unit-select {
  max-width: 170px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

button[type="submit"] {
  background: #007acc;
  color: #fff;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  display: block;
  margin: 20px auto 0;
}

button[type="submit"]:hover {
  background: #005f9e;
}

.preset-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.preset-wrapper button {
  padding: 6px 12px;
  background: #e6f0fa;
  border: 1px solid #007acc;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.preset-wrapper button:hover {
  background: #d2e3f4;
  border-color: #005b9f;
}

.preset-wrapper button.active {
  background: #007acc;
  color: #fff;
  border-color: #005b9f;
}

#concrete-ratio-options,
#mortar-ratio-options {
  margin-top: 10px;
}

#concrete-ratio-select,
#mortar-ratio-select,
#custom-ratio-value {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  max-width: 300px;
  margin-top: 6px;
}

#custom-ratio-value:focus {
  border-color: #007acc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.results {
  margin-top: 30px;
}

.result-box {
  background: #eaf4fd;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid #007acc;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.6;
}

.result-box.summary {
  background: #dceffd;
  border-left-color: #005f9e;
  font-weight: 500;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row label,
  .form-row input,
  .form-row select {
    flex: 1 1 100%;
  }

  .unit-select {
    margin-left: 0;
  }
}

/* ---------------------- */
/* ENHANCED TOOLTIP STYLE */
/* ---------------------- */

.info-tooltip {
  position: relative;
  display: inline-block;
  font-weight: bold;
  background: #007acc;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 13px;
  text-align: center;
  line-height: 18px;
  margin-left: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.info-tooltip:hover,
.info-tooltip.active {
  background: #005b9f;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 260px;
  background-color: #1b3e6f;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 10px 12px;
  position: absolute;
  z-index: 99;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-tooltip:hover .tooltip-text,
.info-tooltip.active .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #1b3e6f transparent transparent transparent;
}

@media (max-width: 600px) {
  .tooltip-text {
    width: 90vw;
    left: 5%;
    transform: none;
  }

  .tooltip-text::after {
    left: 20px;
    margin-left: 0;
  }
}