/* Overrides on top of Bootstrap / admin.css */

.form-signin input[type="text"] {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.htmx-indicator {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.65rem;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-panel-wrap {
  position: relative;
  min-height: 6rem;
}

.list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}

.list-filters > .list-filter {
  flex: 1 1 6.5rem;
  min-width: 6.5rem;
  max-width: 100%;
}

.list-filters > .list-filter .form-select,
.list-filters > .list-filter .form-control {
  min-width: 0;
  max-width: 100%;
}

.list-filters > .list-filter-actions {
  flex: 0 0 auto;
}

.htmx-indicator--overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: auto;
  height: auto;
  margin-bottom: 0;
  background: color-mix(in srgb, var(--bs-body-bg, #fff) 72%, transparent);
}

[data-bs-theme="dark"] .htmx-indicator--overlay {
  background: color-mix(in srgb, var(--bs-body-bg, #212529) 78%, transparent);
}

.table-sort-link--active {
  font-weight: 600;
}

.table-sort-link--active::after {
  display: inline-block;
  margin-left: 0.25rem;
  font-family: "bootstrap-icons" !important;
  font-size: 0.75em;
  line-height: 1;
  opacity: 0.9;
  font-style: normal;
  font-weight: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.table-sort-link--asc::after {
  content: "\f235";
}

.table-sort-link--desc::after {
  content: "\f229";
}

.event-payload {
  max-height: 28rem;
  overflow: auto;
  font-size: 0.8125rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-top: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .event-payload {
  background: var(--bs-tertiary-bg, #2b3035);
}

/* Match .events-map height on imagery request detail; scroll long JSON inside the panel. */
.imagery-vendor-payload {
  display: block;
  box-sizing: border-box;
  height: min(70vh, 40rem);
  min-height: 22rem;
  margin: 0;
  overflow: auto;
  font-size: 0.8125rem;
  white-space: pre;
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-top: 1px solid var(--bs-border-color);
}

.imagery-vendor-payload code {
  display: block;
}

[data-bs-theme="dark"] .imagery-vendor-payload {
  background: var(--bs-tertiary-bg, #2b3035);
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: htmx-spinner 0.65s linear infinite;
}

@keyframes htmx-spinner {
  to {
    transform: rotate(360deg);
  }
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--bs-box-shadow);
}

.toast-ok {
  border-color: var(--bs-success);
}

.toast-error {
  border-color: var(--bs-danger);
}

.toast-out {
  opacity: 0;
  transition: opacity 200ms ease;
}

.toast-dismiss {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.imagery-aoi-map {
  min-height: 320px;
}

.card > .card-body.p-0 > .imagery-aoi-map.events-map {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.events-map {
  width: 100%;
  height: min(70vh, 40rem);
  min-height: 22rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--bs-border-radius, 0.375rem);
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: var(--bs-secondary-bg, #e9ecef);
}

.events-map .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}

.events-map-legend-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: -0.1em;
}

.events-map-legend-dot--hot {
  background: #dc3545;
}

.events-map-legend-dot--warm {
  background: #fd7e14;
}

.events-map-legend-dot--mid {
  background: #ffc107;
}

.events-map-legend-dot--cool {
  background: #0d6efd;
}

.events-map-legend-dot--muted {
  background: #6c757d;
}

.events-map-legend-ring {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid #495057;
  border-radius: 50%;
  background: #f8f9fa;
  margin-right: 0.25rem;
  vertical-align: -0.15em;
}
