/* General body styles */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin: 0;
    background: linear-gradient(135deg, #cceeff, #e3f0ff);
}

.page-title { 
  text-align: center;
  z-index: 1; 
  background-color: transparent;
  display: inline-block;
  margin: 0 auto; 
  line-height: 1.6;
  white-space: pre-line;
  word-wrap: break-word;
}

.title-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container-title {
  padding: 0 10px;
}

.spotify-reveal {
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  background: #111827;
  color: #fff;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

#blossomCanvas {
  z-index: 0;
}
  
#heartCanvas {
  z-index: 1;
}

.birthday-countdown {
  display: flex;
  justify-content: center;
  align-items: center;
}

.web-container {
  width: 95%;
  height: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  z-index: 2;
}

.divider {
  height: 10vh;
}

.page-nav-controls {
  display: none;
}

/* Page navigation experiment (gated via data-page-nav="1") */
body[data-page-nav="1"] {
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scroll-padding-top: 12vh;
  scroll-padding-bottom: 12vh;
}

body[data-page-nav="1"] .web-container {
  width: 100%;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

body[data-page-nav="1"] .page-frame {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center; /* keep center */
  scroll-snap-align: center;
  scroll-snap-stop: always;
  padding: 12vh 0;
  box-sizing: border-box;
  position: relative;
}


body[data-page-nav="1"] .container {
  width: min(960px, 92%);
  max-width: 960px;
  box-sizing: border-box;
  padding: 6vh 2rem;
  background: var(--block-bg, transparent);
  border-radius: 14px;
  max-height: calc(100vh - 24vh); /* keeps it centered visually */
  overflow-y: auto; /* content scrolls inside */
}


body[data-page-nav="1"] .divider {
  display: none;
}

body[data-page-nav="1"] .page-nav-controls {
  display: flex;
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 12;
  pointer-events: none;
}

body[data-page-nav="1"] .page-nav-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

body[data-page-nav="1"] .page-nav-btn,
body[data-page-nav="1"] .page-nav-dot {
  pointer-events: auto;
}

body[data-page-nav="1"] .page-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  color: #0f172a;
  cursor: pointer;
  display: grid;
  place-items: center;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  font-size: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body[data-page-nav="1"] .page-nav-btn[data-dir="up"] {
  background-image: url('/icons/up-arrow.png');
}

body[data-page-nav="1"] .page-nav-btn[data-dir="down"] {
  background-image: url('/icons/down-arrow.png');
}

body[data-page-nav="1"] .page-nav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
}

body[data-page-nav="1"] .page-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

body[data-page-nav="1"] .page-nav-dots {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
}

body[data-page-nav="1"] .page-nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.24);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

body[data-page-nav="1"] .page-nav-dot.is-active {
  background: #0f172a;
  transform: scale(1.45);
}

@media (max-width: 900px) {
  body[data-page-nav="1"] .page-nav-controls {
    left: auto;
    right: 14px;
  }
}

@media (max-width: 540px) {
  body[data-page-nav="1"] {
    scroll-padding-top: 14vh;
  }
  body[data-page-nav="1"] .page-nav-controls {
    top: auto;
    bottom: 16px;
    right: 12px;
    transform: none;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px 10px;
    border-radius: 999px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
    flex-direction: row;
    gap: 10px;
  }
  body[data-page-nav="1"] .page-nav-stack,
  body[data-page-nav="1"] .page-nav-dots {
    flex-direction: row;
  }
}

.container {
  margin: 25vh 0;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: top;
  gap: 10px;
  width: 100%;
  min-height: 5rem;
  height: fit-content;
}

.sticky-wrapper {
  height: 100vh;
  position: relative;
}

.container.visible {
  opacity: 1;
}

.description {
  flex: 1 1 300px;
  width: 30%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
}

.text-body {
  font-size: 1.8rem;
  padding: 2rem 1rem;
  text-align: center;
}

.music_holder {
  flex: 2 1 300px;
  width: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  padding: 1rem;
  overflow: hidden;
  display: block;
  height: 150px;
}

.spotify-placeholder {
  flex: 2 1 300px;
  width: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  flex-direction: column;
  height: 150px;
  text-align: center;
  padding: 1rem;
}

