/* Homepage 2.0 Styles */

/* =====================
   CSS Variables
   ===================== */
:root {
  --cream: #FFFDF5;
  --pokydo-blue: #8CC6E2;
  --dark-slate: #3D5A5B;
  --orange: #F47B4B;
  --teal: #4A9B9B;
  --coral-red: #E85A4F;
  --yellow: #F9D56E;
  --lavender: #B8A9C9;
  --light-lavender: #D4C8E8;
  --pink-salmon: #E8A0A0;
  --purple: #9B8DC2;
  --amber: #E5A84B;
  --green: #7CB87C;
  --nav-pills-bg: #E8F4F8;
  --dark-text: #1a1a1a;
  --muted-text: #666;
}

/* =====================
   Global Homepage Styles
   ===================== */
body.homepage {
  font-family: 'Poppins', sans-serif;
  background-color: var(--cream);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  transition: background-color 0.5s ease;
}

/* Remove default vh-100 for homepage */
body.homepage.vh-100 {
  height: auto !important;
  min-height: 100vh;
}

/* =====================
   Homepage Navbar Override
   ===================== */
body.homepage #fancyNav {
  background-color: transparent !important;
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* Flash messages should appear above hero content */
body.homepage .alert {
  position: relative;
  z-index: 1100;
}

/* =====================
   Sections Base
   ===================== */
