body {
  margin: 0;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  user-select: none; /* Prevent text selection */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE */
}

video {
  display: none;
}

a-scene {
  width: 100vw;
  height: 100vh;
}

/* Video Controls Overlay */
#video-controls-overlay {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 15px;
  border-radius: 10px;
  font-family: Arial, sans-serif;
  z-index: 1000;
  width: 90%;
  max-width: 800px;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px); /* Modern browsers */
}

#video-controls-overlay .control-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

#video-controls-overlay .control-button {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

/* Fullscreen button specific style */
#fullscreen-btn {
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  margin-bottom: 15px;
}

.progress-bar {
  height: 100%;
  background: #007bff;
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s ease;
}

.time-display {
  font-size: 12px;
  color: #ccc;
  min-width: 80px;
  text-align: right;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
}

.show-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.toggle-controls-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 10px;
  transition: background 0.3s ease;
}

/* Loading and Play Button Overlays */
#loading-overlay, #big-play-button {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2500;
  color: white;
  font-family: Arial, sans-serif;
}

#loading-overlay {
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  display: none;
}

#big-play-button {
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  display: none;
}

.big-play-symbol {
  font-size: 120px;
  color: white;
  text-shadow: 0 0 20px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.loading-progress {
  font-size: 14px;
}

/* Start Overlay */
#start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  display: none;
}

/* Tablet Styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  #video-controls-overlay {
    max-width: 90vw;
    padding: 15px;
  }

  .control-button {
    width: 35px !important;
    height: 35px !important;
    font-size: 14px !important;
  }

  #fullscreen-btn {
    width: 35px !important;
    height: 35px !important;
  }

  .progress-container {
    height: 6px;
  }

  .volume-slider {
    width: 60px;
  }

  .time-display {
    font-size: 11px;
    min-width: 70px;
  }

  .big-play-symbol {
    font-size: 80px;
  }

  .show-toggle {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}

/* Mobile Styles (up to 767px) */
@media (max-width: 767px) {
  #video-controls-overlay {
    bottom: 10px;
    padding: 12px;
    min-width: 280px;
    max-width: 95vw;
  }

  .control-buttons { /* Make buttons container responsive */
    flex-wrap: wrap;
    gap: 10px;
  }

  .control-button {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  #fullscreen-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
  }

  .progress-container {
    height: 6px;
    margin-bottom: 10px;
  }

  .volume-container {
    gap: 5px;
  }

  .volume-slider {
    width: 50px;
  }

  .time-display {
    font-size: 10px;
    min-width: 60px;
  }

  .toggle-controls-btn {
    padding: 6px 12px;
    font-size: 11px;
    margin-top: 8px;
  }

  .big-play-symbol {
    font-size: 60px;
  }

  .show-toggle {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .loading-progress {
    font-size: 12px;
  }

  #start-overlay div:first-child { /* Play emoji */
    font-size: 80px;
  }

  #start-overlay div:nth-child(2) { /* "Нажмите чтобы начать" */
    font-size: 20px;
    margin-bottom: 8px;
  }

  #start-overlay div:nth-child(3) { /* "360° видео воспроизведение" */
    font-size: 14px;
  }
}

/* Region theming example - Udmurtia style */
.region-header {
  background: linear-gradient(135deg, #FF7F00, #FFFFFF);
  color: #333;
  text-align: center;
  padding: 10px;
  font-size: 1.5em;
}

/* Analytics Modal Styles */
.analytics-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.analytics-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.analytics-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.analytics-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.analytics-modal-close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
  line-height: 1;
}

.analytics-modal-close:hover {
  transform: scale(1.1);
}

.analytics-modal-body {
  padding: 24px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.analytics-info {
  margin-bottom: 20px;
  text-align: center;
}

.analytics-video-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.analytics-total-views {
  font-size: 1rem;
  color: #718096;
  font-weight: 500;
}

.analytics-chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  margin: 0 auto;
}

.analytics-error {
  text-align: center;
  padding: 40px;
  color: #e53e3e;
}

.analytics-error p {
  margin: 0;
  font-size: 1.1rem;
}

.analytics-loading {
  text-align: center;
  padding: 40px;
  color: #718096;
}

.analytics-loading p {
  margin: 0;
  font-size: 1.1rem;
}

/* Responsive Design for Analytics Modal */
@media (max-width: 768px) {
  .analytics-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .analytics-modal-header {
    padding: 16px 20px;
  }

  .analytics-modal-header h3 {
    font-size: 1.3rem;
  }

  .analytics-modal-body {
    padding: 20px;
    max-height: calc(85vh - 70px);
  }

  .analytics-chart-container {
    height: 250px;
  }

  .analytics-video-title {
    font-size: 1.1rem;
  }

  .analytics-total-views {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .analytics-modal-content {
    width: 98%;
    margin: 10px;
  }

  .analytics-modal-header {
    padding: 12px 16px;
  }

  .analytics-modal-header h3 {
    font-size: 1.2rem;
  }

  .analytics-modal-close {
    font-size: 24px;
  }

  .analytics-modal-body {
    padding: 16px;
  }

  .analytics-chart-container {
    height: 200px;
  }

  .analytics-info {
    margin-bottom: 16px;
  }
}
