/* Young's Construction Virtual Tour - Custom Styling */
/* Overrides default Marzipano styling with modern design */

/* Hide old default controls - replaced with Tailwind components */
#titleBar,
.viewControlButton,
.viewControlButton-1,
.viewControlButton-2,
.viewControlButton-3,
.viewControlButton-4,
.viewControlButton-5,
.viewControlButton-6 {
  display: none !important;
}

/* Keep new Tailwind controls visible */
#brandingBar,
#controlPanel {
  display: block !important;
}

/* Icon visibility control for toggle buttons */
#autorotateToggle .icon.on,
#sceneListToggle .icon.on,
#fullscreenToggle .icon.on {
  display: none;
}

#autorotateToggle .icon.off,
#sceneListToggle .icon.off,
#fullscreenToggle .icon.off {
  display: block;
}

#autorotateToggle.enabled .icon.on,
#sceneListToggle.enabled .icon.on,
#fullscreenToggle.enabled .icon.on {
  display: block;
}

#autorotateToggle.enabled .icon.off,
#sceneListToggle.enabled .icon.off,
#fullscreenToggle.enabled .icon.off {
  display: none;
}

/* Scene List Styling - Modern Green Theme */
#sceneList {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  width: 280px;
  background: linear-gradient(to bottom, rgba(17, 24, 39, 0.98), rgba(31, 41, 55, 0.98));
  backdrop-filter: blur(20px);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 35;
  border-right: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  visibility: hidden;
}

#sceneList.enabled {
  transform: translateX(0);
  visibility: visible;
}

#sceneList .scenes {
  padding: 1rem 0;
  list-style: none;
  margin: 0;
}

#sceneList .scene {
  display: block;
  padding: 0;
  margin: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: rgba(55, 65, 81, 0.4);
  border: 1px solid rgba(75, 85, 99, 0.5);
  transition: all 0.2s ease;
  cursor: pointer;
}

#sceneList .scene:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateX(5px);
}

#sceneList .scene.current {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.25));
  border-color: rgba(16, 185, 129, 0.6);
}

#sceneList .scene .text {
  padding: 1rem;
  color: #f3f4f6;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  position: relative;
  display: flex;
  align-items: center;
}

#sceneList .scene.current .text {
  color: #10b981;
}

#sceneList .scene .text::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(156, 163, 175, 0.5);
  margin-right: 0.75rem;
  transition: all 0.2s ease;
}

#sceneList .scene.current .text::before {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

#sceneList .scene:hover .text::before {
  background: #10b981;
  transform: scale(1.2);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Control Panel Layout Improvements - Best Practice UX */
#controlPanel {
  max-width: 90vw;
  overflow: visible;
  z-index: 50;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show Controls Button */
#showControlsBtn {
  opacity: 0;
  transform: translateX(-50%) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 51;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 8px 48px rgba(16, 185, 129, 0.6);
  }
}

#controlPanel .flex {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

/* Ensure buttons don't overlap */
#controlPanel button,
#controlPanel .h-6 {
  flex-shrink: 0;
  position: relative;
  z-index: 51;
  pointer-events: auto;
}

/* Direction pad container */
#controlPanel .grid {
  flex-shrink: 0;
  min-width: 80px;
}

/* Scene list toggle button - ensure it's always on top */
#sceneListToggle {
  z-index: 52 !important;
  pointer-events: auto;
}

/* Branding bar - ensure proper spacing */
#brandingBar {
  pointer-events: auto;
}

/* Mobile Small (< 480px) - Ultra Compact */
@media (max-width: 479px) {
  #brandingBar {
    padding: 0.375rem 0.75rem;
  }

  #brandingBar img {
    height: 1.5rem;
  }

  #brandingBar h1 {
    font-size: 0.625rem;
  }

  #brandingBar p {
    display: none;
  }

  #controlPanel {
    bottom: 12px;
    padding: 0.375rem 0.5rem;
    max-width: 98vw;
  }

  #controlPanel .flex {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  #controlPanel button {
    padding: 0.375rem;
    width: 36px;
    height: 36px;
  }

  #controlPanel svg {
    width: 1rem;
    height: 1rem;
  }

  #controlPanel .grid {
    display: none;
  }

  #controlPanel .h-6 {
    display: none;
  }

  #sceneList {
    width: 220px;
    top: 45px;
  }
}

/* Mobile Medium (480px - 768px) */
@media (min-width: 480px) and (max-width: 768px) {
  #brandingBar {
    padding: 0.5rem 1rem;
  }

  #brandingBar h1 {
    font-size: 0.75rem;
  }

  #controlPanel {
    bottom: 16px;
    padding: 0.5rem 0.75rem;
    max-width: 95vw;
  }

  #controlPanel .flex {
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  #controlPanel button {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
  }

  #controlPanel svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  #controlPanel .grid {
    display: none;
  }

  #controlPanel .h-6 {
    display: none;
  }

  #sceneList {
    width: 240px;
    top: 50px;
  }

  #sceneList .scene {
    margin: 0.25rem 0.75rem;
  }

  #sceneList .scene .text {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #brandingBar {
    padding: 0.625rem 1.25rem;
  }

  #controlPanel {
    bottom: 20px;
    padding: 0.625rem 1rem;
    max-width: 85vw;
  }

  #controlPanel .flex {
    gap: 0.375rem;
  }

  #controlPanel button {
    padding: 0.5rem;
    width: 44px;
    height: 44px;
  }

  #controlPanel .grid {
    transform: scale(0.9);
  }

  #sceneList {
    width: 260px;
  }
}

/* Desktop Small (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
  #controlPanel {
    bottom: 24px;
    max-width: 80vw;
  }

  #controlPanel .flex {
    gap: 0.5rem;
  }
}

/* Desktop Large (> 1440px) */
@media (min-width: 1441px) {
  #controlPanel {
    bottom: 32px;
    max-width: 70vw;
  }

  #controlPanel .flex {
    gap: 0.75rem;
  }

  #controlPanel button {
    padding: 0.75rem;
  }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
  #controlPanel button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #brandingBar img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Smooth scrollbar for scene list */
#sceneList::-webkit-scrollbar {
  width: 6px;
}

#sceneList::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
}

#sceneList::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.5);
  border-radius: 3px;
}

#sceneList::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.7);
}

/* Loading indicator */
.marzipano-view-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Hotspot styling - green theme */
.hotspot {
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.hotspot:hover {
  opacity: 1;
}

.hotspot-icon {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.7));
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.6);
  animation: hotspot-pulse 2s ease-in-out infinite;
}

@keyframes hotspot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.6);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.9);
  }
}

/* Accessibility improvements */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Touch feedback */
@media (hover: none) {
  button:active {
    transform: scale(0.95) !important;
  }
}

/* Fullscreen mode adjustments */
:-webkit-full-screen #brandingBar {
  display: none;
}

:-moz-full-screen #brandingBar {
  display: none;
}

:fullscreen #brandingBar {
  display: none;
}

