/* ===================================
   VIDEO BACKGROUND SYSTEM
   Add this to the TOP of sections.css
   ================================== */

/* ===== VIDEO BACKGROUNDS ===== */
.section-bg-video {
  position: relative;
  overflow: hidden;
}

.section-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  overflow: hidden;
}

.section-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
  z-index: -3;
}

/* ===== HERO VIDEO BACKGROUND ===== */
.hero.section-bg-video .hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.hero.section-bg-video .hero-webp {
  display: none; /* Hide the webp when using video */
}

.hero.section-bg-video .section-video {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: none;
  top: 0;
  left: 0;
}

/* ===== RESPONSIVE VIDEO BACKGROUNDS ===== */
@media (max-width: 768px) {
  .section-video {
    /* Optimize for mobile performance */
    min-width: 120%;
    min-height: 120%;
  }
}

/* ===== VIDEO LOADING STATES ===== */
.section-video-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-gray);
  z-index: -2;
}

.section-video-bg.loaded::before {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  .section-video {
    display: none;
  }
  
  .section-bg-video {
    background: var(--dark-gray);
  }
}

/* ===== FALLBACK FOR UNSUPPORTED BROWSERS ===== */
@supports not (object-fit: cover) {
  .section-video {
    display: none;
  }
}

/* ===== ENHANCED OVERLAY SYSTEM ===== */
.section-bg-video .section-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  transition: all 0.3s ease;
}

/* ===== VIDEO CONTROLS (Hidden by default) ===== */
.section-video::-webkit-media-controls {
  display: none !important;
}

.section-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

/* ===== INTERSECTION OBSERVER FOR PERFORMANCE ===== */
.section-video.paused {
  opacity: 0.5;
}

.section-video.playing {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ===== HERO SECTION ===== */
/* ===== HERO SECTION ===== */
.hero {
  height: 100vh;
  /* Remove this line: background: var(--gradient-hero); */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* Add fallback background only when no video */
.hero:not(.section-bg-video) {
  background: var(--gradient-hero);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-hero-overlay);
}


.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4); /* This will be overridden by config */
  z-index: -1; /* Changed from var(--z-hero-overlay) to -1 */
}

.hero-content {
  position: relative;
  z-index: var(--z-hero-content);
  animation: fadeInUp 1s ease-out;
}

.hero h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-light);
  text-shadow: var(--shadow-md);
}

.hero p {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-lg);
  opacity: 0.9;
  text-shadow: var(--shadow-sm);
}

/* ===== MUSIC VIDEO SECTION ===== */
#music-video {
  background: var(--gradient-music);
  position: relative;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* ===== DOCUMENTARY SECTION ===== */
#documentary {
  background: var(--gradient-documentary);
  position: relative;
}

#documentary .section-header h2,
#documentary .section-header p {
  color: var(--white);
}

#documentary .demo-reel {
  background: rgba(255, 255, 255, 0.15);
}

#documentary .demo-reel h3 {
  color: var(--white);
}

#documentary .demo-reel p {
  color: rgba(255, 255, 255, 0.9);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.ocean-kitchen {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ocean-kitchen h3 {
  color: var(--white);
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.ocean-kitchen > p {
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-lg);
}

/* ===== UGC SECTION ===== */
#ugc {
  background: var(--gradient-ugc);
  position: relative;
}

.ugc-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-xl);
}

/* ===== MOTION DESIGN SECTION ===== */
#motion-design {
  background: var(--gradient-motion);
  position: relative;
}

#motion-design .section-header h2,
#motion-design .section-header p {
  color: var(--dark-gray);
}

#motion-design .demo-reel {
  background: rgba(255, 255, 255, 0.15);
}

#motion-design .demo-reel h3 {
  color: var(--dark-gray);
}

#motion-design .demo-reel p {
  color: var(--medium-gray);
}

#motion-design .video-card {
  background: rgba(255, 255, 255, 0.1);
}

#motion-design .video-card h4 {
  color: var(--dark-gray);
}

#motion-design .video-card p {
  color: var(--light-gray);
}

/* ===== DYNAMIC REMOOSE SECTION ===== */

/* Main Content Layout - Perfect Equal Heights */
.remoose-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: stretch;
    margin-bottom: 4rem;
}

.remoose-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    width: 100%;
}

.remoose-logo img {
    height: 120px;
    width: auto;
}

/* Left Side Card - Equal Height Design */
.remoose-info-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.remoose-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.remoose-info-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Left Side Card - Equal Height Design */
.about-info-card {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.about-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.about-info-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.role-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: auto;
    align-self: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Right Side Demo - Enhanced */
.remoose-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

.demo-cta {
    text-align: center;
    margin-bottom: 2rem;
}

.demo-cta h4 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.demo-cta p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.3rem;
    font-weight: 300;
}

.scene-demo {
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.scene-demo:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.scene-demo img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 500px;
    transition: all 0.4s ease;
}

.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scene-demo:hover .scene-overlay {
    opacity: 1;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #333;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
    background: white;
}

/* Children Grid Section - Enhanced */
.remixes-section {
    margin-top: 5rem;
}

.remixes-header {
    text-align: center;
    margin-bottom: 3rem;
}

.remixes-header h3 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.remixes-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    font-weight: 300;
}

.remixes-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    scroll-behavior: smooth;
}

