/* Tabelo - Home Page Carousel Section (Section 2) */

/* ===== Phone Placeholder (fallback for non-animated cards) ===== */
.phone-placeholder {
  width: min(180px, 45vw);
  aspect-ratio: 9 / 19;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(245, 180, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 1s ease-out 0.4s backwards;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.phone-placeholder:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 48px rgba(245, 180, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.phone-placeholder::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== Carousel Container ===== */
.carousel-container {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  padding: 0;
  margin-left: calc(-50vw + 50%);
  overflow: visible;
}

.carousel-track {
  display: flex;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  gap: 24px;
  padding: 0 24px;
  touch-action: pan-x;
  cursor: grab;
}

.carousel-track:active {
  cursor: grabbing;
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* ===== Carousel Slides ===== */
.carousel-slide {
  flex: 0 0 calc(85vw - 24px);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  height: 60vh;
  min-height: 400px;
  background: #D4E4E7;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
}

/* Individual card colors */
.carousel-slide[data-slide-index="1"] {
  background: #D4E4E7; /* Muted teal */
}

.carousel-slide[data-slide-index="2"] {
  background: #E4D9E8; /* Muted lavender */
}

.carousel-slide[data-slide-index="3"] {
  background: #D9E7D4; /* Muted sage */
}

/* ===== Slide Content ===== */
.slide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: var(--spacing-xl) var(--spacing-lg);
  position: relative;
}

.slide-text {
  text-align: center;
  max-width: 100%;
  z-index: 2;
}

.slide-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.slide-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Flow Phone Placeholders (carousel phones) ===== */
.flow-phone {
  width: 240px;
  height: 320px; /* Shorter height to show top portion */
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px 18px 0 0; /* Only round top corners */
  box-shadow: 0 8px 32px rgba(245, 180, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
  z-index: 1;
}

.flow-phone::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: var(--bg-primary);
  border-radius: 9px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== Carousel Lottie Animations (Slides 1 & 2) ===== */
.carousel-lottie {
  width: 100%;
  max-width: 322px;
  height: auto;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto; /* Allow hover on desktop */
}

/* ===== Responsive Breakpoints ===== */

/* Tablet: 2 cards visible with peek */
@media (min-width: 769px) and (max-width: 1024px) {
  .carousel-slide {
    flex: 0 0 calc(48vw - 32px);
    scroll-snap-align: start;
  }

  .flow-phone {
    width: 220px;
    height: 290px;
  }

  .carousel-lottie {
    max-width: 299px;
  }
}

/* Desktop: 3 cards visible with peek */
@media (min-width: 1025px) {
  .carousel-slide {
    flex: 0 0 calc(31vw - 36px);
    scroll-snap-align: start;
  }

  .carousel-track {
    padding: 0 24px;
    justify-content: center;
  }

  .flow-phone {
    width: 200px;
    height: 260px;
  }

  .carousel-lottie {
    max-width: 276px;
  }

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

  .slide-body {
    font-size: 0.9375rem;
  }
}
