/* ============================================================================
   FEATURES CAROUSEL COMPONENT

   3D carousel showcasing app features with left/center/right slide positions,
   navigation arrows, and indicators.

   Purpose: Display app screenshots/features in an interactive, visually
   engaging carousel with 3D perspective effects.

   Required HTML Structure:

   <section class="features-showcase">
     <div class="container">
       <h2 class="section-title">Features Title</h2>
       <p class="section-subtitle">Subtitle text (optional)</p>

       <div class="showcase-container">
         <button class="showcase-arrow showcase-arrow-left">
           <i class="fas fa-chevron-left"></i>
         </button>

         <div class="showcase-frame">
           <div class="showcase-slides">
             <div class="showcase-slide center">
               <img src="screenshot1.png" alt="Feature 1">
             </div>
             <div class="showcase-slide right">
               <img src="screenshot2.png" alt="Feature 2">
             </div>
             <!-- More slides with classes: far-left, left, center, right, far-right -->
           </div>
         </div>

         <button class="showcase-arrow showcase-arrow-right">
           <i class="fas fa-chevron-right"></i>
         </button>
       </div>

       <div class="showcase-caption">
         <h3 class="feature-name">Feature Name</h3>
         <p class="feature-description">Feature description text</p>
       </div>

       <div class="showcase-indicators">
         <div class="indicator active"></div>
         <div class="indicator"></div>
         <div class="indicator"></div>
       </div>
     </div>
   </section>

   Dependencies:
   - Font Awesome (for arrow icons)
   - JavaScript for carousel navigation logic

   Slide Position Classes:
   - .center        # Active/focused slide (center, full opacity, scale 1)
   - .left          # Left preview (85% scale, rotated, semi-transparent)
   - .right         # Right preview (85% scale, rotated, semi-transparent)
   - .far-left      # Hidden left (opacity 0)
   - .far-right     # Hidden right (opacity 0)

   Accessibility:
   - Arrow buttons should have aria-labels
   - Indicators should be keyboard accessible
   - Images should have descriptive alt text

   Interaction:
   - Desktop: Pause on hover, resume on mouse leave
   - Mobile: Tap center slide to toggle play/pause
   - Both: Click side previews to navigate left/right

   Notes:
   - Uses 3D transforms (perspective, rotateY)
   - Smooth transitions with cubic-bezier easing
   - Auto-rotation every 8 seconds
   - Three responsive breakpoints with static dimensions:
     * Desktop (>1024px): 900px x 500px frame, slides 630px x 450px visible
     * Tablet (769px-1024px): 700px x 450px frame, slides 490px x 405px visible
     * Mobile (≤768px): 240px max-width, 9:16 aspect ratio, slides 180px x 341px visible
   - Device-specific optimizations for iPhone SE

   Mac Screenshot Dimensions (2x Retina):
   - Desktop screenshots: 1260px x 900px
   - Tablet screenshots: 980px x 810px
   - Mobile screenshots: 360px x 682px
   ============================================================================ */

/* ===== Section Container ===== */

.features-showcase {
  padding: 40px 0 120px;
  background: transparent;
  position: relative;
  overflow: hidden;
}


/* ===== Carousel Container ===== */

.showcase-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 3rem 0;
  position: relative;
}

.showcase-frame {
  width: 900px;
  max-width: 95vw;
  height: 500px;
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: visible;
  position: relative;
  perspective: 1200px;
}

.showcase-slides {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}


/* ===== Slide Base Styles ===== */

.showcase-slide {
  position: absolute;
  width: 70%;
  height: 90%;
  top: 5%;
  left: 15%;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(
    145deg,
    rgba(30, 58, 138, 0.9),
    rgba(30, 64, 175, 0.7)
  );
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(96, 165, 250, 0.2);
  cursor: pointer;
  transform: translateX(0) scale(0.8);
  pointer-events: none;
  overflow: hidden;
}

.showcase-slide picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  user-select: none;
}


/* ===== Slide Position States ===== */

/* Center/Active slide */
.showcase-slide.center {
  opacity: 1;
  transform: translateX(0) scale(1);
  z-index: 3;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}

/* Left preview */
.showcase-slide.left {
  opacity: 0.5;
  transform: translateX(-85%) scale(0.85) rotateY(15deg);
  z-index: 2;
  filter: brightness(0.7);
  pointer-events: auto;
}

