/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
}

/* Background image styling */
body {
  background-image: url('photo-1588281345136-9893252095bd.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Main container for Three.js canvas */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Book container in top right corner */
#book-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  height: 300px;
  z-index: 5;
  cursor: pointer;
}

#book-container canvas {
  pointer-events: auto;
}

/* $CHUCK branding element */
#branding {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 5rem;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(255, 215, 0, 0.5);
  letter-spacing: 0.15em;
  pointer-events: none;
  font-family: 'Impact', 'Arial Black', sans-serif;
}

/* CA label */
#ca-label {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 2rem;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  font-family: 'Arial', sans-serif;
}

/* Volume slider */
.volume-slider {
  position: fixed;
  bottom: 40px;
  left: 40px;
  z-index: 10;
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.volume-slider:hover {
  opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #FFF;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #FFF;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Loading indicator */
#loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  text-align: center;
}

#loading-indicator .spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 215, 0, 0.3);
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

#loading-indicator .loading-text {
  color: #FFD700;
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hidden state for loading indicator */
.hidden {
  display: none;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
  #branding {
    font-size: 3rem;
    top: 20px;
  }
  
  #loading-indicator .spinner {
    width: 50px;
    height: 50px;
    border-width: 5px;
  }
  
  #loading-indicator .loading-text {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  #branding {
    font-size: 2.5rem;
    top: 15px;
  }
  
  #loading-indicator .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
  
  #loading-indicator .loading-text {
    font-size: 1rem;
  }
}

/* Responsive styles for larger desktop screens */
@media (min-width: 1920px) {
  #branding {
    font-size: 6rem;
    top: 60px;
  }
}

/* Ensure canvas fills viewport on all screen sizes */
canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
