/**
 * Onboarding V2 - Part 1: Question & Pills
 * Conversational question-first approach for user type selection
 */

/* ==========================================================================
   Question Wrapper
   ========================================================================== */

.onboarding-question-wrapper {
  width: 100%;
}

.onboarding-question {
  font-family: "Satoshi", sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #141414;
  margin-bottom: 20px;
  margin-top: 0;
}

@media (max-width: 768px) {
  .onboarding-question {
    font-size: 18px;
    margin-bottom: 16px;
  }
}

/* ==========================================================================
   Pills Container
   ========================================================================== */

.pills-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .pills-container {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .pills-container {
    flex-direction: column;
  }
}

/* ==========================================================================
   Individual Pill Button
   ========================================================================== */

.onboarding-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 20px;
  background: #FFFFFF;
  border: 2px solid #E0E0E0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
  flex: 1;
  text-align: left;
  font-family: "Satoshi", sans-serif;
}

.onboarding-pill:hover {
  border-color: #0F2C1D;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.onboarding-pill:active {
  transform: translateY(0);
  background: rgba(28, 217, 135, 0.1);
}

.onboarding-pill:focus {
  outline: none;
  border-color: #1CD987;
  box-shadow: 0 0 0 3px rgba(28, 217, 135, 0.2);
}

.onboarding-pill:focus-visible {
  outline: 2px solid #1CD987;
  outline-offset: 2px;
}

