/* Lightweight project overrides (Bootstrap 5 compatible) */

.nav-tabs .nav-link {
    color: #205493;
}

.nav-tabs {
  background-color: #e6e6e6;
  background-image: linear-gradient(#fafafa, #e6e6e6);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Ensure nav-pills nav-links keep white text and have a hover background */
.nav.nav-pills .nav-link {
  color: #ffffff;
  background-color: #205493;
}

.nav.nav-pills .nav-link:hover,
.nav.nav-pills .nav-link:focus {
  color: #ffffff;
  background-color: color-mix(in srgb, #205493 85%, black);
}

/* Viewer + toolbar layout */
.card-body.d-flex.flex-column {
  /* Bootstrap 5 already uses .d-flex and .flex-column; ensure gap available */
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  gap: 0.5rem;
  align-items: stretch;
}

#viewer-container,
.viewer-container {
  display: flex;
  flex: 1 1 auto;
  min-height: 250px;
  align-items: stretch;
  justify-content: center;
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}

.viewer-inner,
.h-100.w-100 {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

/* Image toolbar and icon buttons */
.img-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 0.5rem;
  margin-top: auto;
  flex: 0 0 auto;
}

/* Use btn classes for consistent sizing; keep btn-icon as small utility */
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  transition: background-color .12s ease, transform .06s ease, border-color .12s ease;
}

.btn-icon:hover {
  background: #f1f3f5;
  border-color: #e2e6ea;
}

.btn-icon:active {
  transform: translateY(1px);
}

.btn-icon i {
  width: 20px;
  height: 20px;
  color: #333;
  display: inline-block;
  line-height: 1;
  font-size: 1rem;
}

/* Accessibility helper: Bootstrap 5 prefers .visually-hidden */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Optional: small responsive tweak */
@media (max-width: 576px) {
  .img-toolbar { gap: 0.35rem; margin-left: 0.25rem; }
  .btn-icon { width: 34px; height: 34px; }
}