/**
 * Modern Viewer Styles - Enhanced with depth and effects
 */

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

.viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  padding: 0;          /* edge-to-edge — no wasted space */
  overflow: hidden;
}

/* Slide image — fills all available space, no decorations */
.slide-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;

  /* GPU acceleration */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  /* No shadow, no radius — every pixel counts for back-of-room viewing */
  box-shadow: none;
  border-radius: 0;
  border: none;
  transition: opacity 0.15s ease;
}

/* Placeholder screen */
.placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.placeholder img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  opacity: 0.25;
  filter: blur(8px) grayscale(0.5);
  border-radius: var(--radius-xl);
}

/* Modern message card with glassmorphism */
.placeholder-message {
  position: absolute;
  max-width: min(500px, 85%);
  text-align: center;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  padding: 32px 40px;
  border-radius: var(--radius-xl);

  /* Glassmorphism effect */
  background: linear-gradient(
    135deg,
    rgba(30, 30, 36, 0.85),
    rgba(20, 20, 25, 0.75)
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  /* Gradient border */
  border: 1px solid;
  border-image: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.3),
    rgba(168, 85, 247, 0.3)
  ) 1;

  /* Layered shadows */
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.3),
    0 12px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Animated entrance */
  animation: messageFloat 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Add subtle animation to message */
.placeholder-message::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-base);
}

.placeholder-message:hover::before {
  opacity: 0.15;
}

/* Status message styling */
.placeholder-message .status {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Loading spinner for transitions */
.viewer.loading::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border: 3px solid transparent;
  border-top-color: var(--primary-500);
  border-right-color: var(--accent-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Waiting state animations */
.placeholder-blur {
  opacity: 0.2 !important;
  filter: blur(12px) grayscale(0.6) !important;
}

.placeholder-message.waiting-state {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.3),
      0 12px 24px rgba(0, 0, 0, 0.2),
      0 0 40px rgba(99, 102, 241, 0.15);
  }
  50% {
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.35),
      0 12px 24px rgba(0, 0, 0, 0.25),
      0 0 60px rgba(99, 102, 241, 0.3);
  }
}

.waiting-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary-500, #6366f1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.message-text {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary, #fff);
}

.message-subtext {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-tertiary, #888);
  font-weight: 400;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .viewer {
    padding: 12px;
  }

  .slide-image {
    border-radius: var(--radius-md);
  }

  .placeholder-message {
    max-width: 90%;
    font-size: 18px;
    padding: 24px 28px;
    border-radius: var(--radius-lg);
  }

  .spinner-ring {
    width: 40px;
    height: 40px;
  }

  .message-text {
    font-size: 18px;
  }

  .message-subtext {
    font-size: 13px;
  }
}
