/**
 * Gallery Modal Styles
 *
 * @package GeneratePress Child
 */

/* Modal Overlay */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.gallery-modal.active {
  display: flex;
  opacity: 1;
}

.gallery-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

.gallery-modal__container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

/* Header */
.gallery-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0 2rem;
}

.gallery-modal__title {
  color: white;
  font-family: var(--gp-font--roboto, Roboto, sans-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
}

.gallery-modal__close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  width: 44px;
  height: 44px;
}

.gallery-modal__close:hover {
  opacity: 0.7;
}

.gallery-modal__close svg {
  width: 32px;
  height: 32px;
}

/* Main Content */
.gallery-modal__content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.gallery-modal__main-image {
  position: relative;
  width: 100%;
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0 1rem;
}

.gallery-modal__main-image img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 12px;
}

.gallery-modal__counter {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: var(--gp-font--roboto, Roboto, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Navigation Arrows */
.gallery-modal__nav {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.gallery-modal__nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.gallery-modal__nav svg {
  width: 40px;
  height: 40px;
}

/* Thumbnails */
.gallery-modal__thumbnails {
  display: flex;
  gap: 1rem;
  padding: 0 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  padding-bottom: 1rem;
}

.gallery-modal__thumbnails::-webkit-scrollbar {
  height: 8px;
}

.gallery-modal__thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-modal__thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.gallery-modal__thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.gallery-modal__thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.gallery-modal__thumbnail:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.gallery-modal__thumbnail.active {
  border-color: white;
  opacity: 1;
}

.gallery-modal__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Clickable Gallery Images - Add cursor pointer */
.immobilie__main-image.gallery-clickable,
.immobilie__image2-wrapper.gallery-clickable,
.immobilie__image3.gallery-clickable,
.immobilie__image4.gallery-clickable {
  cursor: pointer;
  position: relative;
}

.immobilie__main-image.gallery-clickable::after,
.immobilie__image2-wrapper.gallery-clickable::after,
.immobilie__image3.gallery-clickable::after,
.immobilie__image4.gallery-clickable::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
}

.immobilie__main-image.gallery-clickable:hover::after,
.immobilie__image2-wrapper.gallery-clickable:hover::after,
.immobilie__image3.gallery-clickable:hover::after,
.immobilie__image4.gallery-clickable:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .gallery-modal__container {
    padding: 1.5rem;
  }

  .gallery-modal__header {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  .gallery-modal__title {
    font-size: 1.25rem;
  }

  .gallery-modal__main-image {
    height: 65vh;
  }

  .gallery-modal__nav {
    width: 56px;
    height: 56px;
    padding: 0.75rem;
  }

  .gallery-modal__nav svg {
    width: 32px;
    height: 32px;
  }

  .gallery-modal__thumbnails {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .gallery-modal__thumbnail {
    width: 100px;
    height: 67px;
  }
}

@media (max-width: 768px) {
  .gallery-modal__container {
    padding: 1rem;
  }

  .gallery-modal__header {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
  }

  .gallery-modal__title {
    font-size: 1rem;
  }

  .gallery-modal__close {
    width: 36px;
    height: 36px;
  }

  .gallery-modal__close svg {
    width: 24px;
    height: 24px;
  }

  .gallery-modal__content {
    margin-bottom: 1rem;
    position: relative;
  }

  .gallery-modal__main-image {
    height: 60vh;
    margin: 0;
  }

  .gallery-modal__main-image img {
    border-radius: 8px;
  }

  .gallery-modal__counter {
    bottom: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .gallery-modal__nav {
    width: 48px;
    height: 48px;
    padding: 0.5rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .gallery-modal__nav--prev {
    left: 0.5rem;
  }

  .gallery-modal__nav--next {
    right: 0.5rem;
  }

  .gallery-modal__nav svg {
    width: 24px;
    height: 24px;
  }

  .gallery-modal__thumbnails {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }

  .gallery-modal__thumbnail {
    width: 80px;
    height: 53px;
    border-width: 2px;
  }
}
