/* Custom Modal Styles - Matching Website Design */
/* Replaces browser default alert/confirm dialogs */

.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2147483647; /* Maximum z-index to ensure it's above PayPal iframe */
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-modal-overlay.active {
  opacity: 1;
}

.custom-modal {
  background: #ffffff;
  background-image: url("https://www.transparenttextures.com/patterns/otis-redding.png");
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
}

.custom-modal-overlay.active .custom-modal {
  transform: scale(1) translateY(0);
}

.custom-modal-header {
  padding: 25px 25px 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 2px solid #ddd;
}

.custom-modal-icon {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-modal-icon svg {
  width: 26px;
  height: 26px;
}

/* Modal type colors - matching website palette */
.custom-modal-success .custom-modal-icon {
  background-color: #a5d555;
  color: #ffffff;
}

.custom-modal-error .custom-modal-icon {
  background-color: #d9534f;
  color: #ffffff;
}

.custom-modal-warning .custom-modal-icon {
  background-color: #f0ad4e;
  color: #ffffff;
}

.custom-modal-info .custom-modal-icon {
  background-color: #5bc0de;
  color: #ffffff;
}

.custom-modal-title {
  font-family: "Montserrat", "Arial", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  flex: 1;
}

.custom-modal-body {
  padding: 25px;
  font-family: "Montserrat", "Arial", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  white-space: pre-wrap;
  text-align: center;
  overflow: none;
}

.custom-modal-footer {
  padding: 15px 25px 25px 25px;
  display: flex;
  gap: 15px;
  justify-content: center;
  border-top: 1px solid #e0e0e0;
}

.custom-modal-btn {
  padding: 12px 25px;
  border-radius: 8px;
  font-family: "Montserrat", "Arial", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
  min-width: 100px;
}

.custom-modal-btn-primary {
  background-color: #8dc53e;
  color: #ffffff;
}

.custom-modal-btn-primary:hover {
  background-color: #6b9b2f;
}

.custom-modal-btn-primary:active {
  transform: scale(0.98);
}

.custom-modal-btn-secondary {
  background-color: #f0f0f0;
  color: #555;
  border: 1px solid #ccc;
}

.custom-modal-btn-secondary:hover {
  background-color: #e0e0e0;
  color: #333;
  border-color: #bbb;
}

/* Loading spinner */
.custom-modal-spinner {
  width: 45px;
  height: 45px;
  border: 4px solid #e0e0e0;
  border-top-color: #8dc53e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-modal .custom-modal-footer {
  display: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .custom-modal {
    max-width: 90%;
    margin: 20px;
  }

  .custom-modal-header {
    padding: 20px 20px 15px 20px;
  }

  .custom-modal-icon {
    width: 40px;
    height: 40px;
  }

  .custom-modal-icon svg {
    width: 22px;
    height: 22px;
  }

  .custom-modal-title {
    font-size: 1.3rem;
  }

  .custom-modal-body {
    padding: 20px;
    font-size: 0.95rem;
  }

  .custom-modal-footer {
    padding: 15px 20px 20px 20px;
    flex-direction: column-reverse;
  }

  .custom-modal-btn {
    width: 100%;
    min-width: unset;
  }
}

/* Animations for different modal types - subtle */
.custom-modal-success .custom-modal-icon {
  animation: iconPop 0.3s ease-out;
}

.custom-modal-error .custom-modal-icon {
  animation: iconPop 0.3s ease-out;
}

.custom-modal-warning .custom-modal-icon {
  animation: iconPop 0.3s ease-out;
}

.custom-modal-info .custom-modal-icon {
  animation: iconPop 0.3s ease-out;
}

@keyframes iconPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Prevent body scroll when modal is open */
body:has(.custom-modal-overlay) {
  overflow: hidden;
}
