/**
 * Lightweight Lightbox CSS
 * Modern styling with CSS transitions
 */

/* Overlay base styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
}

/* Content wrapper */
.lightbox-content {
  position: relative;
  z-index: 10000;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  max-width: 95vw;
  max-height: 95vh;
}

.lightbox-content.active {
  transform: scale(1);
}

/* Images inside lightbox */
.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* HTML content wrapper */
.lightbox-content > div {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  transform: scale(1.1);
  background: #f5f5f5;
}

.lightbox-close:active {
  transform: scale(1.05);
}

/* Loading state (optional) */
.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .lightbox-content img {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .lightbox-close {
    top: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    font-size: 25px;
  }
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}

/* Iframe support for HTML content */
.lightbox-content iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  background: #fff;
}

