/* Gallery Section Styles */

/* Main Gallery Section */
.gallery {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  color: #f8fafc;
  position: relative;
  overflow: hidden;
  padding: 100px 0;
}

.gallery::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.3) 0%, transparent 50%);
  pointer-events: none;
}

.gallery .section-title {
  color: #f8fafc;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.gallery .section-line {
  background: linear-gradient(90deg, transparent, #3b82f6, #10b981, transparent);
  height: 3px;
  width: 100px;
  margin: 0 auto 3rem;
  border-radius: 2px;
}

/* Gallery Carousel Container */
.gallery-carousel {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Carousel Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(248, 250, 252, 0.95);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.carousel-btn:hover i {
  color: white;
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: translateY(-50%) scale(0.9);
  background: rgba(148, 163, 184, 0.5);
}

.carousel-btn:disabled:hover {
  background: rgba(148, 163, 184, 0.5);
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-50%) scale(0.9);
}

.carousel-prev {
  left: -30px;
}

.carousel-next {
  right: -30px;
}

.carousel-btn i {
  font-size: 1.2rem;
  color: #3b82f6;
  transition: all 0.3s ease;
}

/* Carousel Track Container */
.carousel-track-container {
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  flex: 1;
  background: rgba(30, 41, 59, 0.3);
  backdrop-filter: blur(10px);
  padding: 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Individual Carousel Slides */
.carousel-slide {
  min-width: calc(33.333% - 1rem);
  padding: 0 0.5rem;
}

/* Gallery Items */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  cursor: pointer;
  aspect-ratio: 16/12;
  background: linear-gradient(135deg, #475569, #64748b);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(59, 130, 246, 0.2);
}

.gallery-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(59, 130, 246, 0.2) 0%,
    rgba(16, 185, 129, 0.15) 50%,
    rgba(99, 102, 241, 0.2) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
}

.gallery-item::after {
  content: "\f00e"; /* FontAwesome search-plus icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 60px;
  height: 60px;
  background: rgba(248, 250, 252, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: #3b82f6;
  font-size: 1.5rem;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 13px;
}

.gallery-item:hover img {
  transform: scale(1.1);
  filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* Gallery Modal */
.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

/* Modal Navigation */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
  padding: 0 2rem;
}

.modal-nav-btn {
  background: rgba(248, 250, 252, 0.9);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  pointer-events: all;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-nav-btn:hover {
  background: rgba(59, 130, 246, 0.9);
  border-color: #3b82f6;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.modal-nav-btn i {
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(248, 250, 252, 0.9);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 3;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4);
}

/* Loading Animation for Gallery Images */
.gallery-item.loading {
  background: linear-gradient(90deg, #475569 25%, #64748b 50%, #475569 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Mobile Navigation Dots */
.mobile-nav-dots {
  display: none;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-dot.active {
  background: #3b82f6;
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.nav-dot:hover {
  background: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
  .carousel-slide {
    min-width: calc(50% - 0.75rem);
  }

  .carousel-btn {
    width: 50px;
    height: 50px;
  }

  .carousel-prev {
    left: -25px;
  }

  .carousel-next {
    right: -25px;
  }

  .modal-nav-btn {
    width: 50px;
    height: 50px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .gallery {
    padding: 80px 0;
  }

  .gallery .section-title {
    font-size: 2.2rem;
  }

  .gallery-carousel {
    padding: 0 15px;
  }

  .carousel-container {
    gap: 1rem;
  }

  .carousel-slide {
    min-width: calc(100% - 1rem);
    padding: 0 0.5rem;
  }

  .carousel-track-container {
    padding: 15px;
  }

  .carousel-btn {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.95);
    border-color: #3b82f6;
  }

  .carousel-btn i {
    color: white;
    font-size: 1.1rem;
  }

  .carousel-btn:hover {
    background: #2563eb;
  }

  .carousel-btn:disabled {
    background: rgba(148, 163, 184, 0.7);
  }

  .carousel-prev {
    left: -25px;
  }

  .carousel-next {
    right: -25px;
  }

  .mobile-nav-dots {
    display: flex;
  }

  .gallery-item {
    aspect-ratio: 16/10;
  }

  .modal-overlay {
    padding: 1rem;
  }

  .modal-content {
    max-width: 95vw;
    max-height: 80vh;
  }

  .modal-nav {
    padding: 0 1rem;
  }

  .modal-nav-btn {
    width: 45px;
    height: 45px;
  }

  .modal-nav-btn i {
    font-size: 1rem;
  }

  .modal-close {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    top: 1rem;
    right: 1rem;
  }
}

/* Mobile Phones */
@media (max-width: 576px) {
  .gallery {
    padding: 60px 0;
  }

  .gallery .section-title {
    font-size: 2rem;
  }

  .gallery-carousel {
    padding: 0 10px;
  }

  .carousel-container {
    gap: 0.5rem;
  }

  .carousel-slide {
    padding: 0 0.25rem;
  }

  .carousel-track-container {
    padding: 12px;
  }

  .carousel-btn {
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.95);
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  .carousel-btn i {
    font-size: 1rem;
    color: white;
  }

  .carousel-btn:hover {
    background: #2563eb;
    transform: translateY(-50%) scale(1.05);
  }

  .carousel-prev {
    left: -22px;
  }

  .carousel-next {
    right: -22px;
  }

  .gallery-item {
    aspect-ratio: 4/3;
    border-radius: 12px;
  }

  .gallery-item::after {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .mobile-nav-dots {
    display: flex;
    margin-top: 1.5rem;
  }

  .nav-dot {
    width: 10px;
    height: 10px;
  }

  .modal-nav {
    display: none; /* Hide navigation on mobile, use swipe instead */
  }

  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    top: 1rem;
    right: 1rem;
  }
}

/* Extra Small Phones */
@media (max-width: 480px) {
  .gallery-carousel {
    padding: 0 5px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-btn i {
    font-size: 0.9rem;
  }

  .carousel-prev {
    left: -20px;
  }

  .carousel-next {
    right: -20px;
  }

  .carousel-slide {
    min-width: 100%;
    padding: 0 0.5rem;
  }

  .carousel-track-container {
    padding: 10px;
  }

  .gallery-item {
    border-radius: 10px;
  }

  .modal-content {
    max-width: 100vw;
    max-height: 75vh;
  }

  .modal-overlay {
    padding: 0.5rem;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .gallery-item {
    border: 3px solid #f8fafc;
  }

  .carousel-btn {
    border: 3px solid #1e293b;
    background: #ffffff;
  }

  .modal-nav-btn,
  .modal-close {
    border: 3px solid #ffffff;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-track,
  .gallery-item,
  .gallery-item img,
  .modal-nav-btn,
  .modal-close {
    transition: none !important;
  }

  .gallery-item:hover {
    transform: none;
  }

  .loading-shimmer {
    animation: none !important;
  }
}

/* Print Styles */
@media print {
  .gallery-modal,
  .carousel-btn,
  .mobile-nav-dots {
    display: none !important;
  }

  .carousel-track {
    display: block !important;
    transform: none !important;
  }

  .carousel-slide {
    display: block !important;
    min-width: 100% !important;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  .gallery-item::before,
  .gallery-item::after {
    display: none !important;
  }

  .gallery {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .gallery .section-title {
    color: #000000 !important;
    text-shadow: none !important;
  }
}

/* Focus Styles for Accessibility */
.carousel-btn:focus,
.gallery-item:focus,
.modal-nav-btn:focus,
.modal-close:focus,
.nav-dot:focus {
  outline: 3px solid #f97316;
  outline-offset: 2px;
}

/* Keyboard Navigation Indicators */
.gallery-item:focus::before {
  opacity: 0.3;
  border: 3px solid #f97316;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover {
    transform: none;
  }

  .gallery-item::before,
  .gallery-item::after {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }

  .carousel-btn {
    background: rgba(59, 130, 246, 0.95);
  }

  .carousel-btn i {
    color: white;
  }
}
