/* Gallery Page Styles */
.gallery-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 40px 0;
}
.gallery-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Gallery Header */
.gallery-header {
  text-align: center;
  margin-bottom: 50px;
  padding: 40px 0;
}
.gallery-header h1 {
  font-size: 48px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 15px;
  position: relative;
}
.gallery-header h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #fdbf00, #f39c12);
  border-radius: 2px;
}
.gallery-header p {
  font-size: 18px;
  color: #7f8c8d;
  font-weight: 400;
  margin-top: 25px;
}

/* Masonry Grid Layout */
.gallery-grid {
  column-count: 4;
  column-gap: 30px;
  column-fill: balance;
}

.gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 30px;
  break-inside: avoid;
  page-break-inside: avoid;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background: white;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}
.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-item:hover .overlay {
  opacity: 1;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-item:nth-child(1) {
  animation-delay: 0.05s;
}
.gallery-item:nth-child(2) {
  animation-delay: 0.1s;
}
.gallery-item:nth-child(3) {
  animation-delay: 0.15s;
}
.gallery-item:nth-child(4) {
  animation-delay: 0.2s;
}
.gallery-item:nth-child(5) {
  animation-delay: 0.25s;
}
.gallery-item:nth-child(6) {
  animation-delay: 0.3s;
}
.gallery-item:nth-child(7) {
  animation-delay: 0.35s;
}
.gallery-item:nth-child(8) {
  animation-delay: 0.4s;
}
.gallery-item:nth-child(9) {
  animation-delay: 0.45s;
}
.gallery-item:nth-child(10) {
  animation-delay: 0.5s;
}
.gallery-item:nth-child(11) {
  animation-delay: 0.55s;
}
.gallery-item:nth-child(12) {
  animation-delay: 0.6s;
}
.gallery-item:nth-child(13) {
  animation-delay: 0.65s;
}
.gallery-item:nth-child(14) {
  animation-delay: 0.7s;
}
.gallery-item:nth-child(15) {
  animation-delay: 0.75s;
}
.gallery-item:nth-child(16) {
  animation-delay: 0.8s;
}
.gallery-item:nth-child(17) {
  animation-delay: 0.85s;
}
.gallery-item:nth-child(18) {
  animation-delay: 0.9s;
}
.gallery-item:nth-child(19) {
  animation-delay: 0.95s;
}
.gallery-item:nth-child(20) {
  animation-delay: 1s;
}
.gallery-item:nth-child(21) {
  animation-delay: 1.05s;
}
.gallery-item:nth-child(22) {
  animation-delay: 1.1s;
}
.gallery-item:nth-child(23) {
  animation-delay: 1.15s;
}
.gallery-item:nth-child(24) {
  animation-delay: 1.2s;
}

/* Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.overlay-content h3 {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 5px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.overlay-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: lightboxFadeIn 0.3s ease;
}

.close-lightbox {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  color: rgb(255, 255, 255);
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.close-lightbox:hover {
  color: #000000;
}

#lightbox-image {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-info {
  padding: 20px;
  background: white;
}
.lightbox-info h3 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
}
.lightbox-info p {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0;
}

/* Navigation Buttons - Outside the image */
.lightbox-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100001;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  color: rgb(0, 0, 0);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 100002;
}
.nav-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6);
  color: #ffffff;
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%);
}
.nav-btn.prev-btn {
  left: 40px;
}
.nav-btn.next-btn {
  right: 40px;
}

/* Animations */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Responsive Design */
@media (min-width: 1400px) {
  .gallery-page .container {
    max-width: 1400px;
  }
  .gallery-grid {
    column-count: 5;
  }
}
@media (min-width: 1200px) and (max-width: 1399px) {
  .gallery-grid {
    column-count: 4;
  }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .gallery-grid {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .gallery-page {
    padding: 20px 0;
  }
  .gallery-page .container {
    padding: 0 15px;
  }
  .gallery-header {
    margin-bottom: 30px;
    padding: 20px 0;
  }
  .gallery-header h1 {
    font-size: 32px;
  }
  .gallery-header p {
    font-size: 16px;
  }
  .gallery-grid {
    column-count: 2;
    column-gap: 20px;
  }
  .gallery-item {
    margin-bottom: 20px;
  }
  .overlay {
    padding: 15px;
  }
  .overlay-content h3 {
    font-size: 16px;
  }
  .overlay-content p {
    font-size: 13px;
  }
  .lightbox-content {
    max-width: 98%;
    max-height: 98%;
  }
  #lightbox-image {
    max-height: 80vh;
  }
  .lightbox-info {
    padding: 15px;
  }
  .lightbox-info h3 {
    font-size: 20px;
  }
  .lightbox-info p {
    font-size: 14px;
  }
  .nav-btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  .nav-btn.prev-btn {
    left: 20px;
  }
  .nav-btn.next-btn {
    right: 20px;
  }
  .nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
  }
  .nav-btn:disabled {
    transform: translateY(-50%);
  }
}
@media (max-width: 480px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 0;
  }
  .gallery-item {
    margin-bottom: 15px;
  }
  .gallery-header h1 {
    font-size: 28px;
  }
  .gallery-header p {
    font-size: 14px;
  }
  .lightbox-content {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  #lightbox-image {
    max-height: 75vh;
  }
  .close-lightbox {
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
  .nav-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  .nav-btn.prev-btn {
    left: 10px;
  }
  .nav-btn.next-btn {
    right: 10px;
  }
  .nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
  }
  .nav-btn:disabled {
    transform: translateY(-50%);
  }
}