/* ===============================
   Modern Modal Override
================================ */

.modal {
  backdrop-filter: blur(4px);
}

.modal-backdrop.show {
  opacity: 0.45;
}

.modal-dialog {
  width: auto;
  height: auto;
  max-width: 960px;
  margin: 1.75rem auto;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 3.5rem);
}

.modal-content {
  width: 100%;
  margin: auto;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #eef2f7;
}

.modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}

.modal-header .close,
.modal-header button.close {
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  opacity: 1;
  text-shadow: none;
  transition: all 0.18s ease;
}

.modal-header .close:hover,
.modal-header button.close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  background: #ffffff;
}

.modal-footer {
  padding: 0.75rem 1rem !important;
  background: #ffffff;
  border-top: 1px solid #eef2f7;
}

/* Full modal */
.modal-dialog.modal-dialog-full {
  width: 100vw;
  max-width: 100vw !important;
  height: 100vh;
  margin: 0 !important;
  display: flex;
  align-items: stretch;
}

.modal-dialog.modal-dialog-full .modal-content,
.modal-content-full {
  width: 100% !important;
  height: 100vh !important;
  margin: 0;
  border-radius: 0;
  background: #ffffff !important;
  box-shadow: none;
}

.modal-dialog.modal-dialog-full .modal-body,
.modal-content-full .modal-body {
  height: calc(100vh - 110px);
  overflow-y: auto;
}

/* Smooth animation */
.modal.fade .modal-dialog {
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease-out;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

/* Mobile */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: calc(100vw - 20px);
    margin: 10px auto;
    min-height: calc(100vh - 20px);
  }

  .modal-content {
    border-radius: 14px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}