/* =========================================================
   Universal Close Button for All Modals
   ========================================================= */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #555; /* Start dark gray */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 1056; /* Stay above modal content */
}

.close-modal i {
  font-size: 18px;
  line-height: 1;
}

/* =========================================================
   Hover & Focus
   ========================================================= */
.close-modal:hover,
.close-modal:focus {
  background-color: rgba(0, 0, 0, 0.1); /* Slightly darker background */
  color: #000; /* Darken icon */
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   Dark Mode Variant (for dark modals)
   ========================================================= */
.modal-content .close-modal.dark {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.2);
}

.modal-content .close-modal.dark:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   Prevent Overlap with Form Content
   ========================================================= */
.modal-content {
  position: relative; /* anchor for absolute close button */
  padding-top: 48px; /* adds safe space for close button */
}

/* Adjust padding only for small screens */
@media (max-width: 576px) {
  .modal-content {
    padding-top: 56px;
  }
}

/* =========================================================
   Visual Tweaks for Alignment & Responsiveness
   ========================================================= */
.modal-body {
  padding-top: 8px !important; /* ensure space below the button */
}

.close-modal:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