.homepage-section {
  min-height: 100vh;
  padding: 6rem 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

/* =====================
   Hero Section
   ===================== */
.hero-section {
  background-color: transparent; /* Body background shows through */
  min-height: 100vh;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: visible;
}

.hero-content {
  text-align: center;
  padding: 2rem;
  z-index: 2;
  transform-origin: center center;
  position: fixed;
  top: 15vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
}

.hero-headline {
  font-size: clamp(3rem, 10vw, 72px);
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-subhead {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--muted-text);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.btn-book-demo {
  display: inline-block;
  padding: 0.875rem 2rem;
  border: 2px solid var(--dark-text);
  border-radius: 50px;
  color: var(--dark-text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-book-demo:hover {
  background-color: var(--dark-text);
  color: var(--cream);
}

/* Phone Mockup */
.phone-mockup-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 2rem auto 0;
  z-index: 3; /* Above hero content so it overlaps when scrolling */
  transform: translateY(60vh); /* Initial position - peeking from bottom */
}

.phone-mockup {
  width: 100%;
  aspect-ratio: 9 / 16; /* Shorter phone ratio */
  background-color: #1a1a1a;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.phone-screen {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  margin: 6px;
  border-radius: 22px;
  background-color: var(--pokydo-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Fallback logo - hidden when video loads */
.phone-screen::after {
  content: '';
  width: 80px;
  height: 80px;
  background-image: url('/visualAssets/pokydoLogo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.8;
  position: absolute;
  z-index: 1;
}

/* Fallback logo stays visible until video covers it */
.phone-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* =====================
   Drive Section (Blue BG)
   ===================== */
.drive-section {
  background-color: transparent; /* Body background shows through */
  padding: 14rem 2rem 6rem; /* More top padding to clear phone */
  overflow: visible;
}

.section-headline {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--dark-text);
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-subhead {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--dark-slate);
  text-align: center;
  margin-bottom: 12rem; /* Much more spacing before cards */
}

/* Card Row Container */
.card-row-container {
  display: flex;
  flex-direction: column; /* Stack pill above cards */
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  overflow: visible;
  width: 100%;
}

/* Pill Badges */
.pill-badge {
  background-color: var(--yellow);
  color: var(--dark-text);
  padding: 1.5rem 3.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card Carousel */
.card-carousel-wrapper {
  position: relative;
  width: 100%; /* Use parent width, not viewport */
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center children (nav) */
}

.card-carousel {
  display: flex;
  justify-content: flex-start; /* Align to start */
  gap: 0; /* No gap - GSAP handles positioning */
  overflow-x: auto; /* Always auto to prevent jitter */
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 2rem 1rem 3rem; /* Padding from true viewport edges */
  min-height: 350px; /* Ensure height for stacked cards */
  width: 100vw; /* Full viewport width */
  margin-left: calc(-50vw + 50%); /* Break out of container */
  box-sizing: border-box;
  position: relative;
}

.card-carousel::-webkit-scrollbar {
  display: none;
}

/* Feature Cards */
.feature-card {
  flex: 0 0 auto;
  width: 375px;
  min-height: 317px;
  padding: 2rem;
  border-radius: 32px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Text at TOP */
  cursor: pointer;
  position: relative;
}

/* Snap alignment when scrolling */
.card-carousel.spread .feature-card {
  scroll-snap-align: center;
}

.feature-card.stacked {
  position: absolute;
  top: 0;
}

.feature-card h4 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  min-height: 4.6rem; /* Fixed height for 2 lines - aligns body text */
}

.feature-card p {
  font-size: 1.4rem;
  margin: 1.25rem 0 0;
  opacity: 0.9;
  line-height: 1.4;
}

.feature-card .card-footer-text {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Card Colors */
.card-dark-slate { background-color: var(--dark-slate); }
.card-orange { background-color: var(--orange); }
.card-teal { background-color: var(--teal); }
.card-coral-red { background-color: var(--coral-red); }
.card-yellow { background-color: var(--yellow); color: var(--dark-text); }
.card-lavender { background-color: var(--lavender); color: var(--dark-text); }
.card-light-lavender { background-color: var(--light-lavender); color: var(--dark-text); }
.card-pokydo-blue { background-color: var(--pokydo-blue); color: var(--dark-text); }
.card-pink-salmon { background-color: var(--pink-salmon); color: var(--dark-text); }
.card-purple { background-color: var(--purple); }
.card-amber { background-color: var(--amber); color: var(--dark-text); }
.card-green { background-color: var(--green); }
.card-mint { background-color: #C5EBC3; color: var(--dark-text); }

/* Carousel Navigation - Yellow pill with circular buttons */
.carousel-nav {
  background-color: var(--yellow);
  border-radius: 50px;
  padding: 6px 8px;
  display: inline-flex;
  gap: 8px;
  margin-top: 0.75rem; /* Closer to cards */
}

.carousel-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--pokydo-blue);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.carousel-nav-btn:hover:not(:disabled) {
  transform: scale(1.1);
  background-color: #7ab8d4;
}

.carousel-nav-btn:disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.carousel-nav-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--dark-text);
}

/* Or Connector */
.connector {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3rem 0 7rem; /* More breathing room around "or", extra space before AI Drives */
}

.or-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--yellow);
  color: var(--dark-text);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================
   Meet Poky Section (Cream BG)
   ===================== */
.meet-poky-section {
  background-color: transparent; /* Body background shows through */
  padding: 12rem 2rem 6rem; /* More top padding */
  overflow: visible;
}

/* Typewriter effect styles */
.meet-poky-section .section-subhead {
  min-height: 2rem; /* Prevent layout shift */
  margin-bottom: 5rem; /* Spacing before cards */
}

.typewriter-text {
  display: inline;
}

.typewriter-cursor {
  display: inline;
  margin-left: 2px;
}

.typing-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-left: 8px; /* Spacing between Strategist and logo */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.typing-icon.visible {
  opacity: 1;
  animation: typing-pulse 1.2s ease-in-out infinite;
}

.typing-icon.static {
  opacity: 1;
  animation: none;
}

@keyframes typing-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Poky Feature Cards */
.poky-feature-card {
  width: 400px;
  min-height: 333px;
}

/* =====================
   CTA Section (Blue BG)
   ===================== */
.cta-section {
  background-color: transparent; /* Body background shows through */
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 16rem; /* More bottom padding before footer */
}

.cta-section .section-headline {
  margin-bottom: 2rem;
}

.btn-cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: var(--yellow);
  color: var(--dark-text);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  color: var(--dark-text);
}

/* =====================
   Animations
   ===================== */
.card-jiggle {
  animation: jiggle 0.2s ease-in-out;
}

@keyframes jiggle {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-2deg) translateY(-5px); }
  75% { transform: rotate(2deg) translateY(-5px); }
}

/* Initial state for scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* =====================
   Responsive Styles
   ===================== */
