/* Estilos para animación 3D móvil de BUENA SEÑAL */

/* Loading spinner móvil */
.bs-3d-mobile-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.bs-3d-mobile-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #000;
  border-radius: 50%;
  animation: bs-mobile-spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes bs-mobile-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.bs-3d-mobile-loading p {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Texto de instrucción con efecto fade */
.bs-3d-mobile-instruction {
  text-align: center;
  opacity: 0;
  animation: bs-mobile-fade-in-out 3s ease-in-out infinite;
  position: absolute;
  left: 0;
  right: 0;
}

.bs-3d-mobile-instruction p {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #666;
  margin: 0;
  white-space: nowrap;
}

@keyframes bs-mobile-fade-in-out {
  0% {
    opacity: .3;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: .3;
  }
}

/* Contenedor principal móvil */
.bs-3d-animation-mobile {
  position: relative;
  overflow: hidden;

  @media (width >=1024px) {
    display: none;
  }
}

/* Modal móvil */
#bs-3d-mobile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;

  .modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;

    @media (width >=768px) {
      margin: 10px;
      padding: 25px;
      max-width: none;
      border-radius: 8px;
    }
  }

  #mobile-modal-letter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 48px;
    font-weight: 400;
    color: #000;
    text-align: center;
    margin-bottom: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e0e0e0;

    @media (width >=768px) {
      font-size: 48px;
      padding: 20px;
    }
  }

  #mobile-modal-title {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    @media (width >=768px) {
      font-size: 18px;
      margin-bottom: 20px;
    }
  }

  #mobile-modal-description {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;

    @media (width >=768px) {
      font-size: 14px;
      margin-bottom: 30px;
    }
  }

  #mobile-modal-close {
    width: 100%;
    padding: 15px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 1001;
    position: relative;

    @media (width >=768px) {
      padding: 15px;
      font-size: 14px;
    }
  }

  #mobile-modal-close:hover {
    background: #333;
    transform: translateY(-2px);

    @media (width >=768px) {
      background: #333;
      transform: translateY(-2px);
    }
  }

  #mobile-modal-close:active {
    transform: translateY(0);

    @media (width >=768px) {
      transform: translateY(0);
    }
  }

}

#bs-3d-mobile-modal.show {
  pointer-events: auto;
  visibility: visible;
}

#bs-3d-mobile-modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.bs-3d-animation-mobile {
  border-radius: 0;
  box-shadow: none;
}

.bs-3d-mobile-instruction p {
  font-size: 11px;
}

@media (max-width: 480px) {
  .modal-content {
    margin: 5px;
    padding: 20px;
  }

  #mobile-modal-letter {
    font-size: 36px;
    padding: 12px;
  }

  #mobile-modal-title {
    font-size: 15px;
  }

  #mobile-modal-description {
    font-size: 12px;
  }
}

/* Animaciones suaves para los cubos */
.bs-3d-animation-mobile canvas {
  display: block;
}

/* Efectos de hover para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .bs-3d-animation-mobile {
    cursor: pointer;
  }
}

/* Optimizaciones para rendimiento móvil */
.bs-3d-animation-mobile {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Estilos para el contenedor del renderer */
.bs-3d-animation-mobile canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .bs-3d-mobile-spinner {
    animation: none;
  }

  .modal-content {
    transition: none;
  }

  #bs-3d-mobile-modal {
    transition: none;
  }
}

/* Modo oscuro (si se implementa) */
@media (prefers-color-scheme: dark) {
  .bs-3d-animation-mobile {
    /* Sin background para modo oscuro */
  }

  .bs-3d-mobile-instruction p {
    color: #ccc;
  }

  .modal-content {
    background: #2a2a2a;
    color: #fff;
  }

  #mobile-modal-letter {
    background: #333;
    border-color: #555;
    color: #fff;
  }

  #mobile-modal-title {
    color: #fff;
  }

  #mobile-modal-description {
    color: #ccc;
  }

  #mobile-modal-close {
    background: #fff;
    color: #000;
  }

  #mobile-modal-close:hover {
    background: #f0f0f0;
  }
}