/**
 * Mobile Modal Close Button Fix
 * Ensures the close button is always visible and accessible on mobile devices
 */

/* Mobile-specific modal adjustments */
@media (max-width: 768px) {
  /* Ensure modal header is always visible */
  #imageModal .modal-header {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    z-index: 1090 !important;
    width: auto !important;
    height: auto !important;
  }
  
  /* Style the close button for better mobile visibility */
  #imageModal .modal-header .btn-close {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    opacity: 1 !important;
    font-size: 18px !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Add a visible × symbol if needed */
  #imageModal .modal-header .btn-close::before {
    content: "×" !important;
    font-size: 24px !important;
    font-weight: bold !important;
    color: white !important;
    line-height: 1 !important;
  }
  
  /* Ensure the close button stays on top of everything */
  #imageModal .modal-header .btn-close:hover,
  #imageModal .modal-header .btn-close:focus {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.05) !important;
  }
  
  /* Make sure modal body accounts for the fixed close button */
  #imageModal .modal-body {
    padding-top: 60px !important;
  }
  
  /* Add touch-friendly styling */
  #imageModal .modal-header .btn-close {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }
}

/* Ensure close button works on all screen sizes */
#imageModal .modal-header .btn-close {
  position: relative !important;
  z-index: 1090 !important;
  min-width: 44px !important;
  min-height: 44px !important;
}

/* Additional safety - ensure close button is always clickable */
#imageModal .modal-header {
  pointer-events: auto !important;
}

#imageModal .modal-header .btn-close {
  pointer-events: auto !important;
  cursor: pointer !important;
}