/**
 * Modern Fullscreen Mode - Immersive experience
 */

@import './design-system.css';

/* Fullscreen active state */
.fullscreen-active .header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: var(--z-sticky);
  pointer-events: none;
}

.fullscreen-active .header:hover,
.fullscreen-active .header:focus-within {
  opacity: 1;
  pointer-events: all;
}

.fullscreen-active .viewer {
  height: 100vh;
  padding: 0;
}

.fullscreen-active .slide-image {
  border-radius: 0;
  box-shadow:
    0 0 120px rgba(99, 102, 241, 0.15),
    0 0 60px rgba(168, 85, 247, 0.1);
}

/* Mobile fullscreen */
.mobile-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  z-index: calc(var(--z-modal) + 10) !important;
  background: var(--bg-primary) !important;
  overflow: hidden !important;
}

.mobile-fullscreen .header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-modal) + 20);
  opacity: 0;
  transition: opacity var(--transition-base);
  background: linear-gradient(
    180deg,
    rgba(10, 10, 15, 0.95) 0%,
    rgba(10, 10, 15, 0.8) 60%,
    transparent 100%
  ) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
}

.mobile-fullscreen .header.show-temp {
  opacity: 1 !important;
  pointer-events: all;
}

.mobile-fullscreen .viewer {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--bg-primary) !important;
  z-index: calc(var(--z-modal) + 11);
}

.mobile-fullscreen .slide-image {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
  background: var(--bg-primary) !important;
  border-radius: 0 !important;
}

/* Fullscreen controls overlay */
.fullscreen-controls {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: calc(var(--z-modal) + 15);
  pointer-events: none;
}

.fullscreen-active .fullscreen-controls,
.mobile-fullscreen .fullscreen-controls {
  opacity: 1;
  pointer-events: all;
}

.fullscreen-controls .control-btn {
  background: linear-gradient(
    135deg,
    rgba(30, 30, 36, 0.95),
    rgba(20, 20, 25, 0.9)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.fullscreen-controls .control-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(40, 40, 48, 0.98),
    rgba(30, 30, 36, 0.95)
  );
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.fullscreen-controls .control-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Fullscreen exit hint */
.fullscreen-hint {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(30, 30, 36, 0.95),
    rgba(20, 20, 25, 0.9)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: calc(var(--z-modal) + 20);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.fullscreen-hint.show {
  opacity: 1;
  animation: hintPulse 0.4s ease;
}

@keyframes hintPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

/* Fade in/out animation for fullscreen */
.fullscreen-active {
  animation: fadeIn 0.3s ease;
}

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

/* Hide scrollbars in fullscreen */
.fullscreen-active *::-webkit-scrollbar,
.mobile-fullscreen *::-webkit-scrollbar {
  display: none;
}

/* Double-tap hint (mobile) */
@media (max-width: 768px) {
  .fullscreen-controls {
    bottom: 24px;
    gap: 16px;
  }

  .fullscreen-controls .control-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .fullscreen-hint {
    font-size: 14px;
    padding: 14px 28px;
    top: 20px;
  }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-width: 896px) {
  .fullscreen-controls {
    bottom: 16px;
  }

  .fullscreen-hint {
    top: 16px;
  }
}
