/**
 * Photo Gallery Styles
 *
 * Styles for the photo gallery component, including the image capturer and user gallery
 * with different layouts and responsive behavior.
 */

/* Image Capturer Styles */
.image-capture-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s;
  z-index: 100;
}

.image-capture-button:hover {
  background-color: rgba(0, 0, 0, 0.9);
}

.image-capture-button .icon {
  margin-right: 5px;
  font-size: 16px;
  font-weight: bold;
}

.capture-feedback {
  animation: feedback-fade 1.5s ease-in-out;
}

@keyframes feedback-fade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* User Gallery Styles */
.user-gallery {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.gallery-controls {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: 10px;
  border: 3px solid #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gallery-loading,
.gallery-error {
  text-align: center;
  padding: 50px 20px;
  font-size: 16px;
  color: #666;
}

.gallery-error {
  color: #d32f2f;
}

.gallery-error button {
  margin-top: 15px;
  padding: 8px 16px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.gallery-item-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-item-actions {
  opacity: 1;
}

.gallery-item-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.gallery-item-actions button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.download-button {
  background-color: rgba(0, 128, 0, 0.6) !important;
}

.download-button:hover {
  background-color: rgba(0, 128, 0, 0.8) !important;
}

.delete-button {
  background-color: rgba(220, 0, 0, 0.6) !important;
}

.delete-button:hover {
  background-color: rgba(220, 0, 0, 0.8) !important;
}

.gallery-item.deleting {
  opacity: 0.5;
  pointer-events: none;
}

/* Carousel Layout - Matching lore pages */
.carousel-section {
  margin: 2rem 0;
  padding: 0 20px;
}

.carousel {
  width: 100%;
  position: relative;
  margin: 0 auto;
}

.carousel .slick-slide {
  padding: 0 10px;
}

.carousel .slick-slide div {
  outline: none;
}

.carousel img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.3s ease;
  display: block !important;
}

.carousel img:hover {
  transform: scale(1.05);
}

/* Slick carousel navigation dots */
.carousel .slick-dots {
  bottom: -30px;
}

.carousel .slick-dots li button:before {
  font-size: 12px;
  color: #666;
}

.carousel .slick-dots li.slick-active button:before {
  color: #333;
}

/* Slick carousel arrows */
.carousel .slick-prev,
.carousel .slick-next {
  z-index: 1;
  width: 40px;
  height: 40px;
}

.carousel .slick-prev {
  left: -40px;
}

.carousel .slick-next {
  right: -40px;
}

.carousel .slick-prev:before,
.carousel .slick-next:before {
  font-size: 40px;
  color: #666;
}

.carousel-caption {
  margin-top: 15px;
  color: #333;
  text-align: center;
  max-width: 80%;
}

/* Screensaver Button */
.layout-button,
.action-button,
.screensaver-button {
  padding: 8px 16px;
  background-color: #4a90e2;
  color: white;
  border: 2px solid #333;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'AnimeAce', Arial, sans-serif;
  font-size: 14px;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.layout-button:hover,
.action-button:hover,
.screensaver-button:hover {
  background-color: #357abf;
  transform: translateY(-2px);
}

.layout-button.active {
  background-color: #2c5e8c;
}

.action-button.delete-button {
  background-color: #ff4d4d;
}

.action-button.delete-button:hover {
  background-color: #e60000;
}

.action-button.download-button {
  background-color: #4caf50;
}

.action-button.download-button:hover {
  background-color: #388e3c;
}

.action-button.screensaver-button {
  background-color: #ff9800;
}

.action-button.screensaver-button:hover {
  background-color: #f57c00;
}

/* Gallery Container */
.photo-gallery {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

/* Empty Gallery State */
.gallery-empty {
  text-align: center;
  padding: 50px;
  font-family: 'AnimeAce', Arial, sans-serif;
  font-size: 18px;
  color: #666;
}

/* Grid Layout */
.layout-grid .gallery-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-gap: 20px;
  margin-top: 30px;
}

/* Gallery Items */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s;
  cursor: pointer;
}

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

/* Image Captions */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem;
  font-size: 0.9rem;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  color: white;
  padding: 1rem;
  text-align: center;
  max-width: 100%;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 2rem;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .layout-grid .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .gallery-item img {
    height: 150px;
  }
  
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .layout-grid .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-gap: 0.5rem;
  }
  
  .gallery-item img {
    height: 120px;
  }
}