/* ==========================================================================
   Gift Finder Quiz - Modern Festive Stylesheet
   Designed for High Performance, Mobile-First UX, and Zero Layout Shifts
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Color Palette */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #10b981;

  --color-primary: #0f172a;
  --color-secondary: #334155;
  --color-muted: #64748b;
  --color-light: #94a3b8;

  /* Festive Accent Tones */
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;

  --crimson-600: #e11d48;
  --crimson-50: #fff1f2;

  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-50: #fffbeb;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 28px -4px rgba(5, 150, 105, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--color-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1024px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-primary);
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  border-radius: var(--radius-md);
  color: var(--emerald-600);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.header-badges {
  display: flex;
  align-items: center;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--crimson-50);
  color: var(--crimson-600);
  border: 1px solid rgba(225, 29, 72, 0.15);
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   Ad Slots (AdSense Integration Containers)
   - Layout-safe: 0 height when empty, centers ads when filled
   -------------------------------------------------------------------------- */
.ad-slot {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  text-align: center;
  min-height: 0;
  overflow: hidden;
  transition: min-height var(--transition-normal);
}

.ad-slot-top {
  padding: 0;
}

.ad-slot-middle {
  margin: 32px auto;
  padding: 0;
}

.ad-slot-bottom {
  margin: 24px auto;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* --------------------------------------------------------------------------
   Quiz Section & Hero
   -------------------------------------------------------------------------- */
.hero-intro {
  text-align: center;
  margin-bottom: 28px;
  animation: fadeIn 350ms ease-out;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Progress Bar */
.quiz-progress-bar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.quiz-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-quiz-back:hover {
  background: var(--bg-surface-alt);
  color: var(--color-primary);
}

.step-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emerald-700);
  background: var(--emerald-50);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-600), #10b981);
  border-radius: var(--radius-full);
  transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Quiz Question Cards & Options
   -------------------------------------------------------------------------- */
.quiz-cards-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.quiz-step {
  display: none;
}

.quiz-step.active {
  display: block;
  animation: slideFadeIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.question-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.question-subtitle {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 24px;
}

/* Options Grids */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.option-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  min-height: 60px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.option-btn:hover {
  border-color: var(--emerald-600);
  background: #fafcfb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-btn.selected {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  box-shadow: 0 0 0 2px var(--emerald-600);
}

.option-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

.option-btn.selected .option-label {
  color: var(--emerald-700);
}

.option-sub {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.check-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.option-btn.selected .check-indicator {
  background: var(--emerald-600);
  border-color: var(--emerald-600);
  color: #ffffff;
}

.check-indicator svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

/* Multi-select Interests Grid */
.selection-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.counter-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emerald-700);
  background: var(--emerald-100);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.counter-hint {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.interests-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .interests-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.option-btn.multi-select {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
}

.option-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.option-icon svg {
  width: 20px;
  height: 20px;
}

.option-btn.selected .option-icon {
  color: var(--emerald-600);
}

.option-btn.multi-select .option-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.step-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Buttons System
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 48px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--emerald-600);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--color-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-alt);
  border-color: var(--color-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: #ffffff;
  color: var(--color-primary);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Results Screen
   -------------------------------------------------------------------------- */
.results-section {
  animation: fadeIn 350ms ease-out;
}

.results-header {
  text-align: center;
  margin-bottom: 28px;
}

.results-pretitle {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-700);
  margin-bottom: 6px;
}

.results-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
}

.criteria-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.criteria-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--color-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.criteria-chip-btn {
  cursor: pointer;
  background: var(--emerald-50);
  color: var(--emerald-700);
  border-color: var(--emerald-100);
  transition: all var(--transition-fast);
}

.criteria-chip-btn:hover {
  background: var(--emerald-100);
}

/* Affiliate Top Disclosure */
.affiliate-top-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-muted);
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.disclosure-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: var(--color-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.results-action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Product Cards Grid
   -------------------------------------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(5, 150, 105, 0.4);
}

.product-card-top-content {
  display: flex;
  flex-direction: column;
}

