/* === BASE UNITY STYLES (WORKING VERSION) === */
html {
  box-sizing: border-box;
  background-color: black !important;
}

*, *:before, *:after {
  box-sizing: inherit;
}

html, body {
  height: 100%;
  background-color: black !important;
}

canvas {
  display: block;
}

body {
  margin: 0;
}

#unity-container {
  width: 100%;
  height: 100%;
  background-color: black !important;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  background-color: black !important;
}

#loading-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black !important;
  overflow: hidden;
}

#loading-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 5;
}

#background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  object-fit: cover;
  object-position: center;
}

#unity-loading-bar {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 10;
  background: transparent !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  max-width: none !important;
  max-height: none !important;
}

#unity-logo {
  text-align: center;
  position: relative;
  z-index: 11;
}

#unity-logo img {
  max-width: 80%;
}

#unity-fullscreen-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 38px;
  height: 38px;
  background: url('TemplateData/fullscreen-button.png') no-repeat center;
  background-size: contain;
}

/* Spinner styles */
.spinner,
.spinner:after {
  border-radius: 50%;
  width: 5em;
  height: 5em;
}

.spinner {
  margin: 10px;
  font-size: 10px;
  position: relative;
  text-indent: -9999em;
  border-top: 1.1em solid rgba(255, 255, 255, 0.2);
  border-right: 1.1em solid rgba(255, 255, 255, 0.2);
  border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
  border-left: 1.1em solid #ffffff;
  transform: translateZ(0);
  animation: spinner-spin 1.1s infinite linear;
  z-index: 11;
  display: none !important;
}

@keyframes spinner-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === CUSTOM FEATURES === */

/* Welcome message */
#welcome-text {
  text-align: center;
  margin: 5px auto 15px auto;
  opacity: 0;
  animation: welcomeFadeIn 1.5s ease-out 0.5s forwards;
  position: relative;
  z-index: 11;
  display: none !important;
}

.welcome-message {
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(90deg, #ff9a9e, #fecfef, #a8e6cf, #b4c6e7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 20px rgba(255, 154, 158, 0.3);
  letter-spacing: -0.5px;
}

/* Progress bar styling */
#unity-progress-bar-empty {
  width: 60% !important;
  height: 8px !important;
  margin: 10px auto 20px auto !important;
  border: none !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 0 !important;
  overflow: hidden;
  position: relative;
  z-index: 11;
}

#unity-progress-bar-full {
  height: 100% !important;
  background: #ffffff !important;
  border-radius: 10px !important;
  transition: width 0.3s ease !important;
  box-shadow: none !important;
  animation: none !important;
}

/* Did You Know section - normal flow below progress bar */
#did-you-know {
  width: 90% !important;
  max-width: 600px !important;
  margin: 15px auto 0 auto !important;
  padding: 0 !important;
  opacity: 0;
  animation: didYouKnowFadeIn 1s ease-out 1.4s forwards;
  position: relative !important;
  display: block !important;
  text-align: center !important;
  z-index: 11;
}

#did-you-know .tip-container {
  width: 100% !important;
  min-height: 50px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 2px solid rgba(255,255,255,0.35) !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 18px !important;
  box-sizing: border-box !important;
  // backdrop-filter: blur(12px) !important;
  flex-direction: column !important;
  text-align: center !important;
}

#did-you-know .tip-label {
  display: block !important;
  margin: 0 0 8px 0 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.6) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  flex-shrink: 0 !important;
  text-align: center !important;
}

#did-you-know .tip-text {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: rgba(255,255,255,0.92) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial !important;
  line-height: 1.4 !important;
  text-align: center !important;
  width: 100% !important;
}

/* === ANIMATIONS === */
@keyframes welcomeFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes progress-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 154, 158, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 154, 158, 0.8); }
}

@keyframes didYouKnowFadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

@keyframes tipWooshOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(1px);
  }
}

@keyframes tipWooshIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

