/* Frontend styles for Easy 3D Depth Map */

.easy-3d-depth-map-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.easy-3d-depth-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

.easy-3d-depth-map-fallback-image {
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.easy-3d-depth-map-loading-webgl {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  font-size: 12px;
  color: #666;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.webgl-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #ddd;
  border-top: 1px solid #666;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 5px;
}

/* Hide fallback image when canvas is active */
.easy-3d-depth-map-container.webgl-active .easy-3d-depth-map-fallback-image {
  opacity: 0;
  pointer-events: none;
}

.easy-3d-depth-map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.easy-3d-depth-map-loading .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  animation: easy-3d-depth-map-spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes easy-3d-depth-map-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.easy-3d-depth-map-loading p {
  display: none;
}

.easy-3d-depth-map-error {
  padding: 20px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .easy-3d-depth-map-container {
    height: 300px;
  }

  .easy-3d-depth-map-canvas {
    cursor: auto; /* Show cursor on mobile */
  }
}

@media (max-width: 480px) {
  .easy-3d-depth-map-container {
    height: 250px;
  }
}

/* Hide scrollbars on canvas container */
.easy-3d-depth-map-container::-webkit-scrollbar {
  display: none;
}

.easy-3d-depth-map-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* JavaScript fallback styling */
.easy-3d-depth-map-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
}

.easy-3d-depth-map-fallback img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Hide fallback when JavaScript loads the canvas */
.easy-3d-depth-map-container[data-initialized="true"]
  .easy-3d-depth-map-fallback {
  display: none;
}
