/* Zoomable images across the admin: hover preview (.kk-zprev), the viewer's
   zoom/rotate/info additions (.kk-lb__*, base viewer styles live in
   carpool-chat.css) and KYC document thumbnails (.kk-kyc). Prefixed so nothing
   leaks into the theme. */

/* ------------------------------------------------------------ zoomable thumb */
.kk-zoomable {
  cursor: zoom-in;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  border-radius: 4px;
}
.kk-zoomable:hover {
  box-shadow: 0 0 0 2px var(--primary-bg-color, #6259ca);
}
.kk-zoomable:focus-visible {
  outline: 2px solid var(--primary-bg-color, #6259ca);
  outline-offset: 2px;
}

/* ----------------------------------------------------------- hover preview */
.kk-zprev {
  position: fixed;
  z-index: 59000; /* below the viewer (.kk-lb is 60000), above .modal (9999) */
  pointer-events: none;
  background: #11131c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  animation: kk-zprev-in 0.14s ease-out;
}
@keyframes kk-zprev-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.kk-zprev__img {
  display: block;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
}
.kk-zprev__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 0;
  font-size: 11px;
  color: #c4c7d1;
}
.kk-zprev__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 600;
}
.kk-zprev__hint {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.8;
}

/* ------------------------------------------------------ viewer: stage + img */
.kk-lb__stage--fill {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}
.kk-lb__img--zoomable {
  /* Small originals (e.g. 200px profile photos) open big, not at natural size;
     contain keeps any aspect ratio undistorted inside that box. */
  min-height: min(60vh, 520px);
  object-fit: contain;
  transition: transform 0.18s ease-out;
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  touch-action: none;
}
.kk-lb__img--zoomable.is-zoomed {
  cursor: grab;
}
.kk-lb__img--zoomable.is-dragging {
  cursor: grabbing;
}

/* ---------------------------------------------------------- viewer: toolbar */
.kk-lb__toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 140px);
  overflow-x: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 2;
}
.kk-lb__tool {
  border: 0;
  background: transparent;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
}
.kk-lb__tool:hover:not(:disabled),
.kk-lb__tool.is-on {
  background: rgba(255, 255, 255, 0.18);
}
.kk-lb__tool:disabled {
  opacity: 0.35;
  cursor: default;
}
.kk-lb__tool:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.kk-lb__zoom {
  min-width: 46px;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.kk-lb__sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
  flex: 0 0 auto;
}
.kk-lb__close,
.kk-lb__nav {
  z-index: 2;
}
.kk-lb__bar {
  z-index: 1;
}

/* ------------------------------------------------------- viewer: info panel */
.kk-lb__info {
  position: absolute;
  top: 64px;
  right: 16px;
  bottom: 72px;
  width: 300px;
  overflow-y: auto;
  padding: 16px;
  border-radius: 10px;
  background: rgba(20, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c4c7d1;
  font-size: 12px;
  z-index: 2;
}
.kk-lb__info-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  word-break: break-word;
}
.kk-lb__info-section {
  margin: 14px 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8fa3;
}
.kk-lb__info-list {
  margin: 0;
}
.kk-lb__info-row {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.kk-lb__info-row dt {
  flex: 0 0 88px;
  font-weight: 500;
  color: #8a8fa3;
}
.kk-lb__info-row dd {
  margin: 0;
  min-width: 0;
  color: #fff;
  word-break: break-word;
}
.kk-lb__info-break {
  word-break: break-all;
}
.kk-lb__info-hint {
  margin: 14px 0 0;
  color: #8a8fa3;
  font-size: 11px;
}
/* Keep the image clear of the panel where there is room for both. */
@media (min-width: 992px) {
  .kk-lb--info .kk-lb__stage--fill {
    padding-right: 316px;
  }
  .kk-lb--info .kk-lb__nav--next {
    right: 332px;
  }
}
@media (max-width: 991.98px) {
  .kk-lb__info {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 84px;
    width: auto;
    max-height: 45vh;
  }
}
@media (max-width: 575.98px) {
  .kk-lb__toolbar {
    top: 60px;
    max-width: calc(100% - 20px);
  }
}

/* ----------------------------------------------------------- KYC thumbnails */
.kk-kyc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 6px;
  min-width: 112px;
  max-width: 176px;
  margin-bottom: 6px;
}
.kk-kyc__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}
a.kk-kyc__item:hover {
  text-decoration: none;
}
.kk-kyc__thumb {
  width: 50px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid rgba(127, 127, 127, 0.2);
}
.kk-kyc__thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #8a8fa3;
}
.kk-kyc__item.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.kk-kyc__label {
  font-size: 9.5px;
  line-height: 1.2;
  text-align: center;
  color: #8a8fa3;
  white-space: nowrap;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .kk-zprev,
  .kk-lb__img--zoomable,
  .kk-zoomable {
    animation: none;
    transition: none;
  }
}
