@font-face {
  font-family: 'Baloo 2';
  src: url("/fonts/Baloo2-VariableFont_wght.ttf") format('truetype');
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url("/fonts/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf") format('truetype');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url("/fonts/NunitoSans-Italic-VariableFont_YTLC,opsz,wdth,wght.ttf") format('truetype');
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Accessibility: Global focus-visible styles */
@layer base {
  a:focus-visible,
  button:focus-visible,
  [role="button"]:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    @apply outline-none ring-2 ring-amber-500 ring-offset-2;
  }
}

/* Cropper.js styles */
.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  touch-action: none;
  user-select: none;
}

.cropper-container img {
  display: block;
  height: 100%;
  image-orientation: 0deg;
  max-height: none !important;
  max-width: none !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100%;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

/* Solid background to prevent checkerboard transparency pattern */
.cropper-wrap-box {
  background-color: #1c1917 !important;
}

.cropper-canvas {
  background-color: #1c1917 !important;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  /* Darker overlay to clearly show excluded area */
  background-color: rgba(0, 0, 0, 0.7) !important;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 3px solid #f59e0b;
  outline-offset: -3px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
  border-bottom-width: 1px;
  border-top-width: 1px;
  height: calc(100% / 3);
  left: 0;
  top: calc(100% / 3);
  width: 100%;
}

.cropper-dashed.dashed-v {
  border-left-width: 1px;
  border-right-width: 1px;
  height: 100%;
  left: calc(100% / 3);
  top: 0;
  width: calc(100% / 3);
}

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
.cropper-center::after {
  background-color: #eee;
  content: ' ';
  display: block;
  position: absolute;
}

.cropper-center::before {
  height: 1px;
  left: -3px;
  top: 0;
  width: 7px;
}

.cropper-center::after {
  height: 7px;
  left: 0;
  top: -3px;
  width: 1px;
}

.cropper-face,
.cropper-line,
.cropper-point {
  display: block;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  width: 100%;
}

.cropper-face {
  background-color: #fff;
  left: 0;
  top: 0;
}

.cropper-line {
  background-color: rgba(255, 255, 255, 0.5);
}

.cropper-line.line-e {
  cursor: ew-resize;
  right: -3px;
  top: 0;
  width: 5px;
}

.cropper-line.line-n {
  cursor: ns-resize;
  height: 5px;
  left: 0;
  top: -3px;
}

.cropper-line.line-w {
  cursor: ew-resize;
  left: -3px;
  top: 0;
  width: 5px;
}

.cropper-line.line-s {
  bottom: -3px;
  cursor: ns-resize;
  height: 5px;
  left: 0;
}

.cropper-point {
  background-color: #f59e0b;
  height: 10px;
  opacity: 0.75;
  width: 10px;
}

.cropper-point.point-e {
  cursor: ew-resize;
  margin-top: -3px;
  right: -3px;
  top: 50%;
}

.cropper-point.point-n {
  cursor: ns-resize;
  left: 50%;
  margin-left: -3px;
  top: -3px;
}

.cropper-point.point-w {
  cursor: ew-resize;
  left: -3px;
  margin-top: -3px;
  top: 50%;
}

.cropper-point.point-s {
  bottom: -3px;
  cursor: s-resize;
  left: 50%;
  margin-left: -3px;
}

.cropper-point.point-ne {
  cursor: nesw-resize;
  right: -3px;
  top: -3px;
}

.cropper-point.point-nw {
  cursor: nwse-resize;
  left: -3px;
  top: -3px;
}

.cropper-point.point-sw {
  bottom: -3px;
  cursor: nesw-resize;
  left: -3px;
}

.cropper-point.point-se {
  bottom: -3px;
  cursor: nwse-resize;
  height: 20px;
  opacity: 1;
  right: -3px;
  width: 20px;
}

@media (min-width: 768px) {
  .cropper-point.point-se {
    height: 15px;
    width: 15px;
  }
}

.cropper-point.point-se::before {
  background-color: #f59e0b;
  bottom: -50%;
  content: ' ';
  display: block;
  height: 200%;
  opacity: 0;
  position: absolute;
  right: -50%;
  width: 200%;
}

.cropper-invisible {
  opacity: 0;
}

.cropper-bg {
  /* Solid dark background instead of checkerboard */
  background-color: #292524;
  background-image: none !important;
}

.cropper-hide {
  display: block;
  height: 0;
  position: absolute;
  width: 0;
}

.cropper-hidden {
  display: none !important;
}

.cropper-move {
  cursor: move;
}

.cropper-crop {
  cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
  cursor: not-allowed;
}

/* Circular avatar crop overlay */
.avatar-crop-circle .cropper-view-box,
.avatar-crop-circle .cropper-face {
  border-radius: 50%;
}

@layer components {
  /* Planning mode card selection */
  .planning-mode-card {
    @apply relative block;
  }

  .planning-mode-card-inner {
    @apply relative flex flex-row items-center gap-3 px-4 py-3 rounded-xl border-2 border-stone-200 bg-white transition-all;
  }

  .planning-mode-card:hover .planning-mode-card-inner {
    @apply border-stone-300 bg-stone-50;
  }

  .planning-mode-input:checked + .planning-mode-card-inner {
    @apply border-amber-500 bg-amber-50;
  }

  .planning-mode-check {
    @apply absolute -top-1.5 -left-1.5 w-5 h-5 rounded-full bg-amber-500 flex items-center justify-center opacity-0 transition-opacity;
  }

  .planning-mode-input:checked + .planning-mode-card-inner .planning-mode-check {
    @apply opacity-100;
  }

  .planning-mode-emoji {
    @apply text-xl flex-shrink-0;
  }

  .planning-mode-label {
    @apply text-sm text-stone-700;
  }

  /* Split-flap display animation */
  .split-flap-container {
    display: inline-block;
    vertical-align: baseline;
  }

  .split-flap-word {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 0.6em;
    gap: 0.08em;
    perspective: 1000px;
    /* Reserve space to prevent layout shift before JS renders */
    /* 10 chars × 0.6em + 9 gaps × 0.08em ≈ 6.7em width */
    min-width: 6.7em;
    min-height: 1.2em;
  }

  .split-flap-char {
    position: relative;
    display: block;
    width: 100%;
    height: 1.2em;
    transform-style: preserve-3d;
    font: inherit;
    text-transform: lowercase;
  }

  /* All four flaps share these base styles */
  .split-flap-char .top,
  .split-flap-char .bottom,
  .split-flap-char .top-next,
  .split-flap-char .bottom-next {
    border-radius: 4px;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
    background: linear-gradient(180deg, #1c1917 0%, #292524 100%);
    backface-visibility: hidden;
  }

  /* Top halves clipped */
  .split-flap-char .top,
  .split-flap-char .top-next {
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
  }

  /* Bottom halves clipped */
  .split-flap-char .bottom,
  .split-flap-char .bottom-next {
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
  }

  /* Divider line */
  .split-flap-char .divider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #44403c;
    z-index: 10;
    transform: translateY(-50%);
  }

  /* Split-flap sound toggle button */
  .split-flap-sound-toggle {
    @apply p-1 text-stone-300 hover:text-stone-500 transition-colors rounded;
    /* Subtle appearance, doesn't distract from the animation */
  }

  .split-flap-sound-toggle:hover {
    @apply bg-stone-100;
  }

  /* When unmuted, show a subtle indicator */
  .split-flap-sound-toggle[data-active="true"] {
    @apply text-amber-500;
  }

  /* Toast animations */
  .animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
  }

  .animate-fade-out {
    animation: fadeOut 0.2s ease-out forwards;
  }
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Suggestion map custom pins */
.suggestion-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
}

