/*--------------------------------------------------------------
# Enhanced Gallery Styles - HindIndusTec
--------------------------------------------------------------*/

/* Animation keyframes for gallery items */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.gallery-container {
  padding: 60px 0;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.gallery-filter-item {
  display: inline-block;
  margin: 0 5px 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  background: #f8f9fa;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-filter-item:hover {
  background: rgba(2, 90, 180, 0.1);
  color: #025ab4;
}

.gallery-filter-item.active {
  background: #025ab4;
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  transition: all 0.4s ease;
  transform: translateY(0);
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-5px);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item.visible {
  animation: fadeIn 0.6s ease forwards;
}

.gallery-box {
  position: relative;
  overflow: hidden;
  height: 0;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  background: #f5f5f5;
  border-radius: 12px;
}

.gallery-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-box:hover img {
  transform: scale(1.08);
}

.gallery-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 12, 66, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  padding: 20px;
  transition: all 0.4s ease;
  border-radius: 12px;
}

.gallery-box:hover .gallery-info {
  opacity: 1;
  visibility: visible;
}

.gallery-info h5 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s ease 0.1s;
  text-align: center;
}

.gallery-box:hover .gallery-info h5 {
  transform: translateY(0);
  opacity: 1;
}

.gallery-info-buttons {
  display: flex;
  gap: 15px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s ease 0.2s;
}

.gallery-box:hover .gallery-info-buttons {
  transform: translateY(0);
  opacity: 1;
}

.gallery-info-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
}

.gallery-info-button:hover {
  background: #025ab4;
  transform: scale(1.1);
}

.gallery-info-button i {
  font-size: 20px;
}

/* Load more button */
.gallery-loadmore {
  display: block;
  margin: 30px auto 0;
  padding: 12px 30px;
  background: #025ab4;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-loadmore:hover {
  background: #014a93;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(2, 90, 180, 0.2);
}

.gallery-loadmore:focus {
  outline: none;
}

/* Enhanced Lightbox styles */
.gallery-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.gallery-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox-container {
  position: relative;
  width: 85%;
  max-width: 1000px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.4s ease;
}

.gallery-lightbox-overlay.active .gallery-lightbox-image {
  transform: scale(1);
  opacity: 1;
}

.gallery-lightbox-caption {
  color: #fff;
  margin-top: 20px;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease 0.2s;
}

.gallery-lightbox-overlay.active .gallery-lightbox-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ENHANCED CLOSE BUTTON - TOP RIGHT SECTION */
.gallery-lightbox-close {
  position: fixed !important;
  top: 25px !important;
  right: 25px !important;
  width: 55px !important;
  height: 55px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  color: #fff !important;
  font-size: 22px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  transform: scale(0.8) rotate(0deg) !important;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  z-index: 10001 !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.gallery-lightbox-overlay.active .gallery-lightbox-close {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: scale(1.15) rotate(90deg) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

.gallery-lightbox-close:active {
  transform: scale(1.05) rotate(90deg) !important;
}

/* Close button icon enhancement */
.gallery-lightbox-close i {
  font-size: 22px !important;
  font-weight: bold !important;
  transition: all 0.3s ease !important;
  color: #ffffff !important; /* Make the icon white */
}

.gallery-lightbox-close:hover i {
  transform: scale(1.1) !important;
}

/* Additional styling for css-cross class */
.css-cross i {
  color: #ffffff !important;
  font-size: 24px !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5) !important;
}

/* Styling for category-icon in lightbox */
.gallery-lightbox-close .category-icon {
  font-size: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  width: 100% !important;
}

/* Navigation arrows - Enhanced */
.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  z-index: 2;
  padding: 0 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-lightbox-overlay:hover .gallery-lightbox-nav {
  opacity: 1;
}

.gallery-lightbox-nav button {
  width: 55px;
  height: 55px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.gallery-lightbox-nav button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.gallery-lightbox-nav button:active {
  transform: scale(1.05);
}

/* Category Label */
.gallery-category-label {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #025ab4;
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
  opacity: 0.9;
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Featured gallery styles */
.featured-section {
  background: linear-gradient(rgba(2, 90, 180, 0.05), rgba(2, 90, 180, 0.1));
  padding: 80px 0;
  margin: 30px 0;
}

.featured-carousel .item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin: 15px 10px;
  transition: all 0.4s;
}

.featured-carousel .item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-carousel .item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.8s ease;
}

.featured-carousel .item:hover img {
  transform: scale(1.05);
}

.featured-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.featured-caption h4 {
  font-size: 18px;
  margin-bottom: 0;
}

.featured-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #025ab4;
  color: #fff;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.featured-carousel .owl-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  margin-top: 0;
}

.featured-carousel .owl-nav button {
  position: absolute;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.8) !important;
  border-radius: 50% !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.featured-carousel .owl-nav button:hover {
  background: #025ab4 !important;
  color: #fff !important;
}

.featured-carousel .owl-prev {
  left: -22px;
}

.featured-carousel .owl-next {
  right: -22px;
}

.featured-carousel .owl-dots {
  margin-top: 20px;
}

.featured-carousel .owl-dot span {
  width: 10px;
  height: 10px;
  background: rgba(2, 90, 180, 0.3);
  transition: all 0.3s;
}

.featured-carousel .owl-dot.active span {
  background: #025ab4;
  width: 20px;
  border-radius: 5px;
}

/* Masonry variant for larger screens */
@media (min-width: 992px) {
  .gallery-grid.masonry {
    grid-auto-rows: 0;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .gallery-grid.masonry .gallery-item:nth-child(3n+1) .gallery-box {
    padding-bottom: 100%; /* Square */
  }
  
  .gallery-grid.masonry .gallery-item:nth-child(3n+2) .gallery-box {
    padding-bottom: 70%; /* Landscape */
  }
  
  .gallery-grid.masonry .gallery-item:nth-child(3n+3) .gallery-box {
    padding-bottom: 125%; /* Portrait */
  }
}

/* Enhanced hover effects for gallery items */
.gallery-item {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-item::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Staggered animation for gallery items */
.gallery-item {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(n+9) { animation-delay: 0.9s; }

/* Responsive adjustments */
@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
  }
  
  .gallery-info h5 {
    font-size: 16px;
  }
  
  .gallery-lightbox-close {
    top: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
  }
  
  .gallery-filter-item {
    padding: 6px 12px;
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .gallery-lightbox-container {
    width: 95%;
  }
  
  .gallery-lightbox-close {
    top: 15px !important;
    right: 15px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
  }
  
  .gallery-lightbox-nav {
    padding: 0 15px;
  }
  
  .gallery-lightbox-nav button {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
}

@media (max-width: 575px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .gallery-info h5 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .gallery-info-button {
    width: 40px;
    height: 40px;
  }
  
  .gallery-info-button i {
    font-size: 18px;
  }
  
  .gallery-lightbox-close {
    top: 12px !important;
    right: 12px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 16px !important;
  }
  
  .gallery-lightbox-nav {
    padding: 0 10px;
  }
  
  .gallery-lightbox-nav button {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}

/* Additional enhancements for better UX */
.gallery-lightbox-overlay {
  -webkit-tap-highlight-color: transparent;
}

.gallery-lightbox-close {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Focus states for accessibility */
.gallery-lightbox-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.gallery-lightbox-nav button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}