/* Gallery Styles */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

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

.gallery-thumbnail-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: hidden;
  width: 100%;
  height: 0;
  transition: height 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .gallery-overlay {
  height: 40px;
}

.gallery-view {
  color: white;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background-color: #f5f5f5;
  border-radius: 8px;
  color: #666;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.modal-content {
  position: relative;
  background-color: #fefefe;
  margin: auto;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: white;
  font-size: 28px;
  font-weight: bold;
  z-index: 10;
  cursor: pointer;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.close-modal:hover {
  color: #ccc;
}

.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%) scale(1.1);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-image-container {
  overflow: auto;
  max-height: calc(90vh - 70px);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
}

#modalImage {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.modal-footer {
  padding: 15px;
  text-align: center;
  background-color: #f8f8f8;
  border-top: 1px solid #ddd;
}

.modal-download-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.modal-download-btn:hover {
  background-color: #45a049;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .gallery-thumbnail {
    height: 150px;
  }
  
  .modal-content {
    max-width: 95%;
  }
  
  .modal-footer {
    padding: 10px;
  }
  
  .modal-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .modal-prev {
    left: 10px;
  }
  
  .modal-next {
    right: 10px;
  }
}