/*
 * Graviton Calculator - Bootstrap 5 Styles
 * Migrated from jQuery UI to Bootstrap 5.3.8
 * Shared pieces (.main-header, .subheader, .ui-input-margin, tooltip skin)
 * follow the same conventions as the queue / flight calculators.
 */

#graviton {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  overflow-x: auto;
}

/* The settings panel's intrinsic width would otherwise inflate #graviton's
   max-content size; width:0 removes its contribution and min-width stretches
   it back to the resolved, content-driven width. The m-1 utility adds 0.25rem
   margin per side, so subtract 0.5rem to keep the outer box within the parent. */
#general-settings-panel {
  width: 0;
  min-width: calc(100% - 0.5rem);
  box-sizing: border-box;
}

.main-header {
  width: auto;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px;
  margin: 2px;
}

.subheader {
  text-align: center;
  font-weight: 600;
  margin: 0 0 6px 0 !important;
  padding: 2px 6px;
}

#reset {
  cursor: pointer;
  z-index: 10;
  width: 30px;
  height: 30px;
  border: 1px solid #dc3545;
  border-radius: 8px;
  margin-right: 0.2rem;
}

/* Layout tables: tighten the default cell padding and align vertically. */
#graviton table td {
  padding: 2px 4px;
  vertical-align: middle;
}

/* Inputs */
.level-input {
  width: 44px;
  text-align: center;
}

/* Fits a three-digit negative temperature (e.g. -140). */
#max-planet-temp {
  width: 56px;
}

.energy-input {
  width: 54px;
  text-align: center;
}

/* Every computed readout on this page is a <div class="form-control">, which can
   carry neither `readonly´ nor `disabled´, so it wears the `ui-state-disabled´
   marker instead — the same marker the flight and trade calculators use. It gets
   the Bootstrap disabled-field fill rather than the legacy jQuery-UI fade: the
   numbers are the answer the panel exists to give, so they have to stay fully
   readable while still reading as not-editable. common_bs.css excludes the class
   from the light-theme "lift editable controls" rule, which is what keeps these
   divs on the panel tone instead of the editable one. */
.ui-state-disabled {
  background-color: var(--bs-secondary-bg);
  cursor: default;
}

/* Read-only result fields (rendered as form-control divs) */
.energy-show {
  width: 64px;
  text-align: center;
}

.resource-show {
  width: 100px;
  text-align: center;
}

.time-show {
  width: 150px;
  text-align: center;
}

.transport-show {
  width: 170px;
  text-align: center;
}

/* Warning banner (shared look with the queue calculator) */
#warning {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 20px;
  text-align: center;
  background-color: var(--bs-warning-bg-subtle);
  border: 1px solid var(--bs-warning-border-subtle);
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-in-out;
}

#warning.visible {
  opacity: 1;
  pointer-events: auto;
  display: block;
}

/* Responsive */
@media (max-width: 992px) {
  #graviton {
    max-width: 100%;
    padding: 0 10px;
  }
}
