/* ===================================
   Onboarding Module - Stitch Premium Design
   Full-screen immersive welcome flow
   =================================== */

/* ===== Main Container ===== */
#onboarding-view {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 9999);
  background-color: var(--bg-dark-primary, #11201C);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#onboarding-view.hidden {
  display: none;
}

/* ===== Slides Container ===== */
.onboarding-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.onboarding-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.onboarding-slide.active {
  opacity: 1;
  visibility: visible;
}

/* ===== SLIDE 1: Welcome Screen ===== */
#onboarding-welcome {
  height: 100vh;
  height: 100dvh;
}

.onboarding-welcome-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.onboarding-welcome-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(17, 32, 28, 0.6) 0%,
    rgba(17, 32, 28, 0.2) 50%,
    rgba(17, 32, 28, 0.5) 100%
  );
}

.onboarding-welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-6, 1.5rem);
  text-align: center;
}

.onboarding-welcome-spacer {
  flex: 1;
}

.onboarding-welcome-title {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.75rem, 8vw, 2rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: normal;
  line-height: 1.2;
  margin: 0;
}

.onboarding-welcome-subtitle {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-top: var(--space-2, 0.5rem);
}

.onboarding-welcome-cta {
  width: 100%;
  max-width: 24rem;
  padding: var(--space-8, 2rem) 0;
}

/* ===== SLIDE 2: Mood Selection ===== */
#onboarding-mood {
  background-color: var(--bg-dark-primary, #11201C);
}

.onboarding-mood-header {
  display: flex;
  align-items: center;
  padding: var(--space-4, 1rem);
  padding-bottom: var(--space-2, 0.5rem);
}

.onboarding-mood-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.onboarding-mood-back:hover {
  opacity: 0.7;
}

.onboarding-mood-back .material-symbols-outlined {
  font-size: 24px;
}

.onboarding-mood-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.015em;
  padding-right: 48px; /* Balance the back button */
}

/* Page Indicators */
.onboarding-indicators {
  display: flex;
  justify-content: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-5, 1.25rem) 0;
}

.onboarding-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  transition: background-color 0.3s ease;
}

.onboarding-indicator.active {
  background-color: var(--brand-green, #11d473);
}

/* Mood Selection Prompt */
.onboarding-mood-prompt {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: var(--space-1, 0.25rem) var(--space-4, 1rem) var(--space-3, 0.75rem);
  line-height: 1.5;
}

/* Mood Grid */
.onboarding-mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3, 0.75rem);
  padding: var(--space-4, 1rem);
  padding-bottom: 120px; /* Space for sticky button */
}

.onboarding-mood-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.onboarding-mood-card:active {
  transform: scale(0.98);
}

.onboarding-mood-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

.onboarding-mood-card:hover .onboarding-mood-card-bg {
  transform: scale(1.05);
}

.onboarding-mood-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    transparent 100%
  );
  transition: background-color 0.3s ease;
}

.onboarding-mood-card.selected .onboarding-mood-card-overlay {
  background: linear-gradient(
    to top,
    rgba(17, 212, 115, 0.4) 0%,
    rgba(17, 212, 115, 0.15) 50%,
    rgba(17, 212, 115, 0.05) 100%
  );
}

.onboarding-mood-card-label {
  position: absolute;
  bottom: var(--space-4, 1rem);
  left: var(--space-4, 1rem);
  right: var(--space-4, 1rem);
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

/* Selection check indicator */
.onboarding-mood-card-check {
  position: absolute;
  top: var(--space-3, 0.75rem);
  right: var(--space-3, 0.75rem);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--brand-green, #11d473);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.onboarding-mood-card.selected .onboarding-mood-card-check {
  opacity: 1;
  transform: scale(1);
}

.onboarding-mood-card-check .material-symbols-outlined {
  font-size: 16px;
  color: var(--bg-dark-primary, #11201C);
}

/* Sticky Continue Button */
.onboarding-mood-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4, 1rem);
  padding-bottom: var(--space-6, 1.5rem);
  background: linear-gradient(
    to top,
    rgba(17, 32, 28, 0.95) 0%,
    rgba(17, 32, 28, 0.8) 70%,
    transparent 100%
  );
  z-index: 10;
}

/* ===== SLIDE 3: Confirmation Screen ===== */
#onboarding-confirm {
  height: 100vh;
  height: 100dvh;
}

.onboarding-confirm-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.onboarding-confirm-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(28, 53, 45, 0.6) 0%,
    rgba(28, 53, 45, 0.1) 50%,
    rgba(28, 53, 45, 0) 100%
  );
}

.onboarding-confirm-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-6, 1.5rem);
  text-align: center;
}

.onboarding-confirm-spacer {
  flex: 1;
}

.onboarding-confirm-title {
  font-family: var(--font-display, 'Noto Serif', serif);
  font-size: clamp(2rem, 10vw, 2.5rem);
  font-weight: 700;
  color: rgba(244, 244, 241, 1);
  letter-spacing: tight;
  line-height: 1.2;
  margin: 0;
}

.onboarding-confirm-subtitle {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 400;
  color: rgba(244, 244, 241, 1);
  line-height: 1.5;
  margin-top: var(--space-2, 0.5rem);
}

.onboarding-confirm-cta {
  width: 100%;
  max-width: 28rem;
  padding: var(--space-4, 1rem) 0;
}

/* ===== Buttons ===== */
.onboarding-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 var(--space-5, 1.25rem);
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.015em;
  border-radius: var(--radius-lg, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: rgba(255, 255, 255, 0.6);
}

.onboarding-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.onboarding-btn-outline:active {
  background: rgba(255, 255, 255, 0.2);
}

.onboarding-btn-primary {
  background-color: var(--brand-green, #11d473);
  border: none;
  color: var(--bg-dark-primary, #11201C);
  font-weight: 700;
  border-radius: var(--radius-xl, 12px);
}

.onboarding-btn-primary:hover {
  background-color: var(--brand-green-light, #2ee088);
}

.onboarding-btn-primary:active {
  transform: scale(0.98);
}

.onboarding-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-slide.active .onboarding-welcome-title,
.onboarding-slide.active .onboarding-welcome-subtitle,
.onboarding-slide.active .onboarding-welcome-cta,
.onboarding-slide.active .onboarding-confirm-title,
.onboarding-slide.active .onboarding-confirm-subtitle,
.onboarding-slide.active .onboarding-confirm-cta {
  animation: fadeInUp 0.6s ease-out forwards;
}

.onboarding-slide.active .onboarding-welcome-subtitle,
.onboarding-slide.active .onboarding-confirm-subtitle {
  animation-delay: 0.1s;
}

.onboarding-slide.active .onboarding-welcome-cta,
.onboarding-slide.active .onboarding-confirm-cta {
  animation-delay: 0.2s;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .onboarding-mood-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
    margin: 0 auto;
  }
}