/* === RESPONSIVE STYLES === */

/* Mobile styles */
@media (max-width: 768px) {
  /* Loading bar mobile adjustments */
  #unity-loading-bar {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  
  /* Logo adjustments for mobile */
  #unity-logo img {
    max-width: 120% !important;
  }
  
  /* Welcome text mobile adjustments */
  .welcome-message {
    font-size: 22px !important;
    font-weight: 600 !important;
    letter-spacing: -0.3px !important;
    line-height: 1.2 !important;
    padding: 0 20px;
  }
  
  #welcome-text {
    margin: 3px auto 10px auto;
  }
  
  /* Progress bar mobile adjustments */
  #unity-progress-bar-empty {
    width: 80% !important;
    height: 6px !important;
    margin: 8px auto 15px auto !important;
  }
  
  /* Did you know mobile adjustments */
  #did-you-know {
    width: 95% !important;
    margin: 10px auto 0 auto !important;
  }
  
  #did-you-know .tip-container {
    padding: 10px 12px !important;
    min-height: 45px !important;
    flex-direction: column !important;
  }
  
  #did-you-know .tip-label {
    font-size: 8px !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: 0.5px !important;
  }
  
  #did-you-know .tip-text {
    font-size: 11px !important;
    line-height: 1.3 !important;
  }
  
  /* Spinner mobile adjustments */
  .spinner {
    margin: 8px;
    font-size: 8px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  /* Loading bar extra small mobile adjustments */
  #unity-loading-bar {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  
  #unity-logo img {
    max-width: 120% !important;
  }
  
  .welcome-message {
    font-size: 18px !important;
    padding: 0 15px;
  }
  
  #welcome-text {
    margin: 3px auto 8px auto;
  }
  
  #unity-progress-bar-empty {
    width: 85% !important;
    height: 5px !important;
    margin: 6px auto 12px auto !important;
  }
  
  #did-you-know {
    width: 98% !important;
    margin: 8px auto 0 auto !important;
  }
  
  #did-you-know .tip-container {
    padding: 8px 10px !important;
    min-height: 40px !important;
    flex-direction: column !important;
  }
  
  #did-you-know .tip-label {
    font-size: 7px !important;
    margin: 0 0 5px 0 !important;
  }
  
  #did-you-know .tip-text {
    font-size: 10px !important;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1023px) {
  #unity-logo img {
    max-width: 120% !important;
  }
  
  .welcome-message {
    font-size: 28px !important;
  }
  
  #welcome-text {
    margin: 5px auto 12px auto;
  }
  
  #unity-progress-bar-empty {
    margin: 9px auto 18px auto !important;
  }
  
  #did-you-know {
    max-width: 700px !important;
    margin: 12px auto 0 auto !important;
  }
  
  #did-you-know .tip-container {
    min-height: 55px !important;
    flex-direction: column !important;
  }
  
  #did-you-know .tip-text {
    font-size: 12px !important;
  }
}

/* Desktop styles */
@media (min-width: 1024px) {
  #unity-logo img {
    max-width: 120% !important;
  }
  
  .welcome-message {
    font-size: 36px !important;
  }
  
  #did-you-know {
    margin: 15px auto 0 auto !important;
  }
  
  #did-you-know .tip-container {
    min-height: 60px !important;
    flex-direction: column !important;
  }
  
  #did-you-know .tip-label {
    font-size: 11px !important;
  }
  
  #did-you-know .tip-text {
    font-size: 14px !important;
  }
}

/* Large desktop styles */
@media (min-width: 1440px) {
  #unity-logo img {
    max-width: 120% !important;
  }
  
  .welcome-message {
    font-size: 40px !important;
  }
  
  #did-you-know {
    margin: 18px auto 0 auto !important;
  }
  
  #did-you-know .tip-container {
    min-height: 65px !important;
    flex-direction: column !important;
  }
  
  #did-you-know .tip-text {
    font-size: 15px !important;
  }
}