.countdown-timer {
  padding: 30px;
  font-family: 'Arial', sans-serif;
  text-align: center;
  font-size: 2rem;
  color: #333;
  display: inline-block;
  font-weight: bold;
}

.countdown-timer span {
  font-size: 1.5rem;
  color: #ffb6c1d9;
  padding: 0 10px;
}

.clock-container {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden; 
  font-size: clamp(1rem, 5vw, 2rem); 
  display: flex;
  justify-content: center; 
  align-items: center;
  font-family: 'Arial', sans-serif;
  font-weight: bold;
}

.countdown-timer h5 {
  margin: 5px;
}

.description {
  text-align: center;
}

/* Carousel Block */
.carousel-holder {
  display: flex;
  text-align: center;
  width: 30%;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  width: 70%;
  max-width: 800px;
  margin: auto;
  display: flex;
  align-items: center;
}

.carousel {
  overflow: hidden;
  width: 100%;
  padding: 5rem 0;
}

.carousel-holder h5 {
  font-size: 2rem;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  gap: 20px;
}

.carousel-item {
  width: 10rem;
  height: 10rem;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  opacity: 0.5;
  flex-shrink: 0;
}

.carousel-item.active {
  transform: scale(1.6);
  opacity: 1;
  z-index: 2;
}

/* Tablets 768px */
@media (max-width: 768px) {
  .carousel {
    overflow: hidden;
    width: 100%;
    padding: 4rem 0;
  }
  .carousel-item.active {
    transform: scale(1.5);
  }
  .carousel-holder {
    display: flex;
    text-align: center;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 0;
  }
  .carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: auto;
    display: flex;
    align-items: center;
  }
  .carousel-holder h5 {
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 1.8rem;
  }
}

/* Phones 480px */
@media (max-width: 480px) {
  .carousel {
    overflow: hidden;
    width: 100%;
    padding: 2.5rem 0;
  }
  .carousel-item.active {
    transform: scale(1.25);
  }
  .carousel-holder {
    display: flex;
    text-align: center;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 0;
  }
  .carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: auto;
    display: flex;
    align-items: center;
  }
  .carousel-holder h5 {
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 1.5rem;
  }
}

.carousel-btn {
  background: none;
  border: none;
  font-size: 3rem;
  color: #333;
  cursor: pointer;
  z-index: 3;
  padding: 0 10px;
}


.carousel-preview-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 0;
  width: 100%;
  min-width: 0;
}

/* Keep the track's intrinsic width from expanding its flex viewport. */
.carousel-container,
.carousel {
  min-width: 0;
}
.carousel-track {
  position: relative;
}
.carousel-track-wrapper {
  touch-action: pan-y;
}
.carousel-btn {
  flex: 0 0 auto;
}
.carousel-btn[hidden] {
  display: none;
}
.carousel-container.non-carousel .carousel-track {
  justify-content: center;
  transform: none !important;
}
.carousel-container.non-carousel .carousel-item {
  opacity: 1 !important;
  transform: none !important;
  width: min(15rem, 100%);
  height: auto;
  aspect-ratio: 1;
}

/* This Or That Block */
.this-or-that-final {
  display: flex;
  justify-content: space-between;
  width: 95%;
  padding: 1rem;
  flex-wrap: wrap;
  border-radius: 15px;
}

/* Left side (question) */
.preview-left {
  flex: 1 1 40%;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-left .container-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
  text-align: center;
  max-width: 300px;
}

/* Right side (choices) */
.preview-right {
  flex: 1 1 40%;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  height: 6.5rem;
}

.preview-right .choice {
  flex: 1 1 45%;
  min-width: 130px;
  height: 100%;
  padding: 0.8rem 1rem;
  border-radius: 15px;
  border: none;
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.preview-right .first {
  border-radius: 15px 0 0 15px;
}

.preview-right .second {
  border-radius: 0 15px 15px 0;
}

.preview-right .choice:first-child {
  background-color: #ff6781;
}

.preview-right .choice:last-child {
  background-color: #44c1ff;
}

.preview-right .choice:hover {
  transform: scale(1.05);
}

.preview-right .choice.selected,
.preview-right .choice.submitted {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  filter: saturate(1.1);
  opacity: 0.97;
}

.preview-right .choice.submitted::after,
.multiple-choice-final .preview-right-multi .choice.submitted::after {
  content: "Sent";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}


.remove {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;
}

.remove:hover {
  background: rgba(0, 0, 0, 0.05);
}

.remove img {
  width: 24px;
  height: 24px;
}


/* Multiple Choice block */
.multiple-choice-final {
  display: flex;
  justify-content: space-between;
  width: 95%;
  padding: 1rem;
  flex-wrap: wrap;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.08);
  margin-top: 1rem;
  backdrop-filter: blur(5px);
}

