/* Video optimization CSS */
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy loading placeholder */
video[data-lazy="true"]:not([data-loaded="true"]) {
  background-color: #f5f5f5;
  background-image: linear-gradient(45deg, transparent 35%, rgba(255, 255, 255, 0.5) 35%, rgba(255, 255, 255, 0.5) 65%, transparent 65%),
                    linear-gradient(-45deg, transparent 35%, rgba(255, 255, 255, 0.5) 35%, rgba(255, 255, 255, 0.5) 65%, transparent 65%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px;
  animation: loading-placeholder 2s linear infinite;
}

@keyframes loading-placeholder {
  0% {
    background-position: 0 0, 0 10px;
  }
  100% {
    background-position: 40px 0, 40px 10px;
  }
}

/* Video loading states */
.video-content {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.video-content:not(.is-active) {
  display: none;
}

/* Performance improvements */
video {
  will-change: transform;
}

/* Reduce layout shift */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Section separation with alternating backgrounds */
.section:nth-child(even) {
  background-color: #f8f9fa;
}

.section:nth-child(odd) {
  background-color: #ffffff;
}

.hero.teaser {
  background-color: #ffffff;
}

/* Add spacing between teaser video and subtitle */
.hero.teaser .subtitle {
  margin-top: 2rem;
}

/* Center the detailed results video */
#tree {
  display: block;
  margin: 0 auto;
}