/* Lightbox - FINAL VERSION (no selection, clean background zones) */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 60%;
  max-height: 90%;
  z-index: 10;
  pointer-events: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: grab;
  pointer-events: auto;
  
  /* PREVENT SELECTION/HIGHLIGHT */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.lightbox img:active {
  cursor: grabbing;
}

/* ============================================
   BACKGROUND CLICK ZONES
   ============================================ */

.lightbox-bg-zone {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 5;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-bg-left {
  left: 0;
  width: 20%;
  cursor: w-resize;
}

.lightbox-bg-right {
  right: 0;
  width: 20%;
  cursor: e-resize;
}

/* Subtle hover (no overlay on image) */
.lightbox-bg-left:hover {
  background: linear-gradient(90deg, rgba(212, 163, 115, 0.08) 0%, transparent 100%);
}

.lightbox-bg-right:hover {
  background: linear-gradient(90deg, transparent 0%, rgba(212, 163, 115, 0.08) 100%);
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10002;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
}

.lightbox-close::before {
  transform: rotate(45deg);
}

.lightbox-close::after {
  transform: rotate(-45deg);
}

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10002;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-prev::before {
  content: '';
  width: 15px;
  height: 15px;
  border-left: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(45deg);
  margin-left: 5px;
  transition: all 0.2s ease;
}

.lightbox-next::before {
  content: '';
  width: 15px;
  height: 15px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(-45deg);
  margin-right: 5px;
  transition: all 0.2s ease;
}

.lightbox-nav:hover::before {
  border-color: #d4a373;
}

/* Counter */
.lightbox-counter {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
  border-radius: 25px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10002;
  pointer-events: none;
  user-select: none;
}

/* Portfolio grid */
.portfolio-grid img {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 80%;
  }
  
  .lightbox-bg-left,
  .lightbox-bg-right {
    width: 25%;
  }
  
  .lightbox-bg-left:hover,
  .lightbox-bg-right:hover {
    background: none;
  }
  
  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
  
  .lightbox-nav {
    width: 50px;
    height: 50px;
  }
  
  .lightbox-prev {
    left: 15px;
  }
  
  .lightbox-next {
    right: 15px;
  }
  
  .lightbox-counter {
    top: 20px;
    font-size: 0.85rem;
    padding: 8px 16px;
  }
}

@media (max-width: 600px) {
  .lightbox-content {
    max-width: 90%;
  }
  
  .lightbox-bg-left,
  .lightbox-bg-right {
    width: 30%;
  }
  
  .lightbox-nav {
    width: 45px;
    height: 45px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
}

/* Prevent any selection anywhere in lightbox */
.lightbox * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lightbox img,
  .lightbox-nav,
  .lightbox-close,
  .lightbox-bg-zone {
    transition: none;
  }
}