/* ===============  CG calculator  ====================== */

/* === Page Container === */
.cg-container {
  display: flex;
  max-width: 1600px;
  margin: 25px auto;
  padding: 2rem;
  gap: 2rem;
}

/* === Heading === */
.cg-heading {
  padding: 25px 0;
  text-align: center;
}

/* === Form Panel === */
.cg-form {
  background-color: rgba(173, 216, 230, 0.3);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow-light);
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  max-width: 65%;
}

.cg-form h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  width: 100%;
}

.cg-form label {
  font-weight: 600;
  color: var(--text-dark);
}

.cg-form input[type='number'],
.cg-form input[type='text'],
.cg-form select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}
.unit-dropdown-container {
  width: 100%;
}
.cg-form .unit-switchers {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.cg-form p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -0.25rem 0 0.5rem;
}

/* === Fraction Converter === */
.fraction-converter {
  background-color: #fff;
  padding: 1rem;
  /* border-left: 4px solid var(--primary-color); */
  border-radius: 8px;
  width: 100%;
}
.fraction-converter input {
  background-color: #fff;
  padding: 1rem;
  border: 1px solid lightgray;
  /* border-left: 4px solid var(--primary-color); */
  border-radius: 8px;
  /* width: 100%; */
}

.fraction-converter h4 {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.fraction-result {
  font-size: 1rem;
  font-weight: bold;
  color: #2c3e50;
  margin-top: 0.5rem;
}

/* === Visual Wrapper === */
.image-plane-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1000px;
  padding: 1.5rem;
  background: #fff;
  width: 100%;
}

.image-plane {
  width: 100%;
  /* max-width: 350px; */
  height: auto;
  transition: transform 0.5s ease;
  transform-origin: center center;
}

.cg-visual-wrapper {
  position: relative;
  display: flex;
  /* border-left: 4px solid var(--primary-color); */
  border-radius: 8px;
  max-width: 400px;
  margin: 25px auto;
}
.cg-distance {
  display: flex;
  justify-content: center;
  align-items: start;
  flex-direction: column;
  width: 100%;
}
.cg-distance p {
  padding: 0;
  margin: 0;
}
.cg-limits {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%;
}
.cg-limits-col {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.5rem;
  width: 100%;
}
.cg-limits-col input {
  width: 50%;
}
.cg-visual-wrapper svg text {
  font-size: 35px;
  font-weight: 600;
  fill: black;
}

#cgOverlaySVG {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* === Results and Tips === */
.results-wrapper {
  text-align: center;
  font-size: 1rem;
}

.weight-tip {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  background-color: #fff3cd;
  padding: 0.75rem 1rem;
  border-left: 4px solid #ffc107;
  border-radius: 6px;
  text-align: center;
  max-width: 1200px;
  margin: 25px auto;
}

#balanceStatus {
  transition: opacity 0.3s ease-in-out;
}

.cg-balanced {
  color: green;
  font-weight: bold;
  font-size: 2rem;
}

.cg-warning {
  color: goldenrod;
  font-weight: bold;
  font-size: 2rem;
}

.cg-unbalanced {
  color: red;
  font-weight: bold;
  font-size: 1rem;
}

/* === User Guide === */
.cg-user-guide {
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow-light);
  display: flex;
  flex-direction: column;

  gap: 2rem;
}

.cg-key,
.cg-user-guide-list {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  flex: 1;
  /* border-left: 4px solid var(--primary-color); */
}

.cg-key {
  /* border-left: 4px solid var(--primary-color); */
  min-width: 250px;
}
.cg-key h4 {
  padding: 4px;
  margin-bottom: 7px;
  /* border-bottom: 2px solid var(--primary-color); */
  min-width: 250px;
}

.cg-key ul {
  list-style: none;
  padding-left: 0;
}

.cg-key ul li {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cg-key ul li strong {
  color: var(--primary-color);
}

.cg-user-guide-list h5 {
  font-size: 1.2rem;
  color: var(--text-dark);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}

.cg-user-guide-list ol {
  padding-left: 1.2rem;
}

.cg-user-guide-list li {
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.cg-user-guide-need {
  margin: 0.5rem 0;
  padding-left: 1rem;
  list-style-type: disc;
  color: #555;
}

.cg-user-guide-need li {
  margin-bottom: 0.25rem;
}
/* === Responsive === */
@media screen and (max-width: 968px) {
  .cg-form,
  .image-plane-wrapper {
    max-width: 100%;
  }
  .cg-container {
    flex-direction: column;
  }
}
