/* Slideshow Styles */

/* Hide header during slideshow */
body:has(#slideshow-view[style*="display: block"]) header,
body.slideshow-active header {
  display: none;
}

#slideshow-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 100;
}

#slideshow-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
}

#current-photo {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

#current-photo.loaded {
  opacity: 1;
}

#current-photo.fade-out {
  opacity: 0;
}

/* Loading indicator for slideshow */
#slideshow-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

#slideshow-loading .spinner {
  width: 80px;
  height: 80px;
  border-width: 6px;
}

/* Slideshow Controls (TV Remote Navigation) */
.slideshow-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 200;
  padding: 0.75rem;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 80px;
  padding: 1rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.control-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.control-btn:focus {
  background-color: rgba(66, 133, 244, 0.6);
  border-color: #4285f4;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.3);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn .btn-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.control-btn .btn-label {
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Hide controls after inactivity */
.slideshow-controls.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Show controls on interaction */
#slideshow-view:hover .slideshow-controls,
#slideshow-view:focus-within .slideshow-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Hide controls in fullscreen mode */
body.fullscreen .slideshow-controls,
body:fullscreen .slideshow-controls {
  display: none;
}

/* Controls hint - legacy (can be removed) */
.controls-hint {
  display: none;
}

/* Pause indicator */
.pause-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 1.25rem;
  color: #fff;
  z-index: 200;
  display: none;
  backdrop-filter: blur(8px);
}

.pause-indicator.visible {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

.pause-indicator::before {
  content: "⏸";
  margin-right: 0.5rem;
  font-size: 2rem;
}

/* Photo counter */
.photo-counter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #e0e0e0;
  z-index: 200;
  backdrop-filter: blur(8px);
}

/* Transitions */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* TV optimization - reduce animations */
@media (prefers-reduced-motion: reduce) {
  #current-photo {
    transition: opacity 0.1s;
  }
  
  .controls-hint {
    transition: none;
  }
}
