/*
 * Terraformer 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 graviton / queue / flight calculators.
 */

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

/* The settings panel's intrinsic width would otherwise inflate #terraformer'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. */
#terraformer 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;
}

/* Computed result fields: rendered as form-control divs, so they can carry
   neither `readonly´ nor `disabled´. They wear the `ui-state-disabled´ marker
   instead — the same marker the flight and trade calculators use — which paints
   the Bootstrap disabled-field fill and is excluded from the light-theme
   "lift editable controls" rule in common_bs.css. Note `.resource-show´ is
   shared with the two editable resources-on-hand inputs, which deliberately do
   not carry the marker. */
.ui-state-disabled {
  background-color: var(--bs-secondary-bg);
  cursor: default;
}

.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 graviton / queue calculators) */
#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;
}

/* Result sub-titles inside the expenses panel (Terraformer / Satellites / Total) */
.result-subtitle {
  font-weight: 600;
}

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