/**
 * WB Modal Widget Styles
 * Modal container that can be triggered from any button
 */

/* Modal Container - Hidden by default */
.wb-modal__modal {
  /* No visible content - all modals are hidden until triggered */
  --box-padding-y: 72px;
  --box-padding-x: 64px;
}

.wb-modal__modal * {
  outline: none !important;
}

/* Empty state for editor */
.wb-modal__empty-state {
  padding: var(--box-padding-y) var(--box-padding-x);
  text-align: center;
  background: #f5f5f5;
  border-radius: 8px;
  color: #666;
}

/* Modal Overlay */
.wb-modal__modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Modal active state */
.wb-modal__modal.is-active {
  display: flex;
  opacity: 1;
}

/* Modal overlay background */
.wb-modal__overlay {
  position: absolute;
  cursor: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal__overlay__cursor {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: scale(0);
  transition: transform 0.3s;
}

.wb-modal__overlay.is-active .modal__overlay__cursor {
  transform: scale(1);
}

.modal__overlay__cursor::before,
.modal__overlay__cursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  pointer-events: none;
}

.modal__overlay__cursor::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal__overlay__cursor::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}


/* Modal content container */
.wb-modal__content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: var(--box-padding-y) var(--box-padding-x);
  z-index: 10000;
  animation: modalSlideIn 0.3s ease;
  margin-left: auto;
  min-height: 100%;
}

/* Modal slide in animation */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Close button */
.wb-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  width: unset;
  height: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  color: #000 !important;
  transition: all 0.2s ease;
  background: transparent !important;
  z-index: 10001;
}

.wb-modal__close:hover {
  background: transparent !important;
  color: #000 !important;
  transform: rotate(90deg);
}

/* Modal header */
.wb-modal__header {
  margin-bottom: 1.5rem;
  padding-right: 2rem; /* Space for close button */
}

.wb-modal__title {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.wb-modal__description {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
}

.wb-modal__description p {
  margin: 0;
}

/* Modal body */
.wb-modal__body {
  color: #333;
}

.wb-modal__shortcode {
  /* Form styles will come from the shortcode itself */
}

.wb-modal__no-content {
  padding: 2rem;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wb-modal__content {
    width: 95%;
    padding: 1.5rem;
    max-height: 85vh;
  }

  .wb-modal__title {
    font-size: 1.5rem;
  }

  .wb-modal__header {
    padding-right: 2.5rem;
  }

  .wb-modal__close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .wb-modal__content {
    padding: 1.25rem;
    border-radius: 8px;
  }

  .wb-modal__title {
    font-size: 1.25rem;
  }

  .wb-modal__close {
    width: 32px;
    height: 32px;
  }
}

/* Prevent body scroll when modal is open */
body.wb-modal-open {
  overflow: hidden;
}

/* Accessibility: Focus trap styles */
.wb-modal__modal:focus {
  outline: none;
}

/* Animation for closing */
.wb-modal__modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.wb-modal__modal.is-closing .wb-modal__content {
  animation: modalSlideOut 0.3s ease;
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}
