/*
 * 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;
}

/* 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;
}

/* Tooltips (shared look with the costs / queue calculators) */
.tooltip-inner {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  max-width: 250px;
  text-align: left;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--bs-border-color);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: var(--bs-border-color);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: var(--bs-border-color);
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: var(--bs-border-color);
}

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