/* Right preview */
.showcase-slide.right {
  opacity: 0.5;
  transform: translateX(85%) scale(0.85) rotateY(-15deg);
  z-index: 2;
  filter: brightness(0.7);
  pointer-events: auto;
}

/* Far left (hidden) */
.showcase-slide.far-left {
  opacity: 0;
  transform: translateX(-150%) scale(0.7);
  z-index: 1;
}

/* Far right (hidden) */
.showcase-slide.far-right {
  opacity: 0;
  transform: translateX(150%) scale(0.7);
  z-index: 1;
}

/* Hover effects for side previews */
.showcase-slide.left:hover,
.showcase-slide.right:hover {
  opacity: 0.7;
  filter: brightness(0.85);
}


/* ===== Navigation Arrows ===== */

.showcase-arrow {
  background: rgba(30, 58, 138, 0.9);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: var(--light-blue);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 20px;
  z-index: 5;
  position: relative;
}

.showcase-arrow:hover {
  background: var(--navy-light);
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(96, 165, 250, 0.3);
}

.showcase-arrow:active {
  transform: scale(0.95);
}


/* ===== Caption ===== */

.showcase-caption {
  text-align: center;
  margin-top: 1rem;
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: visible;
}

.feature-name {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.feature-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}


/* ===== Indicators ===== */

.showcase-indicators {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 1rem;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(147, 197, 253, 0.3);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.indicator.active {
  background: var(--sky-blue);
  transform: scale(1.3);
}

.indicator:hover {
  background: rgba(147, 197, 253, 0.6);
}


/* ===== Responsive: Tablet ===== */

@media (max-width: 1024px) and (min-width: 769px) {
  .showcase-frame {
    width: 700px;
    height: 450px;
  }

  .showcase-slide {
    width: 70%;
    height: 90%;
  }

  .showcase-caption {
    height: 100px;
  }

  .feature-name {
    font-size: 1.5rem;
  }

  .feature-description {
    font-size: 1rem;
  }
}


/* ===== Responsive: Mobile (General) ===== */

@media (max-width: 768px) {
  .features-showcase {
    padding: 20px 0 60px;
  }

  .features-showcase .section-title {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
  }

  .features-showcase .section-subtitle {
    display: none;
  }

  .showcase-container {
    margin-top: 0;
    margin-bottom: 0.5rem;
    flex-direction: column;
  }

  /* Mobile phone dimensions for showcase */
  .showcase-slides {
    aspect-ratio: 9 / 16; /* Standard mobile aspect ratio */
    max-width: 240px;
    margin: 0 auto;
  }

  .showcase-frame {
    height: auto;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .showcase-slide {
    width: 75%;
    height: 80%;
    left: 12.5%;
    top: 10%;
  }

  .showcase-slide.left {
    transform: translateX(-75%) scale(0.8) rotateY(10deg);
  }

  .showcase-slide.right {
    transform: translateX(75%) scale(0.8) rotateY(-10deg);
  }

  .showcase-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
  }

  .showcase-arrow-left {
    left: 10px;
  }

  .showcase-arrow-right {
    right: 10px;
  }

  .showcase-caption {
    height: 100px;
    margin-top: 1rem;
  }

  .feature-name {
    font-size: 1.2rem;
  }

  .feature-description {
    font-size: 0.9rem;
  }
}


/* ===== Responsive: iPhone SE Specific ===== */

@media only screen and (min-device-width: 375px) and (max-device-width: 375px) and (min-device-height: 667px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) {
  .features-showcase {
    padding: 80px 10px 20px;
  }

  .features-showcase .section-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }

  .showcase-slides {
    aspect-ratio: 9 / 16;
    max-width: 223px !important;
    margin: 0 auto;
  }

  .showcase-slide {
    width: 78.5% !important;
    height: 83.5% !important;
    left: 10.75% !important;
    top: 8.25% !important;
  }

  .showcase-frame {
    height: 373px !important;
    max-height: 373px;
  }

  .showcase-caption {
    margin-top: 1rem;
    text-align: center;
    height: 80px;
  }

  .feature-name {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
  }

  .feature-description {
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .showcase-indicators {
    margin-top: 0.5rem;
  }

  .showcase-indicators .indicator {
    width: 6px;
    height: 6px;
    margin: 0 3px;
  }
}