.onboarding-pill.selected {
  border-color: #1CD987;
  background: rgba(28, 217, 135, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* "Other" pill - smaller, no helper text */
.onboarding-pill.pill-other {
  min-width: auto;
  flex: 0;
  padding: 16px 24px;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .onboarding-pill {
    padding: 14px 16px;
    min-width: 140px;
    border-radius: 14px;
  }

  .onboarding-pill.pill-other {
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  .onboarding-pill {
    width: 100%;
    min-width: unset;
    flex: unset;
  }

  .onboarding-pill.pill-other {
    flex: unset;
    width: 100%;
  }
}

/* ==========================================================================
   Pill Content
   ========================================================================== */

.pill-main-text {
  font-family: "Satoshi", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #141414;
  margin-bottom: 4px;
  line-height: 1.3;
}

.pill-helper-text {
  font-family: "Satoshi", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #929292;
  line-height: 1.3;
}

/* Remove bottom margin when there's no helper text */
.onboarding-pill.pill-other .pill-main-text {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .pill-main-text {
    font-size: 15px;
  }

  .pill-helper-text {
    font-size: 12px;
  }
}

/* ==========================================================================
   Animation for transition (Part 2 prep)
   ========================================================================== */

.onboarding-question-wrapper {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.onboarding-question-wrapper.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.onboarding-question-wrapper.hidden {
  display: none;
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .onboarding-pill {
    transition: none;
  }

  .onboarding-pill:hover {
    transform: none;
  }

  .onboarding-pill:active {
    transform: none;
  }

  .onboarding-question-wrapper {
    transition: none;
  }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
  .onboarding-pill {
    border-width: 3px;
  }

  .onboarding-pill:focus {
    outline-width: 3px;
  }

  .pill-helper-text {
    color: #666666;
  }
}

/* ==========================================================================
   Part 2: Hero Section Transition Animations
   Slower, smoother transitions for pixel-perfect experience
   ========================================================================== */

/* Headline fade up and out */
.hero-transitioning .mobile-title h1 {
  animation: fadeUpOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Pills container fade out */
.hero-transitioning .pills-container {
  animation: fadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Legal text fade out */
.hero-transitioning .legal-text {
  animation: fadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Trust indicators fade out */
.hero-transitioning .trust-indicators {
  animation: fadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Input card fade out */
.hero-transitioning .input-card {
  animation: inputCardFadeOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Bubble disperse animation - staggered with CSS animation-delay */
.hero-transitioning [id^="bubbles"] {
  animation: disperseBubble 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger bubble animations */
.hero-transitioning #bubbles {
  animation-delay: 0s;
}
.hero-transitioning #bubbles1 {
  animation-delay: 0.05s;
}
.hero-transitioning #bubbles2 {
  animation-delay: 0.1s;
}
.hero-transitioning #bubbles3 {
  animation-delay: 0.15s;
}
.hero-transitioning #bubbles4 {
  animation-delay: 0.2s;
}

@keyframes fadeUpOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes inputCardFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes disperseBubble {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(var(--disperse-x, 100px), var(--disperse-y, -100px)) scale(0.3);
    filter: blur(8px);
  }
}

/* ==========================================================================
   Part 2: Phone Mockup Container
   ========================================================================== */

.phone-mockup-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  display: none;
  pointer-events: none;
  align-items: center;
  gap: 24px;
}

.phone-mockup-container.visible {
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

/* ==========================================================================
   Part 2: Close Button (X)
   ========================================================================== */

.phone-close-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.phone-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.phone-close-btn:active {
  transform: scale(0.95);
}

.phone-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Initial state - hidden */
.phone-close-btn {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

/* Visible state */
.phone-mockup-container.visible .phone-close-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity 0.4s ease 0.6s, transform 0.4s ease 0.6s;
}

/* ==========================================================================
   Part 2: Phone Mockup Frame
   ========================================================================== */

.phone-mockup {
  position: relative;
  width: 280px;
  height: 606px;
  background: #000000;
  border-radius: 38px;
  padding: 4px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(0, 0, 0, 0.3);

  /* Center horizontally */
  margin: 0 auto;
  transform-origin: center center;

  /* Initial state (hidden) - starts smaller and lower */
  opacity: 0;
  transform: scale(0.85) translateY(60px);

  /* Slower, smoother transition */
  transition:
    opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-mockup.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   Part 2: Phone Screen (Inner Area)
   ========================================================================== */

.phone-screen {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 35px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Part 2: Phone Status Bar
   ========================================================================== */

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 10px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #000;
  background: #FFFFFF;
}

.status-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icon {
  color: #000;
}

/* ==========================================================================
   Part 2: Phone Content Area
   ========================================================================== */

.phone-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

/* ==========================================================================
   Part 2: Phone Bottom Bar
   ========================================================================== */

.phone-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px 8px 32px;
  background: #FFFFFF;
}

.bottom-icon {
  width: 24px;
  height: 24px;
  color: #1C1B19;
  opacity: 0.6;
}

/* ==========================================================================
   Part 2: Phone Home Indicator
   ========================================================================== */

.phone-home-indicator {
  width: 134px;
  height: 5px;
  background: #1C1B19;
  border-radius: 3px;
  margin: 8px auto 8px auto;
  opacity: 0.2;
}

/* ==========================================================================
   Part 2: Hero Section Modifications
   ========================================================================== */

/* When phone is active - maintain hero height */
#heroSection.phone-active {
  min-height: var(--hero-initial-height, 100vh);
}

/* Lock hero height during transition to prevent jumping */
#heroSection.hero-transitioning {
  min-height: var(--hero-initial-height, 100vh);
}

/* Keep height locked while closing */
#heroSection.hero-closing {
  min-height: var(--hero-initial-height, 100vh);
}

/* Hide scrollbar on body during transition */
body.phone-transition-active {
  overflow: hidden;
}

/* ==========================================================================
   Part 2: Responsive Phone Mockup
   ========================================================================== */

/* Large desktop - slightly bigger phone */
@media (min-width: 1440px) {
  .phone-mockup {
    width: 300px;
    height: 649px;
    border-radius: 40px;
  }

  .phone-screen {
    border-radius: 37px;
  }
}

@media (max-width: 768px) {
  .phone-mockup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 12px;
    padding: 0 8px;
  }

  .phone-close-btn {
    width: 36px;
    height: 36px;
  }

  .phone-close-btn svg {
    width: 16px;
    height: 16px;
  }

  .phone-mockup {
    width: calc(100vw - 100px);
    max-width: 320px;
    height: 85vh;
    max-height: 690px;
    border-radius: 38px;
    padding: 3px;
  }

  .phone-screen {
    border-radius: 36px;
  }

  .phone-status-bar {
    padding: 10px 20px 6px 20px;
    font-size: 13px;
  }

  .phone-content {
    padding: 16px 20px;
  }

  .phone-bottom-bar {
    padding: 12px 24px 4px 24px;
  }

  .bottom-icon {
    width: 22px;
    height: 22px;
  }

  .phone-home-indicator {
    width: 100px;
    height: 4px;
    margin: 6px auto;
  }
}

/* ==========================================================================
   Part 2: Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .phone-mockup {
    transition: opacity 0.2s ease-out;
    transform: scale(1) translateY(0);
  }

  .phone-mockup.visible {
    opacity: 1;
  }

  .hero-transitioning .mobile-title h1,
  .hero-transitioning .pills-container,
  .hero-transitioning .legal-text,
  .hero-transitioning .trust-indicators,
  .hero-transitioning .input-card,
  .hero-transitioning [id^="bubbles"] {
    animation: none;
    opacity: 0;
  }
}

/* ==========================================================================
   Part 2: Chat Message Styling (Preview for Part 3)
   ========================================================================== */

.chat-message {
  max-width: 85%;
  margin-bottom: 16px;
  animation: messageSlideIn 0.3s ease-out;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 17px;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Satoshi", sans-serif;
}

.chat-message.bot .chat-bubble {
  background: #F5F5F5;
  color: #141414;
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: #1CD987;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
