﻿.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
}

.ui-modal[hidden] {
  display: none;
}

.ui-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 12, 0.72);
  backdrop-filter: blur(2px);
}

.ui-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(30, 43, 37, 0.98), rgba(21, 31, 26, 0.98));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: uiModalIn 160ms ease-out;
}

.ui-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ui-modal-close:hover {
  border-color: rgba(62, 207, 142, 0.56);
  color: #f4f8ff;
}

.ui-modal-body {
  padding: 20px;
}

.image-modal-body {
  min-height: 320px;
  max-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.image-modal-body img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
}

@keyframes uiModalIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
