/* ================================================
   BLOCKBUSTER 3D VR STORE — UI Overlay Styles
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: #000;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #000 0%, #0a0a1a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 1s ease, visibility 1s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 4rem;
  letter-spacing: 6px;
  color: #ffd700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin-bottom: 0.3rem;
}

.loading-subtitle {
  font-size: 1.2rem;
  color: #777;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.loading-bar {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ff6600);
  border-radius: 2px;
  animation: loading-grow 2.5s ease-in-out forwards;
}

@keyframes loading-grow {
  0% { width: 0%; }
  40% { width: 60%; }
  80% { width: 90%; }
  100% { width: 100%; }
}

.loading-text {
  font-size: 0.85rem;
  color: #444;
  letter-spacing: 1px;
}

/* ===== INSTRUCTIONS OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.5s ease, visibility 0.5s ease;
  cursor: pointer;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  color: white;
  max-width: 500px;
  padding: 2rem;
}

.overlay-content h1 {
  font-family: 'Bebas Neue', cursive;
  font-size: 3.5rem;
  letter-spacing: 6px;
  color: #ffd700;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.35);
  margin-bottom: 0.2rem;
}

.overlay .subtitle {
  font-size: 1.05rem;
  color: #999;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.controls-info {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: #ccc;
  margin-bottom: 2.5rem;
}

.controls-info div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.click-prompt {
  font-size: 1.15rem;
  color: #ffd700;
  font-weight: 500;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== CROSSHAIR ===== */
.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  z-index: 500;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.crosshair.hidden {
  opacity: 0;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
}

.crosshair::before {
  top: 50%;
  left: 3px;
  right: 3px;
  height: 2px;
  transform: translateY(-50%);
}

.crosshair::after {
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 2px;
  transform: translateX(-50%);
}

.crosshair.active {
  opacity: 1;
}

.crosshair.active::before,
.crosshair.active::after {
  background: #ffd700;
}

/* ===== MOVIE TOOLTIP ===== */
.movie-tooltip {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.88);
  color: white;
  padding: 14px 30px;
  border-radius: 10px;
  text-align: center;
  z-index: 400;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 215, 0, 0.18);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.movie-tooltip.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

.tooltip-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.35rem;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.tooltip-info {
  font-size: 0.9rem;
  color: #ffd700;
}

.tooltip-hint {
  font-size: 0.72rem;
  color: #666;
  margin-top: 6px;
}

/* ===== A-FRAME UI OVERRIDES ===== */
.a-enter-vr-button,
.a-enter-ar-button,
.a-loader-title {
  display: none !important;
}

/* ===== MOBILE CONTROLS VISIBILITY ===== */
/* Desktop: show desktop controls, hide mobile controls */
.mobile-controls {
  display: none !important;
}

/* ===== MOBILE VIRTUAL JOYSTICK ===== */
.mobile-joystick {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 600;
  touch-action: none;
  transition: opacity 0.3s ease;
}

.mobile-joystick.hidden {
  opacity: 0;
  pointer-events: none;
}

.joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 215, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.joystick-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.7), rgba(255, 215, 0, 0.3));
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  position: absolute;
  transition: box-shadow 0.2s ease;
  pointer-events: none;
}

.joystick-thumb.active {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* ===== MOBILE D-PAD ===== */
.mobile-dpad {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 140px;
  height: 140px;
  display: grid;
  grid-template-areas:
    ".    up    ."
    "left  .    right"
    ".    down  .";
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  z-index: 600;
  touch-action: none;
  transition: opacity 0.3s ease;
}

.mobile-dpad.hidden {
  opacity: 0;
  pointer-events: none;
}

.dpad-up { grid-area: up; }
.dpad-left { grid-area: left; }
.dpad-right { grid-area: right; }
.dpad-down { grid-area: down; }

.dpad-btn {
  background: rgba(0, 45, 138, 0.75); /* Blockbuster blue */
  border: 2px solid #ffd700; /* Blockbuster gold */
  color: #ffd700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.15s, transform 0.1s, color 0.15s;
}

.dpad-btn:active {
  background: #ffd700;
  color: #002d8a;
  transform: scale(0.92);
}


/* ===== MOBILE DEBUG STATUS ===== */
.mobile-debug {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 700;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ff4444;
  font-family: 'Outfit', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 68, 68, 0.3);
  pointer-events: none;
}

