/**
 * Modal Component CSS
 * Styles for the modal dialog component
 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-index-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-duration) var(--transition-timing);
  pointer-events: none;
}
.modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-dialog {
  position: relative;
  background-color: var(--dialog-bg);
  color: var(--dialog-text);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--dialog-shadow);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s ease-out;
  transform-origin: center;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--dialog-border);
}
.modal-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  flex: 1;
  display: flex;
  gap: 5px;
}
.modal-body {
  padding: var(--space-4);
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--dialog-border);
}
.modal.modal-compact .modal-dialog {
  max-width: 420px;
}
/* Animation keyframes */
@keyframes scaleUp {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
/* Animation classes */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}
.fade-out {
  animation: fadeOut 0.3s ease forwards;
}
/* RTL Support */
[dir="rtl"] .modal-close {
  margin-left: 0;
  margin-right: auto;
}
/* Mobile Responsiveness */
@media (max-width: 640px) {
  .modal-dialog {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--space-3);
  }
}
.error-modal .modal-body {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
}
.error-modal .modal-body::before {
  font-size: 1.375rem;
  color: #ff6b6b;
}
.modal-dialog .error-modal {
  max-width: 500px;
  animation: shake 0.5s;
}
/* ==========================================================================
   Gallery Transition Effects
   ========================================================================== */
/* Container needs overflow hidden for slide effects */
.modal .lightbox-body,
.modal [data-gallery-content] {
  overflow: hidden;
  position: relative;
}
/* Enable smooth touch swiping */
.modal.show {
  touch-action: pan-y pinch-zoom;
}
/* Fade Effects */
@keyframes galleryFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes galleryFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.gallery-fade-in {
  animation: galleryFadeIn 0.3s ease forwards;
}
.gallery-fade-out {
  animation: galleryFadeOut 0.15s ease forwards;
}
/* Slide Horizontal Effects */
@keyframes gallerySlideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes gallerySlideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes gallerySlideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}
@keyframes gallerySlideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
.gallery-slide-in-left {
  animation: gallerySlideInLeft 0.3s ease forwards;
}
.gallery-slide-in-right {
  animation: gallerySlideInRight 0.3s ease forwards;
}
.gallery-slide-out-left {
  animation: gallerySlideOutLeft 0.15s ease forwards;
}
.gallery-slide-out-right {
  animation: gallerySlideOutRight 0.15s ease forwards;
}
/* Slide Vertical Effects */
@keyframes gallerySlideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes gallerySlideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes gallerySlideOutUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}
@keyframes gallerySlideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
.gallery-slide-in-up {
  animation: gallerySlideInUp 0.3s ease forwards;
}
.gallery-slide-in-down {
  animation: gallerySlideInDown 0.3s ease forwards;
}
.gallery-slide-out-up {
  animation: gallerySlideOutUp 0.15s ease forwards;
}
.gallery-slide-out-down {
  animation: gallerySlideOutDown 0.15s ease forwards;
}
/* Zoom Effects */
@keyframes galleryZoomIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes galleryZoomOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.5);
    opacity: 0;
  }
}
.gallery-zoom-in {
  animation: galleryZoomIn 0.3s ease forwards;
}
.gallery-zoom-out {
  animation: galleryZoomOut 0.15s ease forwards;
}