/* ═══════════════════════════════════════════════════════
   RIZA AR / 3D Modal
   ═══════════════════════════════════════════════════════ */

/* ── 3D / AR floating badge inside .spd-main-img ── */
.spd-3d-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(10,10,20,.88) 0%, rgba(20,16,40,.92) 100%);
  border: 1px solid rgba(201,169,110,.55);
  border-radius: 14px;
  color: #c9a96e;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,.55), 0 0 0 0 rgba(201,169,110,.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: spd3dPulse 2.8s ease-in-out infinite;
}
.spd-3d-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #c9a96e;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 18px rgba(201,169,110,.28);
  animation: none;
}
@keyframes spd3dPulse {
  0%,100% { box-shadow: 0 4px 24px rgba(0,0,0,.55), 0 0 0 0 rgba(201,169,110,.3); }
  50%      { box-shadow: 0 4px 24px rgba(0,0,0,.55), 0 0 0 7px rgba(201,169,110,.0); }
}
.spd-3d-icon {
  font-size: 24px;
  line-height: 1;
  animation: spd3dSpin 6s linear infinite;
}
@keyframes spd3dSpin {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}
.spd-3d-label {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.spd-3d-label strong {
  font-size: 14px;
  font-weight: 700;
  color: #d4b97e;
}
.spd-3d-label small {
  font-size: 11px;
  color: rgba(201,169,110,.65);
  letter-spacing: .05em;
}

/* ── Modal overlay ── */
#riza-ar-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
#riza-ar-modal.visible {
  display: flex;
}

/* ── Backdrop ── */
.riza-ar-bd {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Panel ── */
.riza-ar-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  background: #0e0e0e;
  border: 1px solid rgba(201, 169, 110, .3);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

/* ── Header ── */
.riza-ar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.riza-ar-title {
  font-size: 15px;
  font-weight: 700;
  color: #c9a96e;
  letter-spacing: .04em;
}
.riza-ar-x {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .45);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.riza-ar-x:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

/* ── Viewer ── */
.riza-ar-body {
  position: relative;
  background: #111;
}
#riza-mv {
  width: 100%;
  height: 420px;
  display: block;
  --progress-bar-color: #c9a96e;
  --progress-mask: #0e0e0e;
}

/* ── Progress bar slot ── */
.riza-mv-load {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .07);
}
.riza-mv-bar {
  height: 100%;
  background: #c9a96e;
  width: 0%;
  transition: width .3s;
}

/* ── Footer ── */
.riza-ar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  gap: 12px;
}
.riza-ar-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, .3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.riza-ar-place {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #c9a96e;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.riza-ar-place:hover { background: #e8c97e; }

/* hide AR button on desktop where WebXR isn't available */
@media (hover: hover) and (pointer: fine) {
  .riza-ar-place { display: none; }
}

/* ── Mobile full-screen ── */
@media (max-width: 600px) {
  #riza-ar-modal { padding: 0; }
  .riza-ar-panel {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  #riza-mv { height: calc(100vh - 118px); }
  .riza-ar-place { display: flex; }
}

/* ═══════════════════════════════════════════════════════
   RIZA AI Tools — 3D Admin Tab
   ═══════════════════════════════════════════════════════ */
.riza-3d-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.riza-3d-stat {
  flex: 1 1 140px;
  background: rgba(201, 169, 110, .06);
  border: 1px solid rgba(201, 169, 110, .15);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}
.riza-3d-stat-val {
  font-size: 28px;
  font-weight: 700;
  color: #c9a96e;
  line-height: 1;
  margin-bottom: 4px;
}
.riza-3d-stat-lbl {
  font-size: 12px;
  color: rgba(255,255,255,.45);
}

.riza-3d-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.riza-3d-table th {
  text-align: right;
  padding: 10px 12px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.07);
  white-space: nowrap;
}
.riza-3d-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.riza-3d-table tr:hover td { background: rgba(255,255,255,.02); }

.riza-3d-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
}
.riza-3d-name {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.riza-3d-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.riza-3d-badge.has {
  background: rgba(201,169,110,.15);
  color: #c9a96e;
  border: 1px solid rgba(201,169,110,.3);
}
.riza-3d-badge.no {
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.3);
  border: 1px solid rgba(255,255,255,.08);
}

.riza-3d-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.riza-btn-sm {
  padding: 5px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: opacity .2s;
}
.riza-btn-sm:disabled { opacity: .45; cursor: not-allowed; }

.riza-btn-generate {
  background: rgba(201,169,110,.15);
  color: #c9a96e;
  border: 1px solid rgba(201,169,110,.35);
}
.riza-btn-generate:hover:not(:disabled) { background: rgba(201,169,110,.25); }

.riza-btn-outline-sm {
  background: transparent;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.riza-btn-outline-sm:hover { color: #fff; border-color: rgba(255,255,255,.3); }

.riza-btn-danger-sm {
  background: rgba(229,57,53,.1);
  color: #ef5350;
  border: 1px solid rgba(229,57,53,.25);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}
.riza-btn-danger-sm:hover { background: rgba(229,57,53,.2); }

.riza-3d-pages {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.riza-3d-pages a, .riza-3d-pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.1);
}
.riza-3d-pages a:hover { background: rgba(255,255,255,.06); color: #fff; }
.riza-3d-pages span.cur { background: rgba(201,169,110,.15); color: #c9a96e; border-color: rgba(201,169,110,.3); }

/* Admin preview modal */
#riza-3d-admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#riza-3d-admin-modal.visible { display: flex; }
#riza-3d-admin-modal .riza-ar-bd {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
  cursor: pointer;
}
#riza-3d-admin-modal .riza-ar-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}
#riza-admin-mv {
  width: 100%;
  height: 380px;
  display: block;
  background: #111;
}
