/*
 * 3D Morph Studio Pro — style.css
 * Styles for widget wrapper, UI overlays, gyro modal, mute button.
 */

/* ── Widget Wrapper ────────────────────────────────────────────────────── */
.morph3d-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  border-radius: 4px;
}

.morph3d-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
  touch-action: none; /* prevent scroll hijack on canvas */
}

/* ── Mute Button ───────────────────────────────────────────────────────── */
.morph3d-mute-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.morph3d-mute-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

/* ── Gyro Button ───────────────────────────────────────────────────────── */
.morph3d-gyro-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.morph3d-gyro-btn:hover {
  background: rgba(79, 195, 247, 0.5);
}

/* ── Accessibility Overlay ─────────────────────────────────────────────── */
.morph3d-a11y-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.morph3d-a11y-text {
  font-size: clamp(2rem, 8vw, 6rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(79, 195, 247, 0.8);
  letter-spacing: 0.1em;
  transition: opacity 0.5s ease;
}

/* ── Preset Bar ────────────────────────────────────────────────────────── */
.morph3d-preset-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.morph3d-export-btn,
.morph3d-import-label {
  background: rgba(124, 77, 255, 0.7);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.morph3d-export-btn:hover,
.morph3d-import-label:hover {
  background: rgba(124, 77, 255, 0.95);
}

/* ── Gyroscope Permission Modal ────────────────────────────────────────── */
.morph3d-gyro-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: morph3d-fade-in 0.25s ease;
}

.morph3d-gyro-modal__inner {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(79, 195, 247, 0.1);
}

.morph3d-gyro-modal__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: morph3d-tilt 2s ease-in-out infinite;
}

@keyframes morph3d-tilt {
  0%, 100% { transform: rotate(-10deg); }
  50%       { transform: rotate(10deg);  }
}

.morph3d-gyro-modal__title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
}

.morph3d-gyro-modal__body {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 24px;
}

.morph3d-gyro-modal__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.morph3d-gyro-modal__btn {
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.morph3d-gyro-modal__btn:active {
  transform: scale(0.97);
}

.morph3d-gyro-modal__btn--allow {
  background: linear-gradient(135deg, #4fc3f7, #7c4dff);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
}

.morph3d-gyro-modal__btn--allow:hover {
  box-shadow: 0 4px 30px rgba(79, 195, 247, 0.6);
}

.morph3d-gyro-modal__btn--deny {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.morph3d-gyro-modal__btn--deny:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes morph3d-fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1);    }
}

/* ── Reduced Motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .morph3d-gyro-modal__icon { animation: none; }
  .morph3d-a11y-overlay { display: flex !important; }
}

/* ── Elementor Editor helper ────────────────────────────────────────────── */
.elementor-editor-active .morph3d-preset-bar {
  display: flex !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .morph3d-gyro-modal__inner {
    padding: 24px 18px;
  }
  .morph3d-a11y-text {
    font-size: 2rem;
  }
}
