/* ============================================
   ACADEMY CAROUSEL & PHONE MOCKUP STYLES
   ============================================ */

/* ============================================
   PHONE MOCKUP
   ============================================ */

.phone-mockup-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Ensure center alignment on mobile */
@media (max-width: 768px) {
  .phone-mockup-container {
    margin: 0 auto;
    text-align: center;
  }

  .phone-mockup-container .screenshot-carousel-mini {
    margin-left: auto;
    margin-right: auto;
  }
}

.phone-mockup {
  position: relative;
  width: 375px;
  max-width: 100%;
  aspect-ratio: 375 / 812;
  border: 12px solid #1a1a1a;
  border-radius: 40px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.05);
  background: #000;
}

.phone-mockup::before {
  /* Top notch */
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: #1a1a1a;
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

.phone-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   HORIZONTAL RESULTS GALLERY
   ============================================ */

.results-gallery-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0 80px;
}

/* Edge gradients to indicate more content */
.results-gallery-container::before,
.results-gallery-container::after {
  content: '';
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.results-gallery-container::before {
  left: 0;
  background: linear-gradient(90deg, rgba(10, 10, 10, 1) 0%, transparent 100%);
}

.results-gallery-container::after {
  right: 0;
  background: linear-gradient(270deg, rgba(10, 10, 10, 1) 0%, transparent 100%);
}

.results-gallery {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 20px 0;
}

.results-gallery::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.result-card {
  flex: 0 0 auto;
  width: 600px; /* Horizontal screenshots */
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(13, 24, 41, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.result-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 136, 204, 0.3);
  border-color: rgba(0, 136, 204, 0.5);
}

.result-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Gallery Arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 136, 204, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-arrow:hover {
  background: rgba(0, 198, 255, 1);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
}

.gallery-arrow-left {
  left: 10px;
}

.gallery-arrow-right {
  right: 10px;
}

/* Swipe Hint (shown once on mobile) */
.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 136, 204, 0.95);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  z-index: 15;
  opacity: 0;
  animation: swipeHintPulse 3s ease-in-out;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 136, 204, 0.5);
}

@keyframes swipeHintPulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

.swipe-hint-arrows {
  display: inline-block;
  margin: 0 0.5rem;
  font-size: 1.3rem;
}

/* Hide swipe hint on desktop */
@media (min-width: 769px) {
  .swipe-hint {
    display: none;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 48px;
  font-weight: 300;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  line-height: 1;
  padding: 0;
  width: 48px;
  height: 48px;
}

.lightbox-close:hover {
  transform: scale(1.2);
  color: #ff5555;
}

/* ============================================
   MINI CAROUSELS (For content blocks)
   ============================================ */

.screenshot-carousel-mini {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Desktop: galleries aligned to left (close to text) */
@media (min-width: 769px) {
  .screenshot-carousel-mini {
    margin: 0 !important;
  }

  .screenshot-carousel-mini .phone-mockup {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Mobile: center alignment */
@media (max-width: 768px) {
  .screenshot-carousel-mini {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }

  /* Specific fix for clipping and monetization carousels */
  #clippingCarousel,
  #monetizCarousel {
    margin: 0 auto !important;
    max-width: 320px;
  }

  /* Center phone mockup inside carousels */
  .screenshot-carousel-mini .phone-mockup {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Center parent containers */
  .order-2.lg\\:order-1 .phone-mockup-container,
  .order-1.lg\\:order-2 .phone-mockup-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.carousel-track-mini {
  position: relative;
  overflow: hidden;
}

.carousel-track-mini .phone-mockup {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-track-mini .phone-mockup.active {
  display: block;
  opacity: 1;
}

.carousel-track-mini .phone-mockup:first-child {
  display: block;
  opacity: 1;
}

.carousel-dots-mini {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.dot-mini {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.dot-mini.active {
  background: #0088cc;
  width: 24px;
  border-radius: 4px;
}

.dot-mini:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Mini Carousel Arrows */
.screenshot-carousel-mini {
  position: relative;
}

.mini-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.8), rgba(0, 198, 255, 0.8));
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-carousel-arrow:hover {
  background: linear-gradient(135deg, rgba(0, 198, 255, 1), rgba(0, 136, 204, 1));
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
  z-index: 5;
}

.mini-carousel-arrow-left {
  left: -60px;
}

.mini-carousel-arrow-right {
  right: -60px;
}

.mini-carousel-arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 3;
}

/* Hide arrows on mobile to prevent overflow */
@media (max-width: 768px) {
  .mini-carousel-arrow {
    display: none;
  }
}

/* ============================================
   AI CHAT PREVIEW (2 screenshots side by side)
   ============================================ */

.ai-chat-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.ai-chat-preview .phone-mockup {
  width: 100%;
}

/* Convert to carousel on mobile */
@media (max-width: 768px) {
  .ai-chat-preview {
    display: block;
    max-width: 320px;
    margin: 0 auto;
  }

  .ai-chat-preview .phone-mockup {
    display: none;
  }

  .ai-chat-preview .phone-mockup:first-child {
    display: block;
  }

  .ai-chat-preview .phone-mockup.active {
    display: block;
  }

  /* Add dots for navigation */
  .ai-chat-preview::after {
    content: '';
    display: block;
    height: 30px;
  }
}

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

@media (max-width: 768px) {
  .results-carousel-wrapper {
    padding: 0 40px;
  }

  .result-slide {
    flex-direction: column;
    padding: 24px;
  }

  .result-title {
    font-size: 1.5rem;
  }

  .result-description {
    font-size: 1rem;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
  }

  .ai-chat-preview {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .phone-mockup {
    width: 280px; /* Reduced from 300px */
  }

  /* Fix results gallery container padding */
  .results-gallery-container {
    padding: 0 20px; /* Reduced from 80px */
  }

  /* Fix result cards size for mobile */
  .result-card {
    width: 85vw;
    max-width: 500px;
  }
}

@media (max-width: 480px) {
  .results-carousel-wrapper {
    padding: 0 20px;
  }

  .result-slide {
    padding: 16px;
  }

  .phone-mockup {
    width: 260px; /* Adjusted from 250px */
  }

  /* Smaller result cards for very small screens */
  .result-card {
    width: 90vw;
    max-width: 400px;
  }
}

@media (max-width: 375px) {
  .phone-mockup {
    width: 240px; /* Fixed progression: 768px=280px → 480px=260px → 375px=240px */
  }

  .gallery-arrow {
    width: 40px;
    height: 40px;
  }

  .results-gallery-container {
    padding: 0 15px; /* Further reduced for very small screens */
  }

  /* Even smaller result cards for iPhone SE */
  .result-card {
    width: 92vw;
    max-width: 350px;
  }
}
