/* ============================================================
   ROMANTIC GIFT — MAIN STYLES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --pink:        #f9cdd8;
  --pink-dark:   #e8a0b4;
  --pink-light:  #fde8ef;
  --rose:        #d4849e;
  --milk:        #fdf8f2;
  --cream:       #f5ece0;
  --beige:       #ede0d4;
  --text-dark:   #5c3d4e;
  --text-medium: #8a6578;
  --text-soft:   #b89aaa;
  --shadow-sm:   0 2px 12px rgba(212,132,158,.18);
  --shadow-md:   0 6px 24px rgba(212,132,158,.28);
  --shadow-lg:   0 16px 48px rgba(212,132,158,.38);
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(145deg, var(--pink-light) 0%, var(--milk) 35%, var(--cream) 65%, var(--beige) 100%);
  background-attachment: fixed;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  font-weight: 400;
}

h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.2rem); }

p { line-height: 1.75; }

img { max-width: 100%; display: block; }

button { font-family: 'Nunito', sans-serif; }

/* ── Animated gradient overlay ────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(249,205,216,.35) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(253,232,239,.45) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(237,224,212,.35) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 18s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: .6; transform: scale(1); }
  to   { opacity: 1;  transform: scale(1.08); }
}

/* ── Background animation layer ───────────────────────────── */
.bg-animation {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -60px;
  animation: floatUp linear infinite;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  will-change: transform;
}

@keyframes floatUp {
  0%   { transform: translateY(0)      rotate(0deg)  scale(1);   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: .9; }
  100% { transform: translateY(-115vh) rotate(25deg) scale(.75); opacity: 0; }
}

.twinkle-star {
  position: absolute;
  color: var(--pink-dark);
  animation: twinkle ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

@keyframes twinkle {
  0%, 100% { opacity: 0;   transform: scale(.3) rotate(0deg); }
  50%       { opacity: .85; transform: scale(1)  rotate(180deg); }
}

/* ── Page loader ───────────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--pink-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
  transition: opacity .5s ease, visibility .5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-heart {
  font-size: 3.5rem;
  animation: heartbeat 1.3s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25%       { transform: scale(1.25); }
  40%       { transform: scale(1); }
  60%       { transform: scale(1.1); }
}

.page-loader p {
  color: var(--text-medium);
  font-style: italic;
  font-size: .95rem;
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(92, 61, 78, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--milk);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--r-lg);
    max-height: 88vh;
  }
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--beige);
  margin: 14px auto 0;
}

@media (min-width: 640px) {
  .modal-drag-handle { display: none; }
}

.modal-header {
  position: sticky;
  top: 0;
  background: var(--milk);
  padding: 16px 24px;
  border-bottom: 1px solid var(--beige);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
}

.modal-header-icon { font-size: 2rem; flex-shrink: 0; }

.modal-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--text-dark);
  flex: 1;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--pink-light);
  color: var(--text-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s, transform .3s;
}

.modal-close:hover {
  background: var(--pink);
  color: var(--text-dark);
  transform: rotate(90deg);
}

.modal-body { padding: 28px 24px 32px; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--pink-dark); border-radius: 3px; }

/* ── Focus visible ─────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--pink-dark); outline-offset: 3px; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--pink);
  border-top-color: var(--pink-dark);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

/* ── Toast notification ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: .9rem;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  white-space: nowrap;
}

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