/**
 * @file
 * Styles for lesson image lightbox.
 */

/* Lightbox overlay */
.lesson-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lesson-lightbox-overlay.active {
  display: flex;
  opacity: 1;
}

/* Lightbox content */
.lesson-lightbox-content {
  position: relative;
  width: 90%;
  height: 90%;
  max-width: 1300px;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Close button */
.lesson-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  z-index: 10001;
  transition: color 0.2s ease;
}

.lesson-lightbox-close:hover,
.lesson-lightbox-close:focus {
  color: #ccc;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Navigation buttons */
.lesson-lightbox-prev,
.lesson-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 15px 12px;
  z-index: 10001;
  transition: all 0.2s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lesson-lightbox-prev {
  left: 20px;
}

.lesson-lightbox-next {
  right: 20px;
}

.lesson-lightbox-prev:hover,
.lesson-lightbox-prev:focus,
.lesson-lightbox-next:hover,
.lesson-lightbox-next:focus {
  background: rgba(0, 0, 0, 0.8);
  border-color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Image counter */
.lesson-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 10001;
}

/* Image wrapper */
.lesson-lightbox-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lightbox image */
.lesson-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Lesson image carousel in sidebar */
.lesson-sidebar .lesson-image,
.sidebar .lesson-image {
  width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

/* Webkit scrollbar styling */
.lesson-sidebar .lesson-image::-webkit-scrollbar,
.sidebar .lesson-image::-webkit-scrollbar {
  height: 6px;
}

.lesson-sidebar .lesson-image::-webkit-scrollbar-track,
.sidebar .lesson-image::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.lesson-sidebar .lesson-image::-webkit-scrollbar-thumb,
.sidebar .lesson-image::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.lesson-sidebar .lesson-image::-webkit-scrollbar-thumb:hover,
.sidebar .lesson-image::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Horizontal layout for images */
.lesson-sidebar .lesson-image .field__items,
.sidebar .lesson-image .field__items {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.lesson-sidebar .lesson-image .field__item,
.sidebar .lesson-image .field__item {
  flex-shrink: 0;
}

.lesson-sidebar .lesson-image img,
.sidebar .lesson-image img {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lesson-sidebar .lesson-image img:hover,
.lesson-sidebar .lesson-image img:focus,
.sidebar .lesson-image img:hover,
.sidebar .lesson-image img:focus {
  opacity: 0.9;
  transform: scale(1.05);
  outline: 2px solid #007bff;
  outline-offset: 2px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .lesson-lightbox-content {
    width: 95%;
    height: 95%;
  }

  .lesson-lightbox-close {
    top: -50px;
    font-size: 1.5rem;
  }

  .lesson-lightbox-prev,
  .lesson-lightbox-next {
    font-size: 1.2rem;
    padding: 12px 10px;
  }

  .lesson-lightbox-prev {
    left: 10px;
  }

  .lesson-lightbox-next {
    right: 10px;
  }

  /* Smaller thumbnails on mobile */
  .lesson-sidebar .lesson-image img,
  .sidebar .lesson-image img {
    width: 100px;
    height: 100px;
  }
}
