/**
 * Styles for Light-Interactive Sculpture Video Display
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow: hidden;
  background-color: #000;
  color: #fff;
}

/* Video container - fullscreen */
#video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video elements - Multi-channel approach */
.video-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;

  /* All videos visible but layered with z-index */
  display: block;
  opacity: 1;
  z-index: 1;

  /* GPU acceleration for Raspberry Pi 4 */
  will-change: opacity;
  backface-visibility: hidden;

  /* Smooth opacity transitions */
  transition: opacity 0.3s ease-in-out;
  transform-origin: center center;
}

/* Rotation classes */
.video-element.rotate-90 {
  position: absolute;
  transform: rotate(90deg);
  transform-origin: bottom left;
  width: 100vh;
  height: 100vw;
  margin-top: -100vw;
}

.video-element.rotate-180 {
  transform: rotate(180deg);
}

.video-element.rotate-270 {
  position: absolute;
  transform: rotate(270deg);
  transform-origin: top right;
  width: 100vh;
  height: 100vw;
  margin-left: -100vh;
}

/* Ensure video covers entire screen when in fullscreen */
#video-container:fullscreen .video-element,
#video-container:-webkit-full-screen .video-element {
  object-fit: cover;
}

/* Debug overlay */
.debug-overlay {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #0f0;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  z-index: 1000;
  min-width: 250px;
  border: 2px solid #0f0;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.debug-overlay h3 {
  margin-bottom: 10px;
  color: #0f0;
  text-transform: uppercase;
  font-size: 16px;
  border-bottom: 1px solid #0f0;
  padding-bottom: 5px;
}

.debug-overlay p {
  margin: 8px 0;
  line-height: 1.4;
}

.debug-overlay strong {
  color: #0ff;
  display: inline-block;
  min-width: 60px;
}

.debug-overlay hr {
  margin: 15px 0;
  border: none;
  border-top: 1px solid #0f0;
}

.debug-overlay kbd {
  background-color: #222;
  border: 1px solid #0f0;
  border-radius: 3px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  color: #0f0;
  display: inline-block;
  min-width: 30px;
  text-align: center;
}

.debug-info {
  user-select: none;
}

/* Loading screen */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading p {
  margin-top: 20px;
  font-size: 18px;
  color: #fff;
}

/* Spinner animation */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error display */
.error {
  background-color: rgba(255, 0, 0, 0.1);
  border: 2px solid #f00;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  text-align: center;
}

.error h2 {
  color: #f00;
  margin-bottom: 15px;
  font-size: 24px;
}

.error p {
  margin: 10px 0;
  color: #fff;
  line-height: 1.6;
}

/* Hide cursor in fullscreen (production mode) */
#video-container:fullscreen {
  cursor: none;
}

#video-container:-webkit-full-screen {
  cursor: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .debug-overlay {
    font-size: 12px;
    padding: 15px;
    min-width: 200px;
  }

  .debug-overlay h3 {
    font-size: 14px;
  }
}

/* Print styles (hide everything) */
@media print {
  body {
    display: none;
  }
}

/* Prevent text selection in production */
body.production {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Accessibility - focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #0f0;
  outline-offset: 2px;
}
