/* Gallery Lightbox Styles */
/* Author: DAKSHA COACHING CENTRE */

/* Lightbox Container */
.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: all 0.3s ease;
}

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

/* Lightbox Content */
.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
  margin: auto;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

/* Lightbox Image */
.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 5px solid white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Image Caption */
.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -50px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px;
  text-align: center;
  border-radius: 5px;
}

.lightbox-title {
  font-size: 18px;
  color: #29186e;
  margin: 0 0 5px;
}

.lightbox-category {
  font-size: 14px;
  color: #666;
}

/* Navigation Buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 20px;
}

.lightbox-nav-btn {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-nav-btn:hover {
  background-color: #29186e;
}

.lightbox-nav-btn.next {
  background-color: #0192dd;
}

/* Close Button */
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  color: #0192dd;
}

/* Counter */
.lightbox-counter {
  position: absolute;
  bottom: -40px;
  right: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* Image Loading Spinner */
.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #29186e;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Animation for lightbox images */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.lightbox-image {
  animation: fadeIn 0.5s ease-in-out;
}

/* Enhance gallery grid items for lightbox */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  height: 250px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }
.gallery-item:nth-child(11) { animation-delay: 0.6s; }
.gallery-item:nth-child(12) { animation-delay: 0.65s; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 20px;
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  transform: translateY(0);
}

.gallery-item-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 5px;
}

.gallery-item-category {
  font-size: 14px;
  opacity: 0.8;
}

/* Responsive styles */
@media screen and (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .gallery-item {
    height: 200px;
  }

  .lightbox-content {
    max-width: 95%;
  }

  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
  }
}

@media screen and (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .gallery-item {
    height: 150px;
  }

  .gallery-filter-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Touch gestures support indicators */
.swipe-indicator {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  display: none;
}

@media (max-width: 768px) {
  .swipe-indicator {
    display: block;
  }
}

/* Smooth transition between images */
.lightbox-content.transitioning .lightbox-image {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Gallery container styling enhancement */
.gallery-container {
  padding: 40px 0;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  gap: 10px;
}

.gallery-filter-btn {
  background: none;
  border: 2px solid #e0e0e0;
  padding: 10px 20px;
  border-radius: 30px;
  color: #666;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-filter-btn:hover {
  border-color: #29186e;
  color: #29186e;
}

.gallery-filter-btn.active {
  background-color: #29186e;
  border-color: #29186e;
  color: white;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.gallery-grid.animating {
  opacity: 0;
}

/* Animation for items when they appear after load more */
@keyframes itemAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-appear {
  animation: itemAppear 0.6s ease forwards;
}

/* Load more button styling */
.gallery-load-more {
  text-align: center;
  margin: 30px 0 10px;
}

#load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #4a235a;
  color: white;
  padding: 14px 30px;
  border-radius: 40px;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(74, 35, 90, 0.3);
}

#load-more-btn:hover {
  background-color: #7d3c98;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(74, 35, 90, 0.4);
}

#load-more-btn:active {
  transform: translateY(-1px);
}

#load-more-btn i {
  margin-right: 8px;
  font-size: 14px;
}

/* Additional responsive styling for gallery grid */
@media screen and (max-width: 1200px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
}

@media screen and (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
}

@media screen and (max-width: 480px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .gallery-item .gallery-overlay h3 {
    font-size: 16px;
  }

  .gallery-item .gallery-overlay p {
    font-size: 13px;
  }
}
