/* Base Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 2rem;
    background-color: #f0f2f5;
    color: #333;
    box-sizing: border-box;
  }
  
  /* Logo */
  .logo {
    display: block;
    max-width: 200px;
    margin: 0 auto 1rem auto;
  }
  
  /* Container */
  .container {
    background: #ffffff;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    margin: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
  }
  
  /* Headings */
  h2 {
    text-align: center;
    color: #00478f;
    margin-bottom: 1.5rem;
  }
  
  /* Form Layout */
  .form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }
  
  .form-group label {
    flex: 1 0 100%;
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  
  /* Inline layout for rows of inputs */
  .form-group.inline {
    flex-wrap: nowrap;
    gap: 1rem;
  }
  
  .form-group.inline input,
  .form-group.inline select {
    flex: 1;
    min-width: 0;
  }
  
  /* Inputs & Selects */
  .form-group input,
  .form-group select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
  }
  
  /* Highlighted on focus */
  input.focused,
  input:focus,
  select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    background-color: #eef5ff;
  }
  
  /* Button */
  button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  button:hover {
    background: #0056b3;
  }
  
  /* Output */
  .output {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e6f4ff;
    border: 1px solid #b3dcff;
    border-radius: 4px;
    font-size: 1.2rem;
    text-align: center;
    color: #00478f;
    font-weight: 600;
  }
  
  /* Notes and tips */
  .note {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
    margin-top: -0.25rem;
  }
  
  /* Checkbox label */
  .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  
  .checkbox-group input[type="checkbox"] {
    margin: 0;
    align-self: flex-start;
  }
  
  
  
  /* Bond Tooltip */
  #bond-tooltip {
    font-size: 0.8rem;
    max-width: 90vw;
    white-space: normal;
  }
  
  /* Responsive adjustments */
  @media (max-width: 600px) {
    body {
      padding: 1rem;
    }
  
    .container {
      padding: 1rem;
    }
  
    .form-group.inline {
      flex-wrap: wrap;
    }
  
    .form-group.inline input,
.form-group.inline select {
  flex: 0 0 35%;
  min-width: 0;
}

  
    .note {
      font-size: 0.8rem;
    }
  
    .output {
      font-size: 1rem;
    }
  }

  .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: flex-start;
  }
  
  .checkbox-wrapper input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2); /* optional: makes the box easier to click */
  }
  
  .checkbox-label {
    font-weight: 600;
    margin: 0;
  }

 /* Lens Circle */
 .lens-image-wrapper {
    width: 60px;
    height: 60px;
    margin-left: 10px;
    display: inline-block;
  }
  
  #lensImage {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    transform: rotate(0deg);
    transition: transform 0.3s ease-in-out;
    display: block;
  }

  #lens-visual-img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease-in-out;
    transform: rotate(270deg); /* Set baseline to 6 o'clock */
  }
  
  #lens-visual-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    width: auto;
    height: auto;
    max-width: 50px;
    max-height: 50px;
    flex-shrink: 0;
}

#lens-visual-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: rotate(0deg); /* JS updates this */
    transition: transform 0.3s ease-in-out;
}

/* PATCH for vertex distance inline issue */
#vertexDistance {
    flex: 0 0 auto !important;
    width: 80px !important;
    max-width: 80px !important;
    text-align: center;
    font-size: 1rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    box-shadow: none;
}

.form-group.inline label[for="vertexDistance"] {
    flex: 0 0 auto !important;
    margin-right: 10px;
}

/* Remove number input spinners for vertex distance box */
#vertexDistance::-webkit-outer-spin-button,
#vertexDistance::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#vertexDistance {
    -moz-appearance: textfield; /* Firefox */
}

#vertexDistance::placeholder {
    color: #aaa;
    opacity: 1;
}



.form-group label[for="rotation"] {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Tighten up spacing ONLY for the lens rotation block */
.form-group#rotation-group {
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Make vertex notice more subtle */
#output em {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Simple + perfect version */
#output em,
#output em ~ * {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
}

.vertex-values {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
}



/* FINAL ULTRA-COMPACT VERTEX BLOCK */
#output em,
.vertex-values {
    display: inline;
    font-size: 0.75rem;
    color: #666;
    font-weight: normal;
    line-height: 1;
    margin: 0;
    padding: 0;
}

#output br {
    display: none; /* remove the leftover <br> spacing */
}

/* Ultra-compact vertex block style */
.vertex-block {
    display: block;
    font-size: 0.75rem;
    color: #666;
    font-weight: normal;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

/* Transpose note style */
#output .transpose-note {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

/* ================================ */
/* AccuLens Calculator - Final Polish */
/* ================================ */

/* Smooth button hover lift */
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: 0.2s ease;
}

/* Subtle card shadow on main calculator box */
#calculator {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

/* Input field focus highlighting */
input:focus, select:focus {
    outline: none;
    border-color: #1e90ff;
    box-shadow: 0 0 5px rgba(30, 144, 255, 0.5);
}

/* Reduce spacing between form rows slightly */
form > div {
    margin-bottom: 0.75rem;
}

/* Softer info text for transpose notification */
#output .transpose-note {
    color: #888;
}

/* Modern professional font stack */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}
