/*
 * Full Moon Party Trip Planner - Mobile-First CSS
 * ================================================
 * CHANGES:
 * - Premium mobile-first typography and spacing
 * - Horizontal scrolling chips with fade edges
 * - 44px+ tap targets on all interactive elements
 * - 16px font on inputs to prevent iOS zoom
 * - Sticky CTA with safe-area-inset handling
 * - Step progress indicator
 * - Show more/less toggle styling
 * - Smooth animations and micro-interactions
 * 
 * TEST ON MOBILE:
 * - Chips scroll horizontally
 * - No iOS zoom on input focus
 * - Sticky CTA doesn't overlap phone UI
 * - All tap targets feel comfortable
 * 
 * CONVERSION CONTROLS:
 * - .stickyCta - primary conversion CTA
 * - .offer .btn - affiliate click buttons
 * - .showMore - expand/collapse for engagement
 */

/* ===== Variables ===== */
:root {
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-primary: #0f172a;
  --c-secondary: #475569;
  --c-muted: #64748b;
  --c-light: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-accent: #0ea5e9;
  --c-accent-dark: #0284c7;
  --c-sun: #f97316;
  --c-sun-dark: #ea580c;
  --c-sun-light: #fff7ed;
  --c-success: #22c55e;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

/* ===== Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* ===== Loading State ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loadingSpinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loadingText {
  margin-top: 16px;
  color: var(--c-muted);
  font-size: 14px;
}

/* ===== Error State ===== */
.errorState {
  padding: 40px 20px;
  text-align: center;
}

.errorState h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.errorState p {
  color: var(--c-muted);
  font-size: 14px;
  margin: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* ===== Hero ===== */
.card.hero {
  text-align: center;
  padding: 28px 20px;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.card.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  position: relative;
}

.intro {
  font-size: 14px;
  margin: 0;
  opacity: 0.92;
  line-height: 1.5;
  position: relative;
}

/* ===== Progress Indicator ===== */
.progressWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.progressDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-border);
  transition: all var(--transition);
}

.progressDot.active {
  background: var(--c-accent);
  transform: scale(1.2);
}

.progressDot.done {
  background: var(--c-success);
}

.progressText {
  font-size: 12px;
  color: var(--c-muted);
  margin-left: 8px;
}

/* ===== Steps ===== */
.step {
  animation: fadeSlideIn 0.3s ease;
}

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

.step.hidden {
  display: none;
}

.stepLabel {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  color: var(--c-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.optional {
  font-weight: 400;
  color: var(--c-light);
  font-size: 14px;
}

.small {
  font-size: 12px;
  color: var(--c-muted);
}

/* ===== Dynamic Microcopy ===== */
.microcopy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--c-secondary);
  line-height: 1.45;
  animation: fadeSlideIn 0.25s ease;
}

.microcopy.hidden {
  display: none;
}

.microcopyIcon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== Select ===== */
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 44px 12px 16px;
  font-size: 16px; /* Prevents iOS zoom */
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 22px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ===== Chips - Horizontal Scroll ===== */
.chipsScroll {
  position: relative;
  margin: 0 -20px;
  padding: 0;
}

/* Fade edges */
.chipsScroll::before,
.chipsScroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity var(--transition);
}

.chipsScroll::before {
  left: 0;
  background: linear-gradient(to right, var(--c-surface), transparent);
}

.chipsScroll::after {
  right: 0;
  background: linear-gradient(to left, var(--c-surface), transparent);
}

.chipsScroll.canScrollLeft::before,
.chipsScroll.canScrollRight::after {
  opacity: 1;
}

.chipsInner {
  display: flex;
  gap: 10px;
  padding: 4px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}

.chipsInner::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  min-height: 46px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  scroll-snap-align: start;
}

.chip:hover {
  border-color: var(--c-accent);
  background: rgba(14, 165, 233, 0.04);
}

.chip:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.chip:active {
  transform: scale(0.97);
}

.chip.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.chip.active:hover {
  background: #1e293b;
}

/* ===== Stay Recommendation ===== */
.stayRec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--c-sun-light);
  border-radius: var(--radius-sm);
  border: 1px solid #fed7aa;
  animation: fadeSlideIn 0.25s ease;
}

.stayRec.hidden {
  display: none;
}

.stayRecInner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stayRecIcon {
  font-size: 22px;
}

.stayRecText {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stayRecLabel {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-primary);
}

.linkBtn {
  background: none;
  border: none;
  color: var(--c-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.linkBtn:hover {
  background: rgba(14, 165, 233, 0.1);
}

.linkBtn:focus {
  outline: none;
  background: rgba(14, 165, 233, 0.15);
}

.areaOverrideWrap {
  margin-top: 12px;
  animation: fadeSlideIn 0.25s ease;
}

.areaOverrideWrap.hidden {
  display: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--c-sun) 0%, var(--c-sun-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn.primary:active {
  transform: translateY(0) scale(0.98);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.secondary {
  background: var(--c-surface);
  color: var(--c-secondary);
  border: 2px solid var(--c-border);
  min-height: 46px;
}

.btn.secondary:hover {
  border-color: var(--c-muted);
  background: var(--c-bg);
}

.btn.full {
  width: 100%;
}

.btn.sm {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 14px;
}

/* ===== Sticky CTA ===== */
.stickyCta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-border);
  z-index: 100;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stickyCta.hidden {
  display: none;
}

.stickyInner {
  max-width: 480px;
  margin: 0 auto;
}

/* ===== Results ===== */
#results {
  animation: fadeSlideIn 0.4s ease;
}

#results.hidden {
  display: none;
}

.resultsSection {
  margin-bottom: 24px;
}

.sectionHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sectionIcon {
  font-size: 20px;
}

.sectionTitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary);
}

.sectionSubtitle {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 14px;
}

/* ===== Summary Card ===== */
.summaryCard {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: none;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.summaryCard::after {
  content: "✓";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: var(--c-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  animation: popIn 0.4s ease 0.2s both;
}

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

.summaryTitle {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--c-primary);
}

.summaryGrid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.summaryRow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 6px 0;
}

.summaryRow .icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.summaryRow span {
  color: var(--c-secondary);
  min-width: 90px;
}

.summaryRow b {
  color: var(--c-primary);
  font-weight: 600;
}

/* ===== Offer Grid ===== */
.grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Offer Card ===== */
.offer {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.offer:hover {
  box-shadow: var(--shadow);
}

.offer h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--c-primary);
  line-height: 1.4;
}

.offer p {
  font-size: 13px;
  color: var(--c-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.kpi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pill {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  white-space: nowrap;
}

.offer .btn {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

/* ===== Show More Toggle ===== */
.showMore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-accent);
  background: transparent;
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.showMore:hover {
  border-color: var(--c-accent);
  background: rgba(14, 165, 233, 0.04);
}

.showMore:focus {
  outline: none;
  border-color: var(--c-accent);
}

.showMore .arrow {
  transition: transform var(--transition);
}

.showMore.expanded .arrow {
  transform: rotate(180deg);
}

.collapsedItems {
  display: none;
}

.collapsedItems.expanded {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  animation: fadeSlideIn 0.25s ease;
}

/* ===== Hidden utility ===== */
.hidden {
  display: none !important;
}

/* ===== Desktop tweaks ===== */
@media (min-width: 540px) {
  .wrap {
    padding: 20px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .card {
    padding: 24px;
  }

  .h1 {
    font-size: 26px;
  }

  .chipsScroll {
    margin: 0 -24px;
  }

  .chipsInner {
    padding: 4px 24px;
  }

  .stickyCta {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

