/* XRUpgrade Configurator - Modular Styles */

:root {
  --primary-color: #667eea;
  --primary-hover: #5a6fd8;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --background-color: #f8f9fa;
  --surface-color: rgba(255, 255, 255, 0.95);
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: rgba(255, 255, 255, 0.2);
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --xrupgrade-color: #3c3c3c;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  overflow: hidden;
  height: 100vh;
  position: relative;
}

/* Container Styles */
.configurator-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Main Container */
.container {
  width: 100%;
  height: 100vh;
  position: relative;
}

/* 3D Viewer - Full Screen */
#viewer {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  min-height: 400px;
  /* Ensure minimum height */
}

/* Model Viewer Styles */
model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  display: block !important;
  /* Force display */
  position: relative;
  z-index: 1;
  --poster-color: transparent;
  --progress-bar-color: var(--accent-color);
  --progress-mask: radial-gradient(circle, transparent 40%, #000 50%);
}

model-viewer::part(default-progress-bar) {
  display: none;
}

/* Environment Backgrounds */
.staging-environment {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.staging-environment.active {
  opacity: 1;
}

/* XRUpgrade Logo */
.xrupgrade-logo {
  position: absolute;
  top: 40px;
  right: 40px;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.xrupgrade-logo:hover {
  transform: scale(1.05);
}

.xrupgrade-logo img {
  width: 200px;
  height: auto;
  display: block;
  filter: brightness(0);
}

/* Desktop UI - Vertical Dock */
.vertical-dock {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vertical-dock:hover {
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Section Titles */
.section-title {
  color: whitesmoke;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: left;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 2px solid whitesmoke;
}

/* Color Picker Styles */
.color-section {
  margin-bottom: 20px;
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-option {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 0 20px rgba(102, 126, 234, 0.4);
  transform: scale(1.05);
}

.color-option.selected::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
  border-radius: 17px;
  z-index: -1;
  animation: selectedGlow 2s ease-in-out infinite alternate;
}

@keyframes selectedGlow {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }

  100% {
    opacity: 0.6;
    transform: scale(1.02);
  }
}

.color-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.color-option.clicked {
  transform: scale(0.95);
}

.color-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.color-option:hover .color-overlay {
  opacity: 1;
}

/* Strap Selector Styles - ORIGINAL DESIGN */
.strap-section {
  margin-bottom: 30px;
}

.strap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.strap-option {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
}

.strap-option:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.strap-option.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.strap-option.selected-color {
  background: var(--glass-bg);
  border: 2px dashed var(--accent-color);
}

.strap-option.orange {
  background: linear-gradient(45deg, #FF8C00, #FFA500);
}

.strap-option.clicked {
  transform: scale(0.98);
}

.strap-option span {
  font-size: 10px;
  font-weight: 600;
  color: var(--xrupgrade-color);
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Environment Selector Styles - ORIGINAL DESIGN */
.environment-section {
  margin-bottom: 30px;
}

.environment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.environment-option {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.environment-option:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.environment-option.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.environment-option.clicked {
  transform: scale(0.98);
}

.environment-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--xrupgrade-color);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.environment-option:hover .environment-label {
  opacity: 1;
}

/* Floating Action Menu */
.floating-actions {
  position: absolute;
  bottom: 40px;
  right: 40px;
  z-index: 100;
  display: flex;
  gap: 15px;
  align-items: center;
  display: none;
}

.floating-actions.horizontal {
  flex-direction: row;
}

.floating-actions.vertical {
  flex-direction: column;
}

.action-btn {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--xrupgrade-color);
  font-size: 24px;
}

.action-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.2);
}

.action-btn.clicked {
  transform: scale(0.95);
}

/* AR Button - Prominent with Pulsating Effect */
.ar-button {
  width: 80px;
  height: 80px;
  border-radius: 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  font-size: 32px;
  position: relative;
  overflow: hidden;
  animation: arPulse 2s ease-in-out infinite;
}

.ar-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  border-radius: 23px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ar-button:hover::before {
  opacity: 1;
}

.ar-button:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
  animation: none;
}

@keyframes arPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
}