@media (max-width: 991px) {
  .feature-card {
    width: 300px;
    min-height: 253px;
  }

  .poky-feature-card {
    width: 320px;
    min-height: 267px;
  }

  .feature-card h4 {
    font-size: 1.5rem;
  }

  .card-carousel {
    min-height: 280px;
  }
}

@media (max-width: 767px) {
  .pill-badge {
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
  }

  /* Fix navbar mobile menu background for homepage - both miniNav and fancyNav */
  body.homepage #fancyNav,
  body.homepage #fancyNav.navbar,
  body.homepage #miniNav,
  body.homepage #miniNav.navbar,
  body.homepage .navbar {
    background-color: var(--cream) !important;
    background: var(--cream) !important;
    z-index: 1050 !important;
  }

  body.homepage #fancyNav .navbar-collapse,
  body.homepage #fancyNav #navbarNavDropdown,
  body.homepage #miniNav .navbar-collapse,
  body.homepage #miniNav #navbarText,
  body.homepage .navbar-collapse {
    background-color: var(--cream) !important;
    background: var(--cream) !important;
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
  }

  body.homepage #fancyNav #pillNav2,
  body.homepage #miniNav .navbar-nav {
    flex-direction: column;
    width: 100%;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none;
    gap: 0.25rem;
  }

  body.homepage #fancyNav #pillNav2 .nav-link,
  body.homepage #miniNav .nav-link {
    text-align: center;
    padding: 0.75rem 1rem;
    color: var(--dark-text) !important;
  }

  .homepage-nav-pills {
    flex-direction: column;
    width: 100%;
    background-color: transparent;
    box-shadow: none;
    gap: 0.25rem;
  }

  .homepage-nav-pills .nav-link {
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .btn-homepage-auth {
    display: block !important;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
  }

  /* Hero section - keep minimum height on mobile */
  .hero-section {
    padding-top: 80px;
    min-height: 100vh;
    padding-bottom: 3rem;
  }

  /* Hero content positioning on mobile - closer to phone */
  .hero-content {
    position: fixed;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    padding: 1rem;
  }

  /* Smaller hero headline on mobile - fit "drowning in" on one line */
  .hero-headline {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    text-align: center;
  }

  /* Reduce spacing below subhead/button on mobile */
  .hero-subhead {
    margin-bottom: 1rem;
  }

  /* Show more of the phone on mobile */
  .phone-mockup-container {
    max-width: 300px;
    transform: translateY(35vh); /* Bring phone up more to fill space */
  }

  .phone-mockup {
    border-radius: 24px;
  }

  .phone-screen {
    border-radius: 18px;
  }

  .homepage-section {
    padding: 4rem 1rem;
    min-height: auto;
  }

  /* More top padding on mobile to push content well below hero */
  .drive-section {
    padding: 20rem 1rem 4rem;
    margin-top: 0;
  }

  .meet-poky-section {
    padding: 16rem 1rem 4rem; /* Much more top padding on mobile */
  }

  /* Smaller footer text on mobile */
  body.homepage footer {
    font-size: 0.65rem;
  }

  body.homepage footer .container {
    padding: 0 0.5rem;
  }

  body.homepage footer span[style*="margin: 0 1rem"] {
    margin: 0 0.5rem !important;
  }

  .feature-card {
    width: 260px;
    min-height: 220px;
    padding: 1.5rem;
    border-radius: 24px;
  }

  .feature-card h4 {
    font-size: 1.25rem;
    min-height: 3.3rem; /* Fixed height for 2 lines on mobile */
  }

  .feature-card p {
    font-size: 1rem;
    margin-top: 0.75rem;
  }

  .poky-feature-card {
    width: 280px;
    min-height: 233px;
  }

  .or-circle {
    width: 55px;
    height: 55px;
    font-size: 1rem;
  }

  .card-carousel {
    min-height: 250px;
    padding: 1rem 1rem 1rem 1.5rem; /* Less padding on mobile */
  }

  .inline-logo {
    width: 40px;
    height: 40px;
  }

  .cta-section {
    min-height: auto;
    padding: 4rem 1.5rem;
  }
}

/* =====================
   Background Transition Overlay
   ===================== */
.bg-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  transition: background-color 0.3s ease;
}

/* =====================
   Utility Classes
   ===================== */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
