/**
 * Gate Animation Widget Styles
 * Responsive styles for laptop, tablet, and mobile
 */

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Gate Wrapper */
.gate-animation-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #1a1a1a;
  margin: 0;
  padding: 0;
}

/* Gate Container */
.gate-animation-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* Gate Frame (Background) */
.gate-frame {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.gate-frame img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  object-fit: contain;
}

/* Left Gate Door */
.gate-left {
  position: absolute;
  width: 50%;
  height: 100%;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0;
  z-index: 3;
  overflow: hidden;
}

.gate-left img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
  transform-origin: right center;
}

/* Right Gate Door */
.gate-right {
  position: absolute;
  width: 50%;
  height: 100%;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 0;
  z-index: 3;
  overflow: hidden;
}

.gate-right img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
  transform-origin: left center;
}

/* Welcome Text */
.welcome-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
}

.welcome-text-content {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  padding: 0 20px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  font-family: 'Georgia', serif;
  line-height: 1.2;
}

/* Scroll Spacer - Removed to eliminate extra space */
.scroll-spacer {
  height: 0;
  display: none;
}

/* Elementor Editor Compatibility */
.elementor-editor .gate-animation-wrapper {
  pointer-events: auto;
}

.elementor-editor .gate-animation-wrapper * {
  pointer-events: none;
}

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

/* Tablet Landscape (1024px and below) */
@media (max-width: 1024px) {
  .gate-frame img {
    max-width: 900px;
  }
  
  .gate-left img,
  .gate-right img {
    max-width: 450px;
  }
  
  .welcome-text-content {
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    letter-spacing: 1.5px;
  }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {
  .gate-frame img {
    max-width: 700px;
  }
  
  .gate-left img,
  .gate-right img {
    max-width: 400px;
  }
  
  .welcome-text-content {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: 1px;
    padding: 0 15px;
  }
  
  /* Adjust gate positions for smaller screens */
  .gate-left {
    width: 55%;
  }
  
  .gate-right {
    width: 55%;
  }
}

/* Mobile Landscape (640px and below) */
@media (max-width: 640px) {
  .gate-animation-wrapper {
    height: 100vh;
    min-height: 500px;
  }
  
  .gate-animation-container {
    height: 100vh;
    min-height: 500px;
  }
  
  .gate-frame img {
    max-width: 500px;
  }
  
  .gate-left img,
  .gate-right img {
    max-width: 300px;
  }
  
  .welcome-text-content {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    letter-spacing: 0.5px;
  }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
  .gate-frame img {
    max-width: 400px;
  }
  
  .gate-left img,
  .gate-right img {
    max-width: 250px;
  }
  
  .welcome-text-content {
    font-size: clamp(1rem, 3vw, 1.8rem);
    padding: 0 10px;
  }
  
  /* Stack gates more for very small screens */
  .gate-left,
  .gate-right {
    width: 60%;
  }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
  .gate-animation-wrapper {
    min-height: 450px;
  }
  
  .gate-animation-container {
    min-height: 450px;
  }
  
  .gate-left img,
  .gate-right img {
    max-width: 200px;
  }
  
  .welcome-text-content {
    font-size: clamp(0.9rem, 2.5vw, 1.5rem);
    letter-spacing: 0;
  }
}

/* High DPI / Retina Displays */
@media 
  (-webkit-min-device-pixel-ratio: 2),
  (min-resolution: 192dpi) {
  .gate-frame img,
  .gate-left img,
  .gate-right img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print Styles */
@media print {
  .gate-animation-wrapper {
    height: auto;
    page-break-inside: avoid;
  }
  
  .scroll-spacer {
    display: none;
  }
}

/* Accessibility - Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  .gate-animation-wrapper,
  .gate-animation-wrapper * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .gate-animation-wrapper {
    background: #0a0a0a;
  }
}

/* Performance Optimizations */
.gate-frame,
.gate-left,
.gate-right,
.welcome-text {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Only apply will-change during animation (GSAP handles this automatically) */
.gate-animation-wrapper.is-animating .gate-frame,
.gate-animation-wrapper.is-animating .gate-left,
.gate-animation-wrapper.is-animating .gate-right,
.gate-animation-wrapper.is-animating .welcome-text {
  will-change: transform, opacity;
}

.gate-frame img,
.gate-left img,
.gate-right img {
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