.suggestion-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #f59e0b; /* amber-500 */
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Private home: house emoji dot instead of plain amber circle */
.suggestion-pin--home {
  /* Shift down so the dot center (12px from top) sits on the coordinate.
     Default AdvancedMarkerElement anchor = bottom-center of content. */
  transform: translateY(calc(100% - 12px));
}

.suggestion-pin-home-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #fffbeb; /* amber-50 */
  border: 2px solid #f59e0b; /* amber-500 */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

/* Label chip — inline row with optional count pill */
.suggestion-pin-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  max-width: 150px;
  line-height: 1.3;
}

.suggestion-pin-chip--home {
  background: #fffbeb; /* amber-50 */
  border: 1px solid #fde68a; /* amber-200 */
}

.suggestion-pin-chip-text {
  font-size: 11px;
  font-weight: 600;
  color: #1c1917; /* stone-900 */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline interest count pill inside the label chip */
.suggestion-pin-chip-count {
  flex-shrink: 0;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: #f59e0b; /* amber-500 */
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Cluster bubble — groups nearby pins at zoomed-out levels */
.suggestion-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f59e0b; /* amber-500 */
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* === Wizard dark mode (when cover image is present) === */

/* Flip stone text to light on dark blurred background */
.wizard-dark .text-stone-400 { color: rgba(255, 255, 255, 0.45) !important; }
.wizard-dark .text-stone-500 { color: rgba(255, 255, 255, 0.6) !important; }
.wizard-dark .text-stone-600 { color: rgba(255, 255, 255, 0.7) !important; }
.wizard-dark .text-stone-700 { color: rgba(255, 255, 255, 0.8) !important; }
.wizard-dark .text-stone-900 { color: rgba(255, 255, 255, 0.95) !important; }

/* Instruction boxes: dark glass instead of light gray */
.wizard-dark .bg-stone-50 {
  background-color: rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(8px);
}

/* Borders: subtle white instead of stone */
.wizard-dark .border-stone-200 { border-color: rgba(255, 255, 255, 0.12) !important; }
.wizard-dark .border-stone-300 { border-color: rgba(255, 255, 255, 0.18) !important; }

/* Scroll hint gradient: dark instead of white */
.wizard-dark .bg-gradient-to-l.from-white { --tw-gradient-from: rgba(0, 0, 0, 0.3) !important; }
.wizard-dark .via-white\/90 { --tw-gradient-via: rgba(0, 0, 0, 0.2) !important; }

/* Range slider track */
.wizard-dark .bg-stone-200[type="range"] { background-color: rgba(255, 255, 255, 0.2) !important; }

/* Restore original colors inside white/light card containers and phone mockup */
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .text-stone-400 { color: #a8a29e !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .text-stone-500 { color: #78716c !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .text-stone-600 { color: #57534e !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .text-stone-700 { color: #44403c !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .text-stone-900 { color: #1c1917 !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .border-stone-200 { border-color: #e7e5e4 !important; }
.wizard-dark :is([class*="bg-white"], [class*="bg-amber-50"], .share-preview-phone) .border-stone-300 { border-color: #d6d3d1 !important; }
.wizard-dark .share-preview-phone .bg-stone-50 { background-color: #fafaf9 !important; backdrop-filter: none; }

/* Also restore text/border on elements that have both bg-white AND text-stone-* */
.wizard-dark [class*="bg-white"].text-stone-400 { color: #a8a29e !important; }
.wizard-dark [class*="bg-white"].text-stone-500 { color: #78716c !important; }
.wizard-dark [class*="bg-white"].text-stone-600 { color: #57534e !important; }
.wizard-dark [class*="bg-white"].text-stone-700 { color: #44403c !important; }
.wizard-dark [class*="bg-white"].text-stone-900 { color: #1c1917 !important; }
.wizard-dark [class*="bg-white"].border-stone-200,
.wizard-dark [class*="bg-amber-50"].border-stone-200 { border-color: #e7e5e4 !important; }
.wizard-dark [class*="bg-amber-50"].text-stone-400 { color: #a8a29e !important; }
.wizard-dark [class*="bg-amber-50"].text-stone-500 { color: #78716c !important; }
.wizard-dark [class*="bg-amber-50"].text-stone-600 { color: #57534e !important; }
.wizard-dark [class*="bg-amber-50"].text-stone-700 { color: #44403c !important; }
.wizard-dark [class*="bg-amber-50"].text-stone-900 { color: #1c1917 !important; }

/* Hide scrollbar but allow scrolling */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}

