/* Gallery Page Styles */
.gallery-page {
  padding: 65px 2rem 4rem;
  background: #f8f9fa;
}

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
}

.gallery-header h1 {
  font-size: 2.5rem;
  color: #002e5a;
  margin-bottom: 1rem;
}

.gallery-header p {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 900px;
  max-height: 80%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.lightbox-content.fade {
  opacity: 0;
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

.close:hover {
  color: #bbb;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  user-select: none;
  transition: 0.3s;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev {
  left: 0;
  border-radius: 0 3px 3px 0;
}

.prev:hover,
.next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.image-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 300px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.loading-spinner .spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #002e5a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Gallery Item Animation */
.gallery-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

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

/* Mobile Layout - 2 images per row */
@media (max-width: 768px) {
  .gallery-page {
    padding: 100px 1rem 3rem;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .gallery-header p {
    font-size: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery-item img {
    height: 200px;
  }
}

/* Small mobile screens */
@media (max-width: 480px) {
  .gallery-page {
    padding: 90px 0.8rem 2.5rem;
  }

  .gallery-header h1 {
    font-size: 1.8rem;
  }

  .gallery-grid {
    gap: 0.8rem;
  }

  .gallery-item img {
    height: 180px;
  }

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

  .close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }

  .prev,
  .next {
    font-size: 16px;
    padding: 12px;
  }
}