.remixes-grid::-webkit-scrollbar {
    height: 8px;
}

.remixes-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.remixes-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.remixes-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.remix-item {
    min-width: 300px;
    width: 300px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.remix-item:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    z-index: 10;
    position: relative;
}

.remix-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.remix-item:hover img {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .remoose-main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }

    .remoose-info-card {
        padding: 2rem;
        height: auto;
    }

    .demo-cta h4 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .demo-cta p {
        font-size: 1.1rem;
    }

    .scene-demo img {
        max-width: 400px;
    }

    .remixes-grid {
        grid-template-rows: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem 0;
    }

    .remix-item {
        min-width: 160px;
        height: 160px;
    }
}

/* Dynamic Background Grid - FULL COVERAGE */
.section-bg-remoose .remoose-background-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-template-rows: repeat(auto-fit, 200px); /* Fixed row height */
    gap: 2px;
    z-index: -3;
    opacity: 0.3;
    overflow: hidden;
}

@media (max-width: 768px) {
    .remoose-grid {
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .remoose-embed {
        min-width: 250px;
        height: 250px;
    }
    
    .remoose-background-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        grid-template-rows: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .remoose-embed {
        min-width: 200px;
        height: 200px;
    }
    
    .remoose-background-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        grid-template-rows: repeat(auto-fill, minmax(80px, 1fr));
    }
}

.remoose-bg-item {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.remoose-bg-item:hover {
    opacity: 0.8;
    transform: scale(1.02);
    z-index: 10;
    position: relative;
}

.remoose-bg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 3rem;
    color: #FF6B6B;
    position: relative;
    z-index: 2;
}

/* Scene Info Overlay */
.scene-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.remoose-embed:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.scene-tags {
    font-size: 0.8rem;
    opacity: 0.8;
}

.scene-date {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* Responsive adjustments for background grid */
@media (max-width: 768px) {
    .remoose-background-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        grid-auto-rows: 120px;
    }
}

@media (max-width: 480px) {
    .remoose-background-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        grid-auto-rows: 100px;
        opacity: 0.3;
    }
}

/* ===== CONTACT SECTION ===== */
#contact {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
}

#contact .section-header h2,
#contact .section-header p {
  color: var(--white);
}

/* ===== FOOTER ===== */
footer {
  background: var(--black);
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--space-3xl);
}

footer p {
  color: var(--lightest-gray);
  margin-bottom: var(--space-xs);
}

footer p:last-child {
  margin-bottom: 0;
  opacity: 0.7;
  font-size: var(--font-size-sm);
}

/* ===== SECTION TRANSITIONS ===== */
.section {
  position: relative;
  overflow: hidden;
  padding: var(--space-3xl) 0;
}

.section::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.1) 25%, 
    rgba(255, 255, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0.1) 75%, 
    transparent 100%
  );
  animation: shimmer 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes shimmer {
  0%, 100% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(100%);
    opacity: 1;
  }
}

/* ===== ENHANCED SECTION OVERLAYS ===== */
.section-overlay {
  background: var(--overlay-light);
}

/* Custom overlays for different sections */
#music-video .section-overlay {
  background: linear-gradient(135deg, 
    rgba(255, 107, 107, 0.3) 0%, 
    rgba(238, 90, 36, 0.3) 100%);
}

#documentary .section-overlay {
  background: linear-gradient(135deg, 
    rgba(78, 205, 196, 0.3) 0%, 
    rgba(68, 160, 141, 0.3) 100%);
}

#ugc .section-overlay {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.3) 0%, 
    rgba(118, 75, 162, 0.3) 100%);
}

#motion-design .section-overlay {
  background: linear-gradient(135deg, 
    rgba(168, 237, 234, 0.3) 0%, 
    rgba(254, 214, 227, 0.3) 100%);
}

#remoose .section-overlay {
  background: linear-gradient(135deg, 
    rgba(250, 112, 154, 0.3) 0%, 
    rgba(254, 225, 64, 0.3) 100%);
}

#contact .section-overlay {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.4) 0%, 
    rgba(118, 75, 162, 0.4) 100%);
}

/* ===== INTERSECTION ANIMATION CLASSES ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ===== CONTENT LAYER POSITIONING ===== */
.section .container {
  position: relative;
  z-index: 2;
}

/* ===== RESPONSIVE SECTION ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .doc-grid {
    grid-template-columns: 1fr;
  }
  
  .ugc-projects {
    grid-template-columns: 1fr;
  }
  
  .awards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .remoose-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-xl) 0;
  }
  
  .awards-grid {
    grid-template-columns: 1fr;
  }
  
  .remoose-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== BACKGROUND ATTACHMENT FOR PARALLAX EFFECT ===== */
@media (min-width: 1024px) {
  .section-bg-image::before {
    background-attachment: fixed;
  }
}

/* ===== SECTION HOVER EFFECTS ===== */
.section:hover .section-overlay {
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

/* ===== IMPROVED Z-INDEX STACKING ===== */
.section {
  z-index: 1;
}

.section-bg-image::before,
.section-bg-pattern::before {
  z-index: -3;
}

.section-overlay {
  z-index: -2;
}

.section .container {
  z-index: 1;
}

.hero-face {
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: center;
}

.hero-face-img {
    width: 400px;
    height: auto;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hero-face-img:hover {
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-face-img {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .hero-face-img {
        width: 80px;
    }
}