/* ===================================
   GALLERY PAGE SPECIFIC STYLES
   ==================================== */

/* Gallery Section */
.gallery {
  padding-top: 8rem;
}

.gallery-title {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 0.8s ease-out forwards;
}

.gallery-title h2 {
  margin-bottom: 0.5rem;
}

.gallery-title p {
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 4rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
  animation: fadeInUp 0.6s cubic-bezier(0.15, 0, 0.15, 1) forwards;
  opacity: 0;
  transition: var(--transition);
}

.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 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay-text {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition);
}

.gallery-item:hover .gallery-item-overlay-text {
  opacity: 1;
  transform: scale(1);
}

/* Modal / Lightbox */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 5, 0.98);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  backdrop-filter: blur(10px);
}

.modal.active {
  display: flex;
}

.modal-image-container {
  position: relative;
  width: 90vw;
  height: 90vh;
  max-width: 1000px;
  max-height: 800px;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2001;
}

.modal-close:active {
  transform: scale(0.92);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2001;
}

.modal-nav:active {
  transform: translateY(-50%) scale(0.92);
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-prev {
  left: 1rem;
}

.modal-next {
  right: 1rem;
}

.modal-control-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shareImage {
  bottom: 30px;
  right: 30px;
}

.modal-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Light Mode Gallery */
[data-theme="light"] .gallery-item-overlay,
.light-mode .gallery-item-overlay {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal,
.light-mode .modal {
  background: rgba(245, 245, 247, 0.98);
}

[data-theme="light"] .modal-close,
[data-theme="light"] .modal-nav,
.light-mode .modal-close,
.light-mode .modal-nav {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-white);
}

[data-theme="light"] .modal-close:hover,
[data-theme="light"] .modal-nav:hover,
.light-mode .modal-close:hover,
.light-mode .modal-nav:hover {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-control-btn,
.light-mode .modal-control-btn {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: var(--color-white);
}

[data-theme="light"] .modal-control-btn:hover,
.light-mode .modal-control-btn:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .gallery {
    padding-top: 6rem;
  }

  .gallery-title {
    margin-bottom: 3rem;
  }

  .gallery-title h2 {
    font-size: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .modal-image-container {
    width: 95vw;
    height: 95vh;
  }

  .modal-close,
  .modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .modal-prev {
    left: 0.5rem;
  }

  .modal-next {
    right: 0.5rem;
  }

  #shareImage {
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .gallery {
    padding-top: 5rem;
  }

  .gallery-title {
    margin-bottom: 2rem;
  }

  .gallery-title h2 {
    font-size: 1.3rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }

  .modal-close,
  .modal-nav {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .modal-control-btn {
    width: 36px;
    height: 36px;
  }
}
