/*
 * =========================================
 *  PRIMEBRIDGE MODAL SYSTEM
 * =========================================
 *  Reusable modal dialog overlay
 *  Dark theme • Centered panel • Smooth transitions
 * =========================================
 */

/* ---------- OVERLAY ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 1;
  visibility: visible;
  padding: 1rem;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- PANEL ---------- */

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a1d24 0%, #0f1115 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transform: scale(1) translateY(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.25s ease;
}

.modal-overlay.hidden .modal-content {
  transform: scale(0.92) translateY(12px);
  opacity: 0;
}

/* ---------- HEADER ---------- */

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* ---------- CLOSE BUTTON ---------- */

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: scale(1.1);
}

.modal-close:active {
  transform: scale(0.92);
}

/* ---------- BODY ---------- */

.modal-body {
  padding: 1.25rem 1.5rem 1.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---------- UTILITY ---------- */

.hidden {
  display: none;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 540px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }

  .modal-overlay.hidden .modal-content {
    transform: scale(1) translateY(60px);
  }

  .modal-header {
    padding: 1rem 1.25rem 0.6rem;
  }

  .modal-body {
    padding: 1rem 1.25rem 1.5rem;
  }
}

/* ---------- SCROLLBAR STYLING ---------- */

.modal-content::-webkit-scrollbar {
  width: 4px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
