/* css/three-scene.css - استایل‌های ویژه صحنه سه‌بعدی و کنترل‌های HUD */

.hero-canvas-container {
  position: relative;
  width: 100%;
  height: 580px;
  min-height: 480px;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(30, 27, 75, 0.45) 0%, rgba(7, 10, 27, 0.85) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.9),
              0 0 35px -5px rgba(139, 92, 246, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
  display: block;
}

/* لودر و وضعیت صحنه */
.scene-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 38, 0.9);
  z-index: 10;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.scene-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scene-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
  border-right-color: #06b6d4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.scene-loader-text {
  font-size: 0.95rem;
  color: #cbd5e1;
  font-weight: 500;
}

/* کنترل‌های تعاملی سه‌بعدی روی بوم */
.scene-controls-hud {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 5;
  pointer-events: none;
}

.scene-controls-hud > * {
  pointer-events: auto;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hud-label {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-inline-end: 4px;
}

.hud-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.hud-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  font-weight: 600;
}

.hud-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.15);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.hud-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* بج وضعیت تعاملی در بالای بوم */
.scene-badge-top {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  color: #cbd5e1;
  z-index: 5;
  pointer-events: none;
}

.badge-icon {
  font-size: 1rem;
}

/* فال‌بک CSS 3D در صورتی که WebGL پشتیبانی نشود */
.fallback-3d-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  pointer-events: none;
}

.fallback-cube-wrap {
  width: 140px;
  height: 140px;
  position: relative;
  transform-style: preserve-3d;
  animation: spinCube 12s infinite linear;
}

.fallback-cube-face {
  position: absolute;
  width: 140px;
  height: 140px;
  background: rgba(139, 92, 246, 0.25);
  border: 2px solid rgba(6, 182, 212, 0.7);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 1.5rem;
}

.face-front  { transform: translateZ(70px); }
.face-back   { transform: rotateY(180deg) translateZ(70px); }
.face-right  { transform: rotateY(90deg) translateZ(70px); }
.face-left   { transform: rotateY(-90deg) translateZ(70px); }
.face-top    { transform: rotateX(90deg) translateZ(70px); }
.face-bottom { transform: rotateX(-90deg) translateZ(70px); }

@keyframes spinCube {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg); }
}

@media (max-width: 768px) {
  .hero-canvas-container {
    height: 420px;
    border-radius: 18px;
  }
  .scene-controls-hud {
    bottom: 12px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .hud-group {
    justify-content: center;
    width: 100%;
  }
  .scene-badge-top {
    top: 12px;
    right: 12px;
    font-size: 0.72rem;
    padding: 4px 10px;
  }
}
