/**
 * Clean Gallery Styles for Zouhal Creations
 * Simple, fast, and reliable
 */

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem 2.5rem;
  padding: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  aspect-ratio: 1;
}

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

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video thumbnails */
.gallery-item video {
  background: #000;
}

/* Video Thumbnail Styles */
.video-thumbnail-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.play-button {
  width: 80px;
  height: 80px;
  background: rgba(245, 227, 129, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.play-icon {
  color: #000;
  font-size: 2rem;
  margin-left: 4px;
  font-weight: bold;
}

.gallery-item:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.gallery-item:hover .play-button {
  transform: scale(1.1);
  background: rgba(245, 227, 129, 1);
}

/* Gallery Filter System */
.gallery-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2rem 1rem 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-label {
  color: #fff;
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-right: 0.5rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--accent-beige, #f5e381);
  border-color: var(--accent-beige, #f5e381);
  color: #000;
  font-weight: 600;
}

/* Filter animations */
.gallery-item {
  transition: all 0.3s ease;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.gallery-item.filter-hide {
  display: none;
}


/* Simple Lightbox */
.simple-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

.simple-lightbox.show {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.lightbox-container {
  position: relative;
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 100001;
  padding: 1rem;
  box-sizing: border-box;
}

.lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s ease;
  display: block;
}

/* Lightbox Controls */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(233, 216, 169, 0.5);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100002;
}

.lightbox-close:hover {
  background: rgba(233, 216, 169, 0.2);
  border-color: var(--accent-beige);
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(233, 216, 169, 0.5);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100002;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(233, 216, 169, 0.2);
  border-color: var(--accent-beige);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  z-index: 100002;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem 1.5rem;
    padding: 1rem;
  }

  .gallery-filters {
    padding: 1rem;
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }


  .lightbox-container {
    width: 95vw;
    height: 95vh;
    max-width: 95vw;
    max-height: 95vh;
    padding: 0.5rem;
  }

  .lightbox-close {
    top: -40px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    left: 15px;
  }

  .lightbox-next {
    right: 15px;
  }

  .lightbox-counter {
    bottom: 15px;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem 1.2rem;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-counter {
    bottom: 10px;
  }
}