/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --purple-primary: #8b2be2;
  --purple-light: #a855f7;
  --purple-glow: rgba(139, 43, 226, 0.45);
  --purple-glow-bright: rgba(168, 85, 247, 0.65);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
}

.showroom-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
}

/* 3D Dual-Buffer Video Engine & Smooth Crossfade Posters */
.video-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.room-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  will-change: opacity;
}

.room-poster.active {
  opacity: 1;
  z-index: 3;
}

.room-poster.base {
  opacity: 1;
  z-index: 2;
}

.video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  will-change: opacity;
}

.video-layer.active {
  opacity: 1;
  z-index: 5;
}

.cinematic-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  background: radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.4) 100%);
}

/* HIGH-TRANSPARENCY PURPLE LIQUID GLASS */
.liquid-glass {
  background: rgba(18, 14, 30, 0.42);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(168, 85, 247, 0.22);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(139, 43, 226, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

/* TOP HUD BAR */
.hud-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

/* BRAND LOGO & ROOM TITLE (TOP LEFT) */
.top-left-group {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-vr-standalone {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 20px;
  color: #ffffff;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  pointer-events: auto;
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(139, 43, 226, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-vr-standalone .icon-vr {
  width: 20px;
  height: 20px;
  color: #d8b4fe;
  transition: transform 0.25s ease;
}

.btn-vr-standalone .vr-label {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.btn-vr-standalone:hover {
  background: rgba(139, 43, 226, 0.5);
  border-color: rgba(216, 180, 254, 0.9);
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(168, 85, 247, 0.7);
  transform: translateY(-2px) scale(1.04);
}

.btn-vr-standalone:hover .icon-vr {
  transform: scale(1.15);
  color: #ffffff;
}

.btn-vr-standalone:active {
  transform: translateY(0) scale(0.98);
}

.brand-container {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px 10px 18px;
  border-radius: 22px;
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(168, 85, 247, 0.3);
}

.brand-room-info {
  display: flex;
  flex-direction: column;
}

.brand-subtag-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-subtag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--purple-light);
  text-transform: uppercase;
}

.btn-vr-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 12px;
  background: rgba(139, 43, 226, 0.28);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #ffffff;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  box-shadow: 0 0 12px rgba(139, 43, 226, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  pointer-events: auto;
}

.btn-vr-pill .icon-vr {
  width: 14px;
  height: 14px;
  color: #e9d5ff;
}

.btn-vr-pill:hover {
  background: rgba(168, 85, 247, 0.55);
  border-color: rgba(216, 180, 254, 0.9);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.7);
  transform: translateY(-1px) scale(1.05);
  color: #ffffff;
}

.btn-vr-pill:active {
  transform: translateY(0) scale(0.98);
}

.brand-room-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.1;
}

.top-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-step-pill {
  padding: 12px 20px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 700;
  font-family: monospace;
  color: var(--purple-light);
}

.btn-icon-liquid-glass {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: rgba(18, 14, 30, 0.42);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-icon-liquid-glass:hover {
  background: rgba(139, 43, 226, 0.25);
  border-color: var(--purple-light);
  transform: scale(1.08);
  box-shadow: 0 0 25px var(--purple-glow-bright);
}

.icon {
  width: 22px;
  height: 22px;
}

/* FLOATING SIDE NAVIGATION ARROWS (LEFT & RIGHT) */
.scene-nav-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 28;
}

.btn-nav-arrow {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--purple-glow);
}

.btn-nav-arrow.arrow-left {
  left: 28px;
}

.btn-nav-arrow.arrow-right {
  right: 28px;
}

.btn-nav-arrow:hover {
  background: rgba(139, 43, 226, 0.35);
  border-color: var(--purple-light);
  color: var(--purple-light);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 30px var(--purple-glow-bright);
}

.btn-nav-arrow.arrow-left:hover {
  transform: translateY(-50%) translateX(-4px) scale(1.08);
}

