/* ==========================================================================
   SOLID3D CAD - Interactive 3D ViewCube Navigation Widget Styling
   License: MIT
   ========================================================================== */

#viewcube-container {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 110px;
  height: 110px;
  z-index: 40;
  perspective: 450px;
  pointer-events: auto;
  user-select: none;
}

/* Home view button beside ViewCube */
.viewcube-home-btn {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  background: rgba(30, 32, 36, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 45;
  transition: all 0.15s ease;
}

.viewcube-home-btn:hover {
  background: var(--bg-accent);
  color: #ffffff;
  border-color: var(--bg-accent);
}

.viewcube-home-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* 3D Cube Structure */
.viewcube-cube {
  width: 64px;
  height: 64px;
  position: absolute;
  top: 23px;
  left: 23px;
  transform-style: preserve-3d;
  transition: transform 0.05s ease-out;
  cursor: grab;
}

.viewcube-cube:active {
  cursor: grabbing;
}

.viewcube-face {
  position: absolute;
  width: 64px;
  height: 64px;
  background: rgba(45, 49, 56, 0.92);
  border: 1px solid #5a606d;
  color: #d1d5db;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  backface-visibility: visible;
  transition: background 0.15s, color 0.15s;
}

.viewcube-face:hover {
  background: rgba(0, 122, 204, 0.85);
  color: #ffffff;
}

/* Cube 3D Transformations */
.face-front  { transform: rotateY(  0deg) translateZ(32px); }
.face-back   { transform: rotateY(180deg) translateZ(32px); }
.face-right  { transform: rotateY( 90deg) translateZ(32px); }
.face-left   { transform: rotateY(-90deg) translateZ(32px); }
.face-top    { transform: rotateX( 90deg) translateZ(32px); }
.face-bottom { transform: rotateX(-90deg) translateZ(32px); }

/* Compass Ring */
.viewcube-compass {
  position: absolute;
  width: 104px;
  height: 104px;
  top: 3px;
  left: 3px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.compass-direction {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
}

.compass-n { top: 2px; left: 50%; transform: translateX(-50%); }
.compass-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 2px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 2px; top: 50%; transform: translateY(-50%); }
