/**
 * Nebulight Interactive Slideshow
 * A modern, responsive, and accessible slideshow component
 * 
 * @version 1.0.0
 * @author AmbientPixels
 */

/* ===== Nebulight Container ===== */
.nebulight-container {
  --nebulight-primary: var(--aura-accent, #7f57ff);
  --nebulight-secondary: var(--aura-highlight, #5ac8fa);
  --nebulight-text: var(--aura-fg, #ffffff);
  --nebulight-bg: var(--aura-bg, #121212);
  --nebulight-overlay: rgba(0, 0, 0, 0.75);
  --nebulight-border: rgba(255, 255, 255, 0.1);
  --nebulight-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --nebulight-radius: 8px;
  --nebulight-transition: all 0.3s ease;
  --nebulight-control-size: 40px;
  --nebulight-caption-bg: rgba(0, 0, 0, 0.7);
  --nebulight-progress-height: 4px;
  --nebulight-thumbnail-size: 60px;
  --nebulight-icon-size: 1.2rem;
  
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background-color: var(--nebulight-bg);
  border-radius: var(--nebulight-radius);
  box-shadow: var(--nebulight-shadow);
  color: var(--nebulight-text);
}

/* Light theme variables */
[data-theme="light"] .nebulight-container,
.nebulight-container[data-theme="light"] {
  --nebulight-primary: #6200ee;
  --nebulight-secondary: #03dac6;
  --nebulight-text: #121212;
  --nebulight-bg: #ffffff;
  --nebulight-overlay: rgba(255, 255, 255, 0.9);
  --nebulight-border: rgba(0, 0, 0, 0.1);
  --nebulight-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --nebulight-caption-bg: rgba(255, 255, 255, 0.9);
}

/* ===== Slideshow Stage ===== */
.nebulight-stage {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* Default 16:9 aspect ratio */
  overflow: hidden;
}

.nebulight-stage[data-aspect-ratio="4:3"] {
  padding-bottom: 75%; /* 4:3 aspect ratio */
}

.nebulight-stage[data-aspect-ratio="1:1"] {
  padding-bottom: 100%; /* 1:1 aspect ratio (square) */
}

.nebulight-stage[data-aspect-ratio="21:9"] {
  padding-bottom: 42.85%; /* 21:9 aspect ratio (ultrawide) */
}

/* ===== Slides ===== */
.nebulight-slides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform var(--nebulight-transition);
}

.nebulight-slide {
  position: relative;
  min-width: 100%;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--nebulight-transition);
  overflow: hidden;
}

.nebulight-slide.active {
  opacity: 1;
  z-index: 1;
}

.nebulight-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.nebulight-slide:hover img {
  transform: scale(1.02);
}

/* ===== Captions ===== */
.nebulight-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: var(--nebulight-caption-bg);
  color: var(--nebulight-text);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nebulight-slide.active .nebulight-caption,
.nebulight-slide:hover .nebulight-caption {
  transform: translateY(0);
}

.nebulight-caption-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.nebulight-caption-text {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ===== Controls ===== */
.nebulight-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nebulight-container:hover .nebulight-controls {
  opacity: 1;
}

.nebulight-nav-button {
  width: var(--nebulight-control-size);
  height: var(--nebulight-control-size);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nebulight-nav-button:hover {
  background: var(--nebulight-primary);
  transform: scale(1.1);
}

.nebulight-nav-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(127, 87, 255, 0.5);
}

.nebulight-nav-button i {
  font-size: var(--nebulight-icon-size);
}

/* ===== Control Bar ===== */
.nebulight-control-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nebulight-play-button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.nebulight-play-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nebulight-counter {
  margin-left: 1rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.nebulight-fullscreen-button {
  margin-left: auto;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.nebulight-fullscreen-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Progress Bar ===== */
.nebulight-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nebulight-progress-height);
  background: rgba(255, 255, 255, 0.2);
  z-index: 5;
}

.nebulight-progress-bar {
  height: 100%;
  background: var(--nebulight-primary);
  width: 0;
  transition: width 0.1s linear;
}

/* ===== Thumbnails ===== */
.nebulight-thumbnails {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--nebulight-primary) rgba(0, 0, 0, 0.2);
}

.nebulight-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.nebulight-thumbnails::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.nebulight-thumbnails::-webkit-scrollbar-thumb {
  background-color: var(--nebulight-primary);
  border-radius: 4px;
}

.nebulight-thumbnail {
  width: var(--nebulight-thumbnail-size);
  height: var(--nebulight-thumbnail-size);
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.nebulight-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nebulight-thumbnail.active {
  border-color: var(--nebulight-primary);
  transform: scale(1.05);
}

.nebulight-thumbnail:hover {
  transform: translateY(-2px);
}

/* ===== Transitions ===== */
/* Fade transition */
.nebulight-container[data-transition="fade"] .nebulight-slide {
  opacity: 0;
  transition: opacity 0.8s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.nebulight-container[data-transition="fade"] .nebulight-slide.active {
  opacity: 1;
  z-index: 1;
}

/* Slide transition */
.nebulight-container[data-transition="slide"] .nebulight-slides {
  display: flex;
  transition: transform 0.8s ease;
}

.nebulight-container[data-transition="slide"] .nebulight-slide {
  opacity: 1;
  flex-shrink: 0;
  width: 100%;
}

/* Zoom transition */
.nebulight-container[data-transition="zoom"] .nebulight-slide {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.nebulight-container[data-transition="zoom"] .nebulight-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

/* ===== NDA Overlays ===== */
.nebulight-slide[data-overlay="true"] {
  position: relative;
}

/* Red glass overlay */
.nebulight-slide[data-overlay-type="nda-red"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 0, 0, 0.2);
  z-index: 2;
  pointer-events: none;
}

/* Blur effect */
.nebulight-slide[data-overlay="true"] img {
  filter: blur(8px);
}

.nebulight-slide[data-blur="15"] img {
  filter: blur(15px);
}

.nebulight-slide[data-blur="25"] img {
  filter: blur(25px);
}

.nebulight-slide[data-blur="45"] img {
  filter: blur(45px);
}

/* NDA Message */
.nebulight-overlay-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 1rem 2rem;
  border-radius: 30px;
  text-align: center;
  z-index: 3;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.nebulight-overlay-message i {
  display: block;
  font-size: 2em;
  margin-bottom: 0.5rem;
  color: var(--nebulight-secondary);
}

/* ===== Fullscreen Mode ===== */
.nebulight-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
}

.nebulight-container.fullscreen .nebulight-stage {
  height: 100vh;
  padding-bottom: 0;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .nebulight-caption {
    padding: 0.75rem;
  }
  
  .nebulight-caption-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  
  .nebulight-caption-text {
    font-size: 0.85rem;
  }
  
  .nebulight-nav-button {
    width: 36px;
    height: 36px;
    margin: 0 0.5rem;
  }
  
  .nebulight-thumbnail {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .nebulight-caption {
    padding: 0.5rem;
  }
  
  .nebulight-nav-button {
    width: 32px;
    height: 32px;
  }
  
  .nebulight-thumbnail {
    width: 40px;
    height: 40px;
  }
  
  .nebulight-control-bar {
    padding: 0.25rem 0.5rem;
  }
}

/* ===== Accessibility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for keyboard navigation */
.nebulight-nav-button:focus-visible,
.nebulight-play-button:focus-visible,
.nebulight-fullscreen-button:focus-visible,
.nebulight-thumbnail:focus-visible {
  outline: 2px solid var(--nebulight-primary);
  outline-offset: 2px;
}

/* ===== Animation Keyframes ===== */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Apply animations */
.nebulight-slide.active {
  animation: fadeIn 0.5s ease forwards;
}

.nebulight-slide.active .nebulight-caption {
  animation: slideIn 0.5s ease 0.2s forwards;
}

.nebulight-container[data-autoplay="true"] .nebulight-play-button {
  animation: pulse 2s infinite;
}
