@tailwind base;
@tailwind components;
@tailwind utilities;

.project-img {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-img::before {
  content: "Click to enlarge";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.project-img:hover::before {
  opacity: 1;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  transition: transform 0.3s ease;
}

.lightbox-content.swiping-left {
  transform: translateX(-30px);
}

.lightbox-content.swiping-right {
  transform: translateX(30px);
}

.lightbox-content.bounce-left {
  animation: bounce-left 0.5s ease;
}

.lightbox-content.bounce-right {
  animation: bounce-right 0.5s ease;
}

@keyframes bounce-left {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(20px);
  }
}

@keyframes bounce-right {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-20px);
  }
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border: 3px solid white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

.lightbox-image.fade {
  opacity: 0.5;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 1.8rem;
  margin-top: 10px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 3.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: rgb(255, 0, 0);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
}

.lightbox-nav:hover {
  background-color: rgba(255, 0, 0, 0.7);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav.hidden {
  display: none;
}

.lightbox-controls {
  position: absolute;
  bottom: -50px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.lightbox-slideshow {
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.lightbox-slideshow:hover {
  background-color: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}

.lightbox-slideshow.playing {
  background-color: rgba(255, 0, 0, 0.7);
}

.lightbox-counter {
  color: white;
  font-size: 1.4rem;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 15px;
}

.swipe-instruction {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 1.4rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.swipe-instruction.visible {
  opacity: 1;
  visibility: visible;
}

.lightbox-notification {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1.4rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.lightbox-notification.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(10px);
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  .lightbox-nav {
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-caption {
    font-size: 1.6rem;
  }

  /* Make navigation buttons smaller on mobile */
  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.8rem;
  }

  /* Adjust swipe instruction for mobile */
  .swipe-instruction {
    bottom: -30px;
    font-size: 1.2rem;
  }

  /* Adjust slideshow controls for mobile */
  .lightbox-controls {
    bottom: -40px;
  }

  .lightbox-slideshow {
    width: 36px;
    height: 36px;
    font-size: 1.6rem;
  }

  .lightbox-counter {
    font-size: 1.2rem;
  }

  .lightbox-notification {
    font-size: 1.2rem;
    padding: 8px 15px;
  }
}