.btn-nav-arrow.arrow-right:hover {
  transform: translateY(-50%) translateX(4px) scale(1.08);
}

.icon-nav {
  width: 28px;
  height: 28px;
}

/* FLOATING WALL PIN */
.wall-pin-wrapper {
  position: absolute;
  top: 44%;
  left: 71.5%;
  transform: translate(-50%, -50%);
  z-index: 25;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wall-pin-wrapper.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
}

.liquid-glass-pin {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  outline: none;
}

.pin-pulse {
  position: absolute;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: var(--purple-glow);
  animation: pinRipple 2.4s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
  pointer-events: none;
}

@keyframes pinRipple {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.pin-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 16px;
  border-radius: 35px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(22, 16, 38, 0.7) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 0 25px var(--purple-glow),
    inset 0 1px 2px rgba(255, 255, 255, 0.6);
  color: #ffffff;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.liquid-glass-pin:hover .pin-inner {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(139, 43, 226, 0.5) 0%, rgba(20, 14, 35, 0.85) 100%);
  border-color: var(--purple-light);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 35px var(--purple-glow-bright);
}

.pin-icon {
  width: 20px;
  height: 20px;
  color: var(--purple-light);
  transition: transform 0.3s ease;
}

.liquid-glass-pin:hover .pin-icon {
  transform: rotate(45deg);
  color: #ffffff;
}

.pin-label {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}

/* RIGHT-SIDE LIQUID GLASS MATERIAL DRAWER */
.material-drawer-right {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  z-index: 50;
  padding: 18px 18px 18px 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.material-drawer-right.closed {
  transform: translateX(105%);
  opacity: 0;
}

.drawer-liquid-glass {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(16, 12, 28, 0.78) 100%);
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 
    0 35px 80px rgba(0, 0, 0, 0.85),
    0 0 30px rgba(139, 43, 226, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(139, 43, 226, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-pretitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--purple-light);
  text-transform: uppercase;
}

.drawer-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.btn-close-liquid-glass {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-close-liquid-glass:hover {
  background: rgba(139, 43, 226, 0.3);
  border-color: var(--purple-light);
  transform: rotate(90deg) scale(1.08);
}

/* Material Cards Grid */
.drawer-materials-grid {
  padding: 22px 28px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  flex: 1;
}

.texture-card {
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.texture-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--purple-light);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--purple-glow);
}

.texture-card.selected {
  background: rgba(139, 43, 226, 0.2);
  border: 2px solid var(--purple-light);
  box-shadow: 0 0 25px var(--purple-glow-bright);
}

.texture-thumb-wrap {
  height: 130px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #111;
}

.texture-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.texture-card:hover .texture-thumb {
  transform: scale(1.06);
}

.texture-active-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--purple-light);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.texture-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.texture-num {
  font-size: 12px;
  font-family: monospace;
  font-weight: 800;
  color: var(--purple-light);
}

.texture-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 3px;
  line-height: 1.25;
}

.drawer-footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-active-tile-info {
  display: flex;
  flex-direction: column;
}

.footer-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #a0aec0;
  letter-spacing: 0.1em;
}

.footer-val {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--purple-light);
}

.btn-liquid-glass-action {
  padding: 12px 28px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
  color: #ffffff;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px var(--purple-glow);
}

.btn-liquid-glass-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px var(--purple-glow-bright);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.35);
  border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .hud-top-bar {
    padding: 16px 20px;
  }
  .brand-logo {
    height: 26px;
  }
  .brand-room-title {
    font-size: 18px;
  }
  .btn-nav-arrow {
    width: 48px;
    height: 48px;
  }
  .btn-nav-arrow.arrow-left {
    left: 14px;
  }
  .btn-nav-arrow.arrow-right {
    right: 14px;
  }
  .material-drawer-right {
    max-width: 100%;
    padding: 10px;
  }
  .drawer-materials-grid {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}