.mobile-debug.hidden {
  display: none;
}

.mobile-debug.active {
  color: #00ff64;
  border-color: rgba(0, 255, 100, 0.3);
}

/* ===== 3D DVD INSPECTION OVERLAY ===== */
.inspect-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  z-index: 4000;
  pointer-events: none; /* Let user swipe/drag the canvas directly to rotate */
  padding-bottom: 40px;
}

.inspect-overlay.hidden {
  display: none !important;
}

.inspect-hud-card {
  pointer-events: auto; /* Re-enable pointer events for HUD buttons */
  background: rgba(0, 0, 0, 0.88);
  border: 2px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  padding: 20px 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slide-up-hud 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-up-hud {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.inspect-hud-card h2 {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.2rem;
  letter-spacing: 2px;
  color: #ffd700;
  margin-bottom: 4px;
}

#inspect-meta {
  font-size: 0.95rem;
  color: #999;
  font-weight: 500;
  margin-bottom: 12px;
}

.inspect-desc {
  font-size: 0.88rem;
  color: #ccc;
  margin-bottom: 20px;
  line-height: 1.4;
  animation: pulse-text-inspect 2s ease-in-out infinite;
}

@keyframes pulse-text-inspect {
  0%, 100% { color: #ccc; }
  50% { color: #ffd700; }
}

.inspect-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.inspect-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 14px 24px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.btn-secondary {
  background: rgba(0, 45, 138, 0.8); /* Blockbuster blue */
  border: 2px solid #ffd700;
  color: #ffd700;
}

.btn-secondary:hover {
  background: #ffd700;
  color: #002d8a;
}

.btn-primary {
  background: #00ff64;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 100, 0.25);
}

.btn-primary:hover {
  background: #00e054;
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(0, 255, 100, 0.4);
}

.btn-trailer {
  background: #ff0055;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.2);
}

.btn-trailer:hover {
  background: #e6004c;
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.35);
}

/* ===== AUDIO CONTROLS BTN ===== */
.bgm-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #ffd700;
  border-radius: 30px;
  color: #ffd700;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.bgm-toggle:hover {
  background: #ffd700;
  color: #002d8a;
  transform: scale(1.05);
}

.bgm-toggle.muted {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.bgm-toggle.muted:hover {
  background: #ffffff;
  color: #000000;
}

.bgm-toggle.muted .music-icon {
  opacity: 0.55;
}

/* ===== YOUTUBE TRAILER MODAL ===== */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.trailer-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.trailer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.trailer-modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  background: #001c58;
  border: 3px solid #ffd700;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  padding: 4px;
  z-index: 5100;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.trailer-modal:not(.hidden) .trailer-modal-content {
  transform: scale(1);
}

.trailer-modal-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff0055;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.trailer-modal-close:hover {
  background: #e6004c;
  transform: scale(1.15) rotate(90deg);
}

.trailer-iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.trailer-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
}

.trailer-link-wrapper {
  padding: 14px 10px;
  text-align: center;
}

.trailer-youtube-btn {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #002d8a; /* Blockbuster blue */
  background: #ffd700; /* Blockbuster gold */
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
  letter-spacing: 0.5px;
}

.trailer-youtube-btn:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .loading-logo {
    font-size: 2.5rem;
  }

  .overlay-content h1 {
    font-size: 2.5rem;
  }

  .controls-info {
    font-size: 0.8rem;
  }

  .movie-tooltip {
    padding: 10px 20px;
  }

  .tooltip-title {
    font-size: 1.1rem;
  }
}

/* Mobile: show mobile controls, hide desktop controls */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .desktop-controls {
    display: none !important;
  }

  .mobile-controls {
    display: flex !important;
  }
}
