* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #0a0a0f;
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --accent-color: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --control-bg: rgba(255, 255, 255, 0.1);
  --control-hover: rgba(255, 255, 255, 0.2);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
}

#slideshow-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
}

/* Slide */
.slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s var(--transition-smooth);
}

.slide.active {
  opacity: 1;
}

.slide img,
.slide video {
  max-width: 100%;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 80px var(--accent-glow);
  transition: transform 0.5s var(--transition-smooth);
}

.slide img:hover,
.slide video:hover {
  transform: scale(1.02);
}

/* Loading State */
.loading {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--control-bg);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading p {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* No Images State */
.no-images {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
  background: var(--overlay-bg);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.no-images .icon {
  font-size: 64px;
  margin-bottom: 8px;
}

.no-images h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.no-images p {
  color: var(--text-secondary);
  font-size: 14px;
}

.no-images code {
  background: var(--control-bg);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: "SF Mono", Monaco, monospace;
  color: var(--accent-color);
}

/* Controls - Only fullscreen button visible */
.controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  transform: none;
  display: flex;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  opacity: 0;
  transition: opacity 0.3s var(--transition-smooth);
  z-index: 100;
}

#slideshow-container:hover .controls {
  opacity: 1;
}

/* Hide all controls except fullscreen */
#prev-btn,
#next-btn,
#pause-btn,
.progress-container {
  display: none !important;
}

.control-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--control-bg);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
}

.control-btn:hover {
  background: var(--accent-color);
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

/* Progress Bar */
.progress-container {
  width: 150px;
  height: 4px;
  background: var(--control-bg);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), #a855f7);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Image Counter */
.image-counter {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 8px 16px;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.3s var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

#slideshow-container:hover .image-counter {
  opacity: 1;
}

/* Fullscreen styles */
:fullscreen #slideshow-container,
:-webkit-full-screen #slideshow-container {
  background: var(--bg-color);
}

/* Responsive */
@media (max-width: 768px) {
  .controls {
    bottom: 20px;
    padding: 10px 16px;
    gap: 12px;
  }

  .control-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .progress-container {
    width: 100px;
  }

  .slide img,
  .slide video {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Fade transition */
.fade-out {
  animation: fadeOut 0.4s var(--transition-smooth) forwards;
}

.fade-in {
  animation: fadeIn 0.4s var(--transition-smooth) forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
