/* Dialog component - shadcn style */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.dialog-overlay[data-state="open"] {
  opacity: 1;
}

.dialog-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: dialog-content-show 0.15s ease-out;
  overflow: hidden;
}

.dialog-content:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

@keyframes dialog-content-show {
  0% {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.dialog-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  transition: opacity 0.3s ease;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dialog-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.dialog-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.dialog-image {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.dialog-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
}

.dialog-navigation:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
  opacity: 1 !important;
}

.dialog-nav-prev {
  left: 1rem;
}

.dialog-nav-next {
  right: 1rem;
}

.dialog-overlay:hover .dialog-navigation {
  opacity: 0.8;
}

.dialog-controls-visible .dialog-header,
.dialog-controls-visible .dialog-navigation {
  opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .dialog-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 1rem;
  }
  
  .dialog-close {
    width: 3rem;
    height: 3rem;
  }
  
  .dialog-navigation {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .dialog-nav-prev {
    left: 0.5rem;
  }
  
  .dialog-nav-next {
    right: 0.5rem;
  }
}

/* Rotation support for mobile landscape images */
.dialog-content.rotated-view {
  transform: rotate(90deg);
  max-width: 95vh;
  max-height: 95vw;
}

.dialog-content.rotated-view .dialog-image {
  max-width: 95vh;
  max-height: 95vw;
}
