/* Grid of Result Boxes */
.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.result-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  border: 2px solid #000;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
}

.result-box span {
  font-size: 18px;
  font-style: italic;
  color: #000;
  text-align: center;
  z-index: 2;
  transition: opacity 0.3s;
}

/* Hover Preview */
.result-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.result-box:hover::before {
  opacity: 0.3;
}

.result-box:hover {
  border-color: #999;
  transform: scale(1.02);
}

.result-box:hover span {
  opacity: 0.8;
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  margin: 0 auto;
}

.lightbox-caption {
  color: #fff;
  text-align: center;
  padding: 15px;
  font-size: 18px;
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.3s;
  z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 50px;
  line-height: 1;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .result-box {
    height: 150px;
  }
  
  .result-box span {
    font-size: 16px;
  }
  
  .lightbox-prev,
  .lightbox-next {
    font-size: 30px;
    padding: 5px 15px;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}