/* Futura Gallery Section - Beautiful Modern Grid Layout */

#galerija.elementor-element-futura-gallery {
  padding: 120px 0 !important;
  background: #ffffff !important;
  position: relative;
  overflow: hidden;
}

#galerija.elementor-element-futura-gallery::before {
  display: none !important;
}

#galerija .e-con-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px;
  position: relative;
  z-index: 1;
}

/* Gallery container wrapper */
.futura-gallery-grid-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Gallery Header */
#galerija .elementor-element-futura-gallery-header {
  margin-bottom: 70px;
  text-align: center;
}

#galerija .ht-subtitle h6 {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 12px 28px;
  background: linear-gradient(135deg, rgba(53, 114, 194, 0.1) 0%, rgba(79, 175, 230, 0.1) 100%);
  border: 1px solid rgba(53, 114, 194, 0.2);
  border-radius: 30px;
  color: var(--futura-primary);
  margin-bottom: 24px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(53, 114, 194, 0.1);
}

#galerija .theme-title h2 {
  font-size: 52px;
  line-height: 1.15;
  color: #141111;
  font-weight: 800;
  margin-bottom: 0;
  letter-spacing: -0.8px;
}

#galerija .theme-title h2 .title-sub {
  color: var(--futura-primary);
  font-style: italic;
  font-weight: 600;
}

/* Gallery Slider - 2 Rows Layout */
.futura-gallery-swiper-2rows {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0 60px;
  overflow: hidden;
  position: relative;
}

.futura-gallery-swiper-2rows .swiper-wrapper {
  display: flex !important;
  flex-wrap: wrap;
  height: auto !important;
  width: auto !important;
}

.futura-gallery-swiper-2rows .swiper-slide {
  width: calc(25% - 18px) !important;
  height: auto !important;
  margin: 0 9px 24px 9px !important;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Responsive slide widths */
@media (min-width: 992px) and (max-width: 1199px) {
  .futura-gallery-swiper-2rows .swiper-slide {
    width: calc(33.333% - 14px) !important;
    margin: 0 7px 20px 7px !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .futura-gallery-swiper-2rows .swiper-slide {
    width: calc(50% - 9px) !important;
    margin: 0 4.5px 18px 4.5px !important;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .futura-gallery-swiper-2rows .swiper-slide {
    width: calc(50% - 9px) !important;
    margin: 0 4.5px 18px 4.5px !important;
  }
}

@media (max-width: 575px) {
  .futura-gallery-swiper-2rows .swiper-slide {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
  }
}

/* Varied heights for visual interest */
.futura-gallery-item:nth-child(3n+1) {
  grid-row: span 1;
}

.futura-gallery-item:nth-child(3n+2) {
  grid-row: span 1;
}

.futura-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.futura-gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--futura-primary) 0%, var(--futura-accent) 100%);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  border-radius: 20px;
}

.futura-gallery-item:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 70px rgba(53, 114, 194, 0.25);
  border-color: rgba(53, 114, 194, 0.3);
}

.futura-gallery-item:hover::before {
  opacity: 0.15;
}

.futura-gallery-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  z-index: 2;
}

.futura-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  filter: brightness(1) contrast(1);
}

.futura-gallery-item:hover img {
  transform: scale(1.15);
  filter: brightness(1.1) contrast(1.05);
}

.futura-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(53, 114, 194, 0.9) 0%, rgba(79, 175, 230, 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  z-index: 3;
}

.futura-gallery-item:hover .futura-gallery-overlay {
  opacity: 1;
}

