/* ── AbstractRealmss - 3D Preview Popup & Trigger Styles ──────────────── */

.pdp-visual-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdp-3d-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px 0 12px;
  border-radius: 99px;
  border: 1px solid rgba(83, 198, 255, 0.45);
  background: linear-gradient(135deg, rgba(8, 29, 58, 0.9), rgba(3, 15, 34, 0.95));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e6f3ff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(32, 168, 255, 0.18);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

.pdp-3d-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(14, 45, 88, 0.95), rgba(7, 24, 52, 0.98));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 24px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px) scale(1.03);
}

.pdp-3d-btn:active {
  transform: translateY(0) scale(0.98);
}

.pdp-3d-btn .pdp-3d-icon {
  width: 18px;
  height: 18px;
  stroke: #38bdf8;
  transition: transform 0.4s ease;
}

.pdp-3d-btn:hover .pdp-3d-icon {
  transform: rotate(25deg);
}

/* ── 3D Modal Backdrop ───────────────────────────────────────── */
.pdp-3d-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(2, 8, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.pdp-3d-modal-backdrop[hidden] {
  display: none !important;
}

.pdp-3d-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── 3D Modal Card ───────────────────────────────────────────── */
.pdp-3d-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(165deg, rgba(12, 33, 62, 0.98), rgba(4, 13, 28, 0.99));
  border: 1px solid rgba(83, 198, 255, 0.32);
  border-radius: 20px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65), 0 0 40px rgba(32, 168, 255, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.pdp-3d-modal-backdrop.is-open .pdp-3d-modal-card {
  transform: scale(1) translateY(0);
}

/* ── Modal Header ────────────────────────────────────────────── */
.pdp-3d-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(83, 198, 255, 0.16);
}

.pdp-3d-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(32, 168, 255, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pdp-3d-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pdp3dPulse 2s infinite ease-in-out;
}

@keyframes pdp3dPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.pdp-3d-badge-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #7dd3fc;
}

.pdp-3d-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  flex: 1;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp-3d-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(83, 198, 255, 0.28);
  background: rgba(5, 17, 36, 0.8);
  color: #94a3b8;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdp-3d-modal-close:hover {
  color: #ffffff;
  border-color: #38bdf8;
  background: rgba(14, 45, 88, 0.9);
  transform: scale(1.1);
}

/* ── 3D Viewport Area ────────────────────────────────────────── */
.pdp-3d-viewport-container {
  position: relative;
  width: 100%;
  height: 360px;
  background:
    radial-gradient(circle at 50% 50%, rgba(32, 168, 255, 0.15), transparent 60%),
    linear-gradient(180deg, #040e1f 0%, #020712 100%);
  overflow: hidden;
  touch-action: none;
}

.pdp-3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
}

.pdp-3d-canvas:active {
  cursor: grabbing;
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.pdp-3d-loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(3, 10, 24, 0.85);
  backdrop-filter: blur(4px);
  color: #93c5fd;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 5;
}

.pdp-3d-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: pdp3dSpin 0.8s linear infinite;
}

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

/* ── Overlay Controls ────────────────────────────────────────── */
.pdp-3d-controls-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.pdp-3d-angle-buttons {
  display: flex;
  gap: 4px;
  background: rgba(3, 12, 28, 0.75);
  border: 1px solid rgba(83, 198, 255, 0.22);
  border-radius: 99px;
  padding: 3px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.pdp-3d-angle-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdp-3d-angle-btn:hover {
  color: #ffffff;
}

.pdp-3d-angle-btn.is-active {
  background: linear-gradient(135deg, #1fa2ff, #1270e3);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(32, 168, 255, 0.35);
}

.pdp-3d-autorotate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid rgba(83, 198, 255, 0.22);
  background: rgba(3, 12, 28, 0.75);
  backdrop-filter: blur(6px);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.pdp-3d-autorotate-btn svg {
  stroke: currentColor;
}

.pdp-3d-autorotate-btn:hover {
  color: #ffffff;
  border-color: rgba(83, 198, 255, 0.45);
}

.pdp-3d-autorotate-btn.is-active {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(14, 45, 88, 0.8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* ── Gesture Hint Banner ─────────────────────────────────────── */
.pdp-3d-gesture-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(2, 9, 22, 0.7);
  border: 1px solid rgba(83, 198, 255, 0.16);
  color: #94a3b8;
  font-size: 0.72rem;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.pdp-3d-gesture-hint svg {
  stroke: #38bdf8;
}

/* ── Modal Footer ────────────────────────────────────────────── */
.pdp-3d-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid rgba(83, 198, 255, 0.16);
}

.pdp-3d-footer-info {
  display: flex;
  flex-direction: column;
}

.pdp-3d-footer-info span {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp-3d-footer-info small {
  font-size: 0.72rem;
  color: #38bdf8;
  margin-top: 2px;
}

.pdp-3d-footer-actions {
  display: flex;
  gap: 8px;
}

.pdp-3d-btn-reset {
  border: 1px solid rgba(83, 198, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdp-3d-btn-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(83, 198, 255, 0.45);
  color: #ffffff;
}

.pdp-3d-btn-done {
  border: 1px solid #1fa2ff;
  background: linear-gradient(135deg, #1fa2ff, #1270e3);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(31, 162, 255, 0.35);
  transition: all 0.2s ease;
}

.pdp-3d-btn-done:hover {
  box-shadow: 0 0 20px rgba(31, 162, 255, 0.55);
  transform: translateY(-1px);
}

/* ── Mobile Optimization ─────────────────────────────────────── */
@media (max-width: 600px) {
  .pdp-3d-modal-card {
    max-width: 100%;
    border-radius: 16px;
  }
  .pdp-3d-viewport-container {
    height: 310px;
  }
  .pdp-3d-btn {
    height: 38px;
    padding: 0 12px 0 10px;
    font-size: 0.78rem;
  }
  .pdp-3d-modal-header {
    padding: 12px 14px;
  }
  .pdp-3d-modal-footer {
    padding: 10px 14px;
  }
  .pdp-3d-footer-info span {
    max-width: 160px;
  }
}
