/* ==========================================
   More-Fire Gas Website - Gallery Page Styles
   ========================================== */

/* --- Gallery Hero Section --- */
.gallery-hero {
  background: linear-gradient(135deg, var(--light-blue), var(--white));
  min-height: 40vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 0 80px;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/hero-pattern.svg') center/cover;
  opacity: 0.1;
  z-index: 1;
}

.gallery-hero .container {
  position: relative;
  z-index: 2;
}

.gallery-hero .hero-title {
  font-size: 3.5rem;
  font-weight: var(--font-weight-extrabold);
  margin-bottom: 1rem;
  color: var(--dark-gray);
}

.gallery-hero .hero-subtitle {
  font-size: 1.2rem;
  color: var(--gray);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* --- Filter Section --- */
.filter-section {
  background: var(--white);
  border-bottom: 1px solid rgba(0, 102, 204, 0.1);
}

.filter-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
}

.filter-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  color: var(--gray);
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  transition: left 0.3s ease;
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  left: 0;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--white);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
}

.filter-btn i {
  margin-right: 0.5rem;
}

/* --- Gallery Grid --- */
.gallery-grid {
  background: var(--light-gray);
}

.gallery-item {
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.gallery-item.filter-hidden {
  opacity: 0;
  transform: scale(0.8);
  height: 0;
  margin: 0;
  overflow: hidden;
}

.gallery-item.filter-show {
  opacity: 1;
  transform: scale(1);
}

.gallery-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 350px;
}

.gallery-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 102, 204, 0.2);
}

.gallery-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.gallery-card:hover .gallery-image img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 102, 204, 0.9) 0%,
    rgba(0, 71, 153, 0.9) 100%
  );
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-content {
  text-align: center;
  color: var(--white);
  padding: 2rem;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.gallery-card:hover .gallery-content {
  transform: translateY(0);
}

.gallery-content h5 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.5rem;
}

.gallery-content p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.gallery-btn:hover {
  background: var(--white);
  color: var(--primary-blue);
  transform: scale(1.1);
}

/* --- Load More Button --- */
#loadMoreBtn {
  padding: 15px 40px;
  font-weight: 600;
  border-radius: 25px;
  border: 2px solid var(--primary-blue);
  transition: all 0.3s ease;
}

#loadMoreBtn:hover {
  background: var(--primary-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
}

/* --- Stats Section --- */
.stats-section {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: var(--white);
}

.stat-card {
  text-align: center;
  padding: 2rem 1rem;
}

.stat-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

.stat-number {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.5rem;
  color: var(--white);
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--light-blue), var(--white));
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/hero-pattern.svg') center/cover;
  opacity: 0.05;
  animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.1; }
}

.cta-section .container {
  position: relative;
  z-index: 2;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--dark-gray);
  margin-bottom: 1rem;
}

.cta-description {
  font-size: 1.2rem;
  color: var(--gray);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-buttons .btn {
  padding: 15px 40px;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.cta-buttons .btn-outline-primary {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.cta-buttons .btn-outline-primary:hover {
  background: var(--primary-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
}

/* --- Lightbox Customization --- */
.lb-overlay {
  background: rgba(0, 0, 0, 0.9) !important;
}

.lb-image {
  border-radius: 10px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
}

.lb-caption {
  font-family: var(--font-family) !important;
  font-size: 16px !important;
  color: var(--white) !important;
  text-align: center !important;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
  color: var(--white) !important;
  font-size: 2rem !important;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
  color: var(--primary-blue) !important;
}

.lb-close {
  color: var(--white) !important;
  font-size: 2rem !important;
}

.lb-close:hover {
  color: var(--primary-red) !important;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .gallery-hero .hero-title {
    font-size: 2.8rem;
  }
  
  .cta-title {
    font-size: 2rem;
  }
  
  .gallery-card {
    height: 300px;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 100px 0 60px;
  }
  
  .gallery-hero .hero-title {
    font-size: 2.2rem;
  }
  
  .gallery-hero .hero-subtitle {
    font-size: 1rem;
  }
  
  .filter-buttons {
    justify-content: center;
    gap: 0.5rem;
  }
  
  .filter-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
  
  .gallery-card {
    height: 250px;
  }
  
  .cta-title {
    font-size: 1.8rem;
  }
  
  .cta-description {
    font-size: 1rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-icon {
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .gallery-hero .hero-title {
    font-size: 1.8rem;
  }
  
  .filter-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .filter-btn {
    width: 200px;
    text-align: center;
  }
  
  .gallery-content {
    padding: 1rem;
  }
  
  .gallery-content h5 {
    font-size: 1.1rem;
  }
  
  .gallery-content p {
    font-size: 0.8rem;
  }
  
  .gallery-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* --- Loading States --- */
.gallery-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 102, 204, 0.2);
  border-left: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Accessibility Improvements --- */
.filter-btn:focus,
.gallery-btn:focus,
#loadMoreBtn:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.gallery-card:focus-within {
  outline: 2px solid var(--primary-blue);
  outline-offset: 4px;
}

/* --- Print Styles --- */
@media print {
  .gallery-overlay,
  .filter-section,
  .cta-section,
  .stats-section {
    display: none !important;
  }
  
  .gallery-card {
    break-inside: avoid;
    height: auto;
  }
  
  .gallery-image img {
    max-height: 300px;
    object-fit: contain;
  }
}

/* --- Animations for Page Load --- */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-card {
  animation: slideInUp 0.6s ease-out;
}

.gallery-item:nth-child(1) .gallery-card { animation-delay: 0.1s; }
.gallery-item:nth-child(2) .gallery-card { animation-delay: 0.2s; }
.gallery-item:nth-child(3) .gallery-card { animation-delay: 0.3s; }
.gallery-item:nth-child(4) .gallery-card { animation-delay: 0.4s; }
.gallery-item:nth-child(5) .gallery-card { animation-delay: 0.5s; }
.gallery-item:nth-child(6) .gallery-card { animation-delay: 0.6s; }
.gallery-item:nth-child(7) .gallery-card { animation-delay: 0.7s; }
.gallery-item:nth-child(8) .gallery-card { animation-delay: 0.8s; }
.gallery-item:nth-child(9) .gallery-card { animation-delay: 0.9s; }

/* --- Glass Morphism for Gallery Cards --- */
.gallery-card.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* --- Interactive Hover Effects --- */
.gallery-item:hover {
  z-index: 10;
}

.filter-btn:active {
  transform: translateY(0) scale(0.95);
}

#loadMoreBtn:active {
  transform: translateY(0) scale(0.98);
}

/* --- Counter Animation --- */
.stat-number.counting {
  color: var(--light-blue);
}

/* --- Masonry-like Effect for Different Image Sizes --- */
.gallery-item:nth-child(5n+1) .gallery-card {
  height: 400px;
}

.gallery-item:nth-child(7n+2) .gallery-card {
  height: 320px;
}

.gallery-item:nth-child(9n+3) .gallery-card {
  height: 380px;
}
