/* Appraisals Show Page Styles */

.action-bar {
  background-color: var(--steel-900) !important;
  border-bottom: 1px solid var(--steel-700);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  padding-top: 1.5rem !important;
}

.action-bar-below-nav {
  top: 68px;
  z-index: 1020;
}

@media (max-width: 575.98px) {
  .action-bar-below-nav {
    top: 50px;
  }
}

/* Show page action bar buttons */
.show-action-bar-buttons {
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--steel-600) transparent;
}

.show-action-bar-buttons .btn {
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 575.98px) {
  .show-action-bar-buttons {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
}

.action-bar-buttons {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--steel-600) transparent;
  white-space: nowrap;
  justify-content: center;
}

.action-bar-buttons .btn {
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .action-bar-buttons {
    justify-content: flex-start;
    padding-bottom: 4px;
  }
}

.detail-section {
  background-color: var(--steel-850);
  border: 1px solid var(--steel-700);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-row {
  display: flex;
  margin-bottom: 0.5rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  flex: 0 0 250px;
  font-weight: 600;
  color: var(--steel-300);
  padding-right: 1rem;
}

.detail-value {
  flex: 1;
  color: var(--steel-100);
}

@media (max-width: 575.98px) {
  .detail-section {
    padding: 1rem;
  }

  .detail-row {
    flex-direction: column;
    margin-bottom: 0.75rem;
  }

  .detail-label {
    flex: none;
    padding-right: 0;
    margin-bottom: 0.125rem;
  }
}

.equipment-content {
  max-height: 200px;
  min-height: 50px;
  overflow-y: auto;
  resize: vertical;
  color: var(--steel-200);
  line-height: 1.6;
}

.chart-wrapper {
  background-color: white;
  border-radius: var(--radius-md);
  display: inline-block;
}

.chart-image {
  max-width: 300px;
}

.gallery-image {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  background-color: white;
  border-radius: var(--radius-md);
}

.image-item {
  width: 200px;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
}

.image-item:hover {
  transform: scale(1.02);
}

.image-actions {
  align-items: stretch;
}

.image-actions > form {
  display: flex;
  align-items: stretch;
}

.image-actions > form > .btn {
  height: 100%;
}

.drag-handle {
  cursor: grab;
  color: var(--steel-400);
  font-size: 1.25rem;
  transition: color var(--transition-base);
}

.drag-handle:hover {
  color: var(--steel-100);
}

.sortable-ghost {
  opacity: 0.3;
}

.sortable-chosen {
  cursor: grabbing;
}

.sortable-drag {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-row-discarded {
  opacity: 0.55;
}

/* Sortable table headers */
th .sort-link {
  color: inherit;
  text-decoration: none;
}

th .sort-link:hover {
  text-decoration: underline;
}

th .sort-link .bi {
  font-size: 0.75em;
  white-space: nowrap;
}

.appraisals-page-header {
  gap: 1.5rem;
}

.appraisals-header-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.appraisals-header-search {
  flex: 1 1 28rem;
  min-width: 0;
}

.appraisals-search-form {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .appraisals-header-main {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .appraisals-header-search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
}

/* Hide native browser clear button on search inputs (we use a custom one) */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Fix button_to form breaking btn-group border-radius */
.table .btn-group form .btn {
  border-radius: 0;
}

/* Tooltips — light background, dark text */
.tooltip .tooltip-inner {
  background-color: #ffffff;
  color: #212529;
  border: 1px solid #dee2e6;
  max-width: 400px;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #dee2e6;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #dee2e6;
}

/* Formula image tooltips */
.tooltip.formula-tooltip .tooltip-inner {
  max-width: none;
  padding: 8px 12px;
}

.tooltip.formula-tooltip .tooltip-inner img {
  display: block;
  zoom: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   Wide-screen table breakout
   On large screens, let data-heavy show tables expand beyond the
   parent .container so users with wide monitors don't have to scroll.
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  .comparable-vehicles-container,
  .extra-equipment-items-container,
  .technical-groups-container {
    width: calc(100vw - 4rem);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }

  .comparable-vehicles-container {
    max-width: 1940px;
  }

  .extra-equipment-items-container {
    max-width: 1050px;
  }

  .technical-groups-container {
    max-width: 1534px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Light Theme — Appraisal Overrides
   ═══════════════════════════════════════════════════════════════════ */
[data-theme="light"] .action-bar {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