/* Left (question) */
.multiple-choice-final .preview-left-multi {
  flex: 1 1 40%; 
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.multiple-choice-final .preview-left-multi .container-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: #222;
  text-align: center;
  max-width: 300px;
}

/* Right (choices) */
.multiple-choice-final .preview-right-multi {
  flex: 1 1 40%;
  min-width: 300px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0;
}

/* Make it 2-column when there are 3+ buttons */
.multiple-choice-final .preview-right-multi:has(.choice:nth-child(3)) {
  grid-template-columns: repeat(2, 1fr);
}

/* If exactly 3 buttons, make the 3rd one span 2 columns */
.multiple-choice-final .preview-right-multi:has(.choice:nth-child(3)):not(:has(.choice:nth-child(4))) .choice:nth-child(3) {
  grid-column: span 2;
}

/* If exactly 5 buttons, span the 5th one */
.multiple-choice-final .preview-right-multi:has(.choice:nth-child(5)):not(:has(.choice:nth-child(6))) .choice:nth-child(5) {
  grid-column: span 2;
}

.multiple-choice-final .preview-right-multi .choice {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 15px;
  border: none;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease-in-out;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.multiple-choice-final .preview-right-multi .choice:hover {
  transform: scale(1.05);
}

.multiple-choice-final .preview-right-multi .choice.selected,
.multiple-choice-final .preview-right-multi .choice.submitted {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  filter: saturate(1.1);
  opacity: 0.97;
}

/* Date Block Finished */
.calendar-holder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
  color: #333;
}

.select-wrapper {
  position: relative;
  display: inline-block;
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #000;
  font-size: 0.9rem;
}

.select-wrapper select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 0.4rem 5rem 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}


.calendar-header .slash {
  font-size: 1.3rem;
  color: #666;
}

.calendar-nav {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #555;
  transition: transform 0.2s ease;
}

.calendar-nav:hover {
  transform: scale(1.2);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
  margin: 0 auto;
}

.calendar-grid-selection {
    display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  max-width: 320px;
  margin: 0 auto;
}

.calendar-day {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #333;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.calendar-day.today {
  box-shadow: 0 0 0 2px #ffcb05aa;
  background: rgba(255, 255, 255, 0.4);
  font-weight: 900;
}


.calendar-day.selectable:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.calendar-day.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.calendar-day.selected {
  position: relative;
  z-index: 1;
  color: black;
  font-weight: bold;
}

.calendar-day.selected::before {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  background-image: url('/icons/star.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.8;
  z-index: -1;
}

.date-final {
  display: flex;
  justify-content: space-between;
  width: 95%;
  padding: 1rem;
  flex-wrap: wrap;
  border-radius: 15px;
  align-items: center;
  gap: 1rem;
}

.date-final .date-block-left,
.date-final .date-block-right {
  flex: 1 1 40%;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.container-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #222;
  text-align: center;
}


.remove {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;
}

.remove:hover {
  background: rgba(0, 0, 0, 0.05);
}

.remove img {
  width: 24px;
  height: 24px;
}

/* A fixed body also prevents mobile browsers from scrolling behind the intro. */
html.cloud-intro-active,
html.cloud-intro-active body {
  overflow: hidden;
  overscroll-behavior: none;
}
html.cloud-intro-active body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
}
html.cloud-intro-active .intro-overlay {
  width: 100%;
  height: 100%;
  height: 100dvh;
  box-sizing: border-box;
  touch-action: none;
  overscroll-behavior: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
html.cloud-intro-active .intro-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: clamp(12px, 4vh, 28px) clamp(16px, 5vw, 24px);
  overflow-wrap: anywhere;
}
html.cloud-intro-active .reveal-btn {
  max-width: 100%;
}
