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

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

/* Player Container */
#player-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}

#player-container img,
#player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

/* Clase para mostrar elemento con fade-in */
#player-container img.visible,
#player-container video.visible,
#player-container iframe.visible {
  opacity: 1;
}

/* Clase para fade-out */
#player-container img.fade-out,
#player-container video.fade-out,
#player-container iframe.fade-out {
  opacity: 0;
}

/* Registration Screen */
.registration-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.registration-content {
  text-align: center;
  color: white;
  padding: 40px;
}

.registration-content h1 {
  font-size: 48px;
  margin-bottom: 30px;
}

.registration-message {
  font-size: 20px;
  margin-bottom: 30px;
}

.fingerprint-display {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  margin: 30px auto;
  max-width: 600px;
}

.fingerprint-display code {
  font-size: 28px;
  color: #667eea;
  font-weight: 700;
  letter-spacing: 2px;
  word-break: break-all;
  display: block;
}

.registration-hint {
  font-size: 18px;
  margin-top: 20px;
  opacity: 0.9;
}

.loading-spinner {
  margin: 30px auto 0;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

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

/* Success Screen (Registro Exitoso) */
.success-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.success-content {
  text-align: center;
  color: white;
  padding: 40px;
}

.success-icon {
  font-size: 80px;
  margin-bottom: 20px;
  width: 120px;
  height: 120px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
}

.success-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.success-content p {
  font-size: 20px;
  margin-bottom: 10px;
}

.success-content .waiting-text {
  font-size: 18px;
  opacity: 0.9;
  margin-top: 20px;
}

/* Error Screen */
.error-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #dc3545;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.error-content {
  text-align: center;
  color: white;
  padding: 40px;
}

.error-content h2 {
  font-size: 36px;
  margin-bottom: 20px;
}

.error-content p {
  font-size: 18px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* =============================================
   DISPLAY SETTINGS - Fullscreen Button
   ============================================= */

#fullscreen-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fullscreen-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Mostrar boton cuando el mouse esta en cualquier parte de la pagina */
body:hover #fullscreen-btn {
  opacity: 0.3;
}

/* Ocultar boton cuando esta en fullscreen */
body:fullscreen #fullscreen-btn,
body:-webkit-full-screen #fullscreen-btn,
body:-moz-full-screen #fullscreen-btn {
  display: none;
}

/* =============================================
   DISPLAY SETTINGS - Rotation Support
   ============================================= */

/* Soporte para rotacion del contenedor */
#player-container.rotated {
  position: fixed;
  top: 50%;
  left: 50%;
}

#player-container.rotation-0 {
  transform: translate(-50%, -50%) rotate(0deg);
  width: 100vw;
  height: 100vh;
}

#player-container.rotation-90 {
  transform: translate(-50%, -50%) rotate(90deg);
  width: 100vh;
  height: 100vw;
}

#player-container.rotation-180 {
  transform: translate(-50%, -50%) rotate(180deg);
  width: 100vw;
  height: 100vh;
}

#player-container.rotation-270 {
  transform: translate(-50%, -50%) rotate(270deg);
  width: 100vh;
  height: 100vw;
}

/* =============================================
   Fullscreen state styles
   ============================================= */

body:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen {
  background-color: #000;
}

/* Asegurar que contenido llena la pantalla en fullscreen */
:fullscreen #player-container,
:-webkit-full-screen #player-container,
:-moz-full-screen #player-container {
  width: 100vw !important;
  height: 100vh !important;
}