.product-image-container {
  width: 100%;
  height: 210px;
  background: #ffffff;
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.image-fallback-badge {
  display: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--emerald-50);
  color: var(--emerald-600);
  align-items: center;
  justify-content: center;
}

.image-fallback-badge svg {
  width: 28px;
  height: 28px;
}

.product-image-container.image-fallback .image-fallback-badge {
  display: flex;
}

.budget-badge-floating {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-100);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.category-badge svg {
  width: 14px;
  height: 14px;
}

.vibe-tag-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--amber-50);
  color: var(--amber-600);
  border: 1px solid rgba(217, 119, 6, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.product-body {
  padding: 10px 18px 16px;
  flex: 1;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.product-actions {
  padding: 0 18px 18px;
  margin-top: auto;
}

.btn-amazon {
  width: 100%;
  background: #ff9900;
  color: #111111;
  font-weight: 700;
  border-color: #e68a00;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-amazon:hover {
  background: #f08804;
  border-color: #d17800;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(240, 136, 4, 0.25);
}

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

/* Bottom Results Actions */
.bottom-results-nav {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  padding: 40px 20px 32px;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand .brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.footer-compliance {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: left;
}

.compliance-statement {
  font-size: 0.8rem;
  color: var(--color-secondary);
  line-height: 1.5;
}

.compliance-statement strong {
  color: var(--color-primary);
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-link-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

.footer-link-btn:hover {
  color: var(--emerald-600);
  text-decoration: underline;
}

.footer-sep {
  color: var(--border-color);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-light);
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 200ms ease-out;
}

.modal-box {
  background: var(--bg-card);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-surface-alt);
  color: var(--color-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.95rem;
  color: var(--color-secondary);
  line-height: 1.6;
}

.modal-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 18px 0 6px;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-body a {
  color: var(--emerald-600);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: #fafcfb;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-primary);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  display: flex;
  align-items: center;
  color: var(--emerald-600);
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   AI Gift Genie Section & Hybrid Experience
   -------------------------------------------------------------------------- */
.btn-ai-genie {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-ai-genie:hover {
  background: #4338ca;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.ai-genie-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
  border: 2px solid #e0e7ff;
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  margin: 40px auto;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.08);
  position: relative;
  overflow: hidden;
}

.ai-genie-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.genie-sparkle-icon {
  display: inline-flex;
  align-items: center;
}

.genie-sparkle-icon svg {
  width: 14px;
  height: 14px;
}

.ai-genie-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.ai-genie-subtitle {
  font-size: 0.95rem;
  color: var(--color-muted);
  max-width: 680px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.ai-genie-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-genie-prompt-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-genie-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.ai-genie-textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-primary);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-genie-textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn-generate-ai {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  font-size: 1rem;
  padding: 14px 28px;
  align-self: flex-start;
}

.btn-generate-ai:hover {
  background: #4338ca;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-generate-ai.loading {
  opacity: 0.75;
  pointer-events: none;
}

/* AI Results Grid */
.ai-genie-results {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed #c7d2fe;
  animation: fadeIn 350ms ease-out;
}

.ai-genie-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-results-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.ai-live-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.ai-ideas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .ai-ideas-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ai-idea-card {
  background: #ffffff;
  border: 1.5px solid #e0e7ff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.ai-idea-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -3px rgba(79, 70, 229, 0.12);
  border-color: #a5b4fc;
}

.ai-idea-number {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #4f46e5;
  margin-bottom: 8px;
}

.ai-idea-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.ai-idea-reason {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.45;
  margin-bottom: 18px;
  flex: 1;
}

.ai-idea-tier {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-600);
  background: var(--amber-50);
  border: 1px solid rgba(217, 119, 6, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Mobile Polish
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .question-title {
    font-size: 1.35rem;
  }
  .quiz-cards-wrapper {
    padding: 22px 18px;
  }
  .options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .interests-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .results-action-bar {
    flex-direction: column;
  }
  .results-action-bar .btn {
    width: 100%;
  }
  .bottom-results-nav .btn {
    width: 100%;
  }
  .btn-generate-ai {
    width: 100%;
  }
}

