/**
 * Site Mechanic - Screenshot Lightbox Styles
 * Fullscreen image viewer with navigation
 */

/* Lightbox Container */
.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 40);
  background: var(--lightbox-bg, rgba(0, 0, 0, 0.95));
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screenshot-lightbox--open {
  display: flex;
  opacity: 1;
}

/* Overlay (for click-to-close) */
.screenshot-lightbox__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Content Container */
.screenshot-lightbox__content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Close Button */
.screenshot-lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg, 12px);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.screenshot-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.screenshot-lightbox__close:focus {
  outline: 2px solid var(--color-primary, #5bf4e7);
  outline-offset: 2px;
}

/* Navigation Arrows */
.screenshot-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--lightbox-arrow-size, 48px);
  height: var(--lightbox-arrow-size, 48px);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.screenshot-lightbox__nav--prev {
  left: 2rem;
}

.screenshot-lightbox__nav--next {
  right: 2rem;
}

.screenshot-lightbox__nav:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--color-primary, #5bf4e7);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 20px rgba(91, 244, 231, 0.3);
}

.screenshot-lightbox__nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.screenshot-lightbox__nav:focus {
  outline: 2px solid var(--color-primary, #5bf4e7);
  outline-offset: 2px;
}

/* Image Container */
.screenshot-lightbox__image-container {
  position: relative;
  max-width: 90vw;
  max-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Footer (Device label + Counter) */
.screenshot-lightbox__footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg, 12px);
  color: #fff;
}

.screenshot-lightbox__device {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #5bf4e7);
}

.screenshot-lightbox__counter {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.screenshot-lightbox__device::after {
  content: '•';
  margin-left: 1rem;
  color: rgba(255, 255, 255, 0.3);
}

.screenshot-lightbox__device:empty::after {
  display: none;
}

/* Screenshot Grid (thumbnail layout) */
.screenshot-section {
  margin-top: 2rem;
}

.screenshot-section__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin: 0 0 1rem 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.screenshot-item {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
  transition: all 0.3s ease;
}

.screenshot-item:hover {
  border-color: var(--color-primary, #5bf4e7);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 255, 157, 0.3);
}

.screenshot-item:focus-within {
  outline: 2px solid var(--color-primary, #5bf4e7);
  outline-offset: 2px;
}

.screenshot-item__img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.screenshot-item:hover .screenshot-item__img {
  transform: scale(1.05);
}

.screenshot-item__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
  .screenshot-lightbox__nav--prev {
    left: 1rem;
  }

  .screenshot-lightbox__nav--next {
    right: 1rem;
  }

  .screenshot-lightbox__close {
    top: 1rem;
    right: 1rem;
  }

  .screenshot-lightbox__footer {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  .screenshot-lightbox__image-container {
    max-width: 95vw;
    max-height: calc(100vh - 6rem);
  }

  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .screenshot-lightbox,
  .screenshot-item,
  .screenshot-item__img,
  .screenshot-lightbox__nav {
    transition: none;
  }

  .screenshot-item:hover .screenshot-item__img {
    transform: none;
  }

  .screenshot-lightbox__nav:hover:not(:disabled) {
    transform: translateY(-50%);
  }
}