.action-btn .btn-icon {
  font-size: inherit;
}

.action-btn .btn-label {
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

/* Old Mobile Dock - REMOVED - Replaced by mobile-dock-horizontal */

/* Removed old mobile-dock scrollbar */

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-tabs {
  width: 100%;
}

.tab-headers {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-header {
  background: none;
  border: none;
  color: var(--xrupgrade-color);
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tab-header.active {
  background: var(--accent-color);
  color: white;
}

.tab-content {
  min-height: 80px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Old mobile-floating-actions - REMOVED - Now integrated into horizontal dock */

/* Old mobile section styles - REMOVED - Replaced by mobile-dock-horizontal */

@keyframes miniParticleBurst {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--burst-x, 0)), calc(-50% + var(--burst-y, 0))) scale(0);
    opacity: 0;
  }
}

.color-changing {
  animation: gameColorTransition 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes colorTransition {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Simple Horizontal Mobile Dock */
.mobile-dock-horizontal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.03) 0%, transparent 100%);
  backdrop-filter: blur(2px);
  display: none;
  animation: slideUpFromBottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px 0 15px 0;
  height: auto;
  min-height: 85px;
  overflow: visible;
}

/* Scrollable Container - Allow vertical overflow for floating cards */
.mobile-dock-scroll {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 15px 30px 15px 30px;
  touch-action: pan-x;
  cursor: grab;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pure JavaScript scroll - no CSS animation conflicts */
.mobile-dock-scroll.auto-scrolling {
  scroll-behavior: auto;
  /* Let JavaScript handle all scrolling */
}

@keyframes autoScrollLeftToRight {
  0% {
    scroll-behavior: smooth;
  }

  50% {
    scroll-behavior: smooth;
  }

  100% {
    scroll-behavior: smooth;
  }
}

.mobile-dock-scroll::-webkit-scrollbar {
  display: none;
}

/* One Row Layout - No height restrictions for floating cards */
.mobile-options-row {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  min-height: 65px;
  flex-wrap: nowrap;
  overflow: visible;
  width: max-content;
}

/* Mobile labeled sections with glass morphism */
.mobile-labeled-sections {
  gap: 25px;
  align-items: flex-start;
}

.mobile-category-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 20px 22px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(25px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  pointer-events: none;
}

.mobile-category-section:hover {
  /* Restored smooth hover animations */
  transform: translateY(-4px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.mobile-category-label {
  color: rgba(0, 0, 0, 0.8);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  margin-bottom: 6px;
}

.mobile-category-items {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  pointer-events: auto;
}

/* Mobile Sections */
.mobile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  max-width: 140px;
  flex-shrink: 0;
  gap: 8px;
  margin-right: 20px;
}

.mobile-section-label {
  color: var(--xrupgrade-color);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-bottom: 5px;
  opacity: 0.8;
}

.mobile-section-items {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Category items styling - inherits from mobile-category-items */

/* Item Styling - Category sections with desktop-inspired styling */
.mobile-category-items .color-option,
.mobile-category-items .strap-option,
.mobile-category-items .environment-option {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.mobile-category-items .color-option:hover,
.mobile-category-items .strap-option:hover,
.mobile-category-items .environment-option:hover {
  /* Restored smooth hover animations */
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mobile-category-items .color-option.selected,
.mobile-category-items .strap-option.selected,
.mobile-category-items .environment-option.selected {
  border-color: var(--xrupgrade-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 6px 16px rgba(102, 126, 234, 0.25);
  transform: translateY(-2px) scale(1.02);
}

.mobile-category-items .strap-option {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-category-items .strap-option span {
  font-size: 8px;
  font-weight: 600;
  color: var(--xrupgrade-color);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.mobile-category-items .strap-option.orange {
  background: linear-gradient(45deg, #FF8C00, #FFA500);
}

.mobile-category-items .environment-option {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Floating Actions (smaller and lower) */
.mobile-floating-actions {
  position: fixed;
  bottom: 30%;
  right: 15px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-floating-actions .action-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
}

.mobile-floating-actions .ar-button {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  font-size: 18px;
}

/* Desktop mobile debug mode - even smaller floating actions */
.mobile-debug .mobile-floating-actions .action-btn {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  font-size: 12px;
}

.mobile-debug .mobile-floating-actions .ar-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
}

.mobile-dock-horizontal .mobile-options-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
}

.mobile-dock-horizontal .mobile-section {
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
}

@keyframes slideUpFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Debug mode for desktop testing - add ?mobile=true to URL */
.mobile-debug .vertical-dock {
  display: none !important;
}

.mobile-debug .mobile-dock-horizontal {
  display: block !important;
}

.mobile-debug #viewer {
  margin-bottom: 0 !important;
}

.mobile-debug .floating-actions {
  display: none !important;
}

.mobile-debug .mobile-floating-actions {
  display: flex !important;
}

/* Force mobile layout for testing */
@media (max-width: 768px) {
  .xrupgrade-logo {
    top: 15px;
    right: 15px;
  }

  .xrupgrade-logo img {
    width: 120px;
  }

  .vertical-dock {
    display: none !important;
  }

  .floating-actions:not(.mobile-floating-actions) {
    display: none !important;
    /* Actions are now integrated into the horizontal dock */
  }

  .mobile-dock-horizontal {
    display: block !important;
  }

  .mobile-floating-actions {
    display: flex !important;
  }

  .action-btn {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 20px;
  }

  .ar-button {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 26px;
  }

  .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
  }

  .color-option {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .color-option:hover {
    transform: scale(1.05);
  }

  /* Hide desktop dock completely on mobile */
  .vertical-dock {
    display: none !important;
  }

  /* Mobile model viewer adjustments */
  #viewer {
    margin-bottom: 0;
    /* No margin needed since dock is positioned fixed */
  }

  /* Enhanced mobile section styling for touch devices */
  .mobile-section-items .color-option,
  .mobile-section-items .strap-option,
  .mobile-section-items .environment-option {
    width: 44px;
    height: 44px;
  }

  .mobile-section-label {
    font-size: 9px;
  }

  /* Mobile floating actions positioning */
  .mobile-floating-actions {
    bottom: 30%;
    right: 15px;
  }

  .mobile-floating-actions .action-btn {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 20px;
  }

  .mobile-floating-actions .ar-button {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 26px;
  }

  /* Touch-friendly interactions */
  .mobile-section-items .color-option:active,
  .mobile-section-items .strap-option:active,
  .mobile-section-items .environment-option:active {
    transform: scale(0.9);
    transition: transform 0.1s ease;
  }

  /* Floating actions touch improvements */
  .floating-actions .action-btn:active,
  .floating-actions .ar-button:active {
    transform: scale(0.9);
    transition: transform 0.1s ease;
  }

  /* Prevent text selection on mobile */
  .mobile-dock-horizontal {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .mobile-dock-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Horizontal dock sections don't need separators */

  .color-changing {
    animation: mobileColorTransition 1s ease-out;
  }

  /* QR Modal mobile optimizations */
  .qr-modal-content {
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
  }

  .qr-modal-header h3 {
    font-size: 18px;
  }

  .qr-code-container {
    padding: 15px;
    margin: 15px 0;
  }

  #qrCodeContainer {
    min-width: 180px;
    min-height: 180px;
  }

  .qr-url-display {
    flex-direction: column;
    gap: 10px;
  }

  .qr-url-display input {
    font-size: 16px;
    /* Prevent zoom on iOS */
  }

  .copy-url-btn {
    width: 100%;
    padding: 14px 20px;
  }
}

@keyframes mobileColorTransition {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* QR Code Modal Styles */
.qr-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qr-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.qr-modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-modal.show .qr-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.qr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-modal-header h3 {
  margin: 0;
  color: #f0f0f0;
  font-size: 20px;
  font-weight: 600;
}

.qr-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--xrupgrade-color);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.qr-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.qr-modal-body p {
  color: #d0d0d0;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
}

.qr-code-container {
  background: white;
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  display: inline-block;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#qrCodeContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 200px;
}

.qr-url-display {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.qr-url-display input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.copy-url-btn {
  padding: 12px 20px;
  background: var(--xrupgrade-color);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-url-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.copy-url-btn.copied {
  background: #28a745;
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .xrupgrade-logo {
    top: 15px;
    right: 15px;
  }

  .xrupgrade-logo img {
    width: 120px;
  }

  .qr-modal-content {
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
  }

  .qr-modal-header h3 {
    font-size: 18px;
  }

  .qr-code-container {
    padding: 15px;
    margin: 15px 0;
  }

  #qrCodeContainer {
    min-width: 180px;
    min-height: 180px;
  }

  .qr-url-display {
    flex-direction: column;
    gap: 10px;
  }

  .qr-url-display input {
    font-size: 16px;
    /* Prevent zoom on iOS */
  }

  .copy-url-btn {
    width: 100%;
    padding: 14px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .color-changing {
    animation: none !important;
  }

  .mini-particle {
    display: none !important;
  }
}

/* Loading Screen Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--primary-color);
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-content h2 {
  color: #3c3c3c;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin: 0;
}

.loading-content p {
  color: #666;
  font-family: 'Inter', sans-serif;
  margin: 10px 0 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Additional mobile breakpoints for better responsiveness */
@media (max-width: 480px) {
  .xrupgrade-logo {
    top: 10px;
    right: 10px;
  }

  .xrupgrade-logo img {
    width: 100px;
  }

  .mobile-floating-actions {
    bottom: 30%;
    right: 15px;
  }

  .action-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .ar-button {
    width: 55px;
    height: 55px;
    font-size: 24px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {

  /* Tablet styles */
  .xrupgrade-logo {
    top: 30px;
    right: 30px;
  }

  .xrupgrade-logo img {
    width: 160px;
  }
}

/* Configurator Toolbar Styles */
.configurator-toolbar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  gap: 32px;
  margin-left: 2vw;
}

.toolbar-btn {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  border-radius: 50px;
  transition: background 0.2s, box-shadow 0.2s;
  min-width: 64px;
  min-height: 64px;
  flex-direction: column;
}

.toolbar-icon-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-right: 0;
  transition: background 0.2s, box-shadow 0.2s;
  margin-bottom: 0.5vw;
}

.toolbar-icon-bg.selected {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.toolbar-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  filter: grayscale(0) brightness(1);
  opacity: 1;
  transition: filter 0.2s, opacity 0.2s;
}

.toolbar-btn.selected .toolbar-icon {
  filter: grayscale(0) brightness(1);
  opacity: 1;
}

.toolbar-label {
  font-size: 0.6vw;
  font-weight: bold;
  text-transform: uppercase;
  color: #111;
  letter-spacing: 0.5px;
  opacity: 1;
  transition: opacity 0.2s;
  pointer-events: none;
}

.toolbar-label.selected {
  opacity: 1;
}

.lights-toggle {
  position: absolute;
  bottom: 2vw;
  left: 2vw;
  font-size: 18px;
  color: #888;
  align-self: flex-start;
  z-index: 1;
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
}

.lights-toggle .toolbar-icon-bg {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
}

.lights-toggle .toolbar-label {
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  margin-left: 12px;
  color: #888;
  opacity: 1;
}

/* Toolbar button and icon background smaller */
.toolbar-btn,
.toolbar-icon-bg {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin-bottom: 4px;
}

/* Toolbar icon smaller */
.toolbar-icon {
  width: 40px;
  height: 40px;
}

/* Toolbar label smaller and more compact */
.toolbar-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-top: 0.1vw;
  padding: 0 2px;
}

.toolbar-section-content,
.toolbar-content-container {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.toolbar-section-content img {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
}

.view-config-btn {
  background: transparent;
  border: none;
  color: #222;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 8px;
  padding: 4px 12px;
  transition: color 0.2s;
  text-transform: uppercase;
}

.view-config-btn:hover {
  text-decoration: underline;
}