.futura-gallery-overlay i {
  font-size: 56px;
  color: #ffffff;
  transform: scale(0) rotate(-180deg);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.futura-gallery-item:hover .futura-gallery-overlay i {
  transform: scale(1) rotate(0deg);
}

/* Additional polish */
.futura-gallery-item::after {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.futura-gallery-item:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Swiper Navigation */
.futura-gallery-swiper-2rows .swiper-button-prev,
.futura-gallery-swiper-2rows .swiper-button-next {
  width: 50px;
  height: 50px;
  background: #ffffff;
  border: 2px solid rgba(53, 114, 194, 0.2);
  border-radius: 50%;
  color: var(--futura-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
}

.futura-gallery-swiper-2rows .swiper-button-prev:hover,
.futura-gallery-swiper-2rows .swiper-button-next:hover {
  background: var(--futura-primary);
  color: #ffffff;
  border-color: var(--futura-primary);
  box-shadow: 0 12px 35px rgba(53, 114, 194, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.futura-gallery-swiper-2rows .swiper-button-prev::after,
.futura-gallery-swiper-2rows .swiper-button-next::after {
  font-size: 20px;
  font-weight: 700;
}

.futura-gallery-swiper-2rows .swiper-button-prev {
  left: -25px;
}

.futura-gallery-swiper-2rows .swiper-button-next {
  right: -25px;
}

.futura-gallery-swiper-2rows .swiper-button-prev.swiper-button-disabled,
.futura-gallery-swiper-2rows .swiper-button-next.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Pagination */
.futura-gallery-swiper-2rows .swiper-pagination {
  bottom: 0;
  position: relative;
  margin-top: 30px;
}

.futura-gallery-swiper-2rows .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: rgba(53, 114, 194, 0.3);
  opacity: 1;
  transition: all 0.3s ease;
}

.futura-gallery-swiper-2rows .swiper-pagination-bullet-active {
  background: var(--futura-primary);
  width: 30px;
  border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .futura-gallery-swiper-2rows .swiper-wrapper {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  
  .futura-gallery-swiper-2rows .swiper-button-prev {
    left: -15px;
  }
  
  .futura-gallery-swiper-2rows .swiper-button-next {
    right: -15px;
  }
}

@media (max-width: 991px) {
  #galerija.elementor-element-futura-gallery {
    padding: 100px 0 !important;
  }
  
  #galerija .elementor-element-futura-gallery-header {
    margin-bottom: 60px;
  }
  
  #galerija .theme-title h2 {
    font-size: 42px;
  }
  
  .futura-gallery-swiper-2rows .swiper-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  
  .futura-gallery-swiper-2rows .swiper-button-prev,
  .futura-gallery-swiper-2rows .swiper-button-next {
    width: 45px;
    height: 45px;
  }
  
  .futura-gallery-swiper-2rows .swiper-button-prev {
    left: -10px;
  }
  
  .futura-gallery-swiper-2rows .swiper-button-next {
    right: -10px;
  }
  
  .futura-gallery-overlay i {
    font-size: 48px;
  }
}

@media (max-width: 767px) {
  #galerija.elementor-element-futura-gallery {
    padding: 80px 0 !important;
  }
  
  #galerija .e-con-inner {
    padding: 0 30px;
  }
  
  .futura-gallery-grid-container {
    max-width: 100%;
  }
  
  .futura-gallery-grid-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
  }
  
  .futura-gallery-item {
    border-radius: 16px;
  }
  
  .futura-gallery-link {
    border-radius: 16px;
  }
  
  .futura-gallery-item img {
    border-radius: 16px;
  }
  
  .futura-gallery-overlay {
    border-radius: 16px;
  }
  
  .futura-gallery-overlay i {
    font-size: 40px;
  }
}

@media (max-width: 575px) {
  #galerija.elementor-element-futura-gallery {
    padding: 60px 0 !important;
  }
  
  #galerija .elementor-element-futura-gallery-header {
    margin-bottom: 50px;
  }
  
  #galerija .theme-title h2 {
    font-size: 32px;
  }
  
  .futura-gallery-swiper-2rows .swiper-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .futura-gallery-item {
    aspect-ratio: 16 / 10;
    border-radius: 16px;
  }
  
  .futura-gallery-item:hover {
    transform: translateY(-6px) scale(1.01);
  }
  
  .futura-gallery-overlay i {
    font-size: 36px;
  }
}
