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

/* ─────────────────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────────────────── */
:root {
  --blush:        #F7D6D0;
  --blush-deep:   #EDAEA3;
  --rose-gold:    #C9956C;
  --rose-deep:    #A67752;
  --ivory:        #FDF6EC;
  --cream:        #FAF0E6;
  --plum:         #5C2D4B;
  --plum-mid:     #7A3E63;
  --plum-light:   #9B5680;
  --text-dark:    #3D1A2E;
  --text-mid:     #7A4060;
  --text-soft:    #B08898;
  --white:        #FFFFFF;
  --success:      #7EC8A0;
  --danger:       #E07070;

  --shadow-sm:    0 2px 12px rgba(92,45,75,0.10);
  --shadow-md:    0 8px 32px rgba(92,45,75,0.15);
  --shadow-lg:    0 20px 60px rgba(92,45,75,0.25);

  --glass-bg:     rgba(253,246,236,0.88);
  --glass-border: rgba(201,149,108,0.25);

  --radius-sm:    12px;
  --radius-md:    20px;
  --radius-lg:    28px;
  --radius-xl:    40px;

  --transition:   0.3s cubic-bezier(0.34,1.56,0.64,1);
  --transition-fast: 0.2s ease;
}

/* ─────────────────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100dvh;
  overscroll-behavior: none;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }

/* ─────────────────────────────────────────────────────────
   FLOATING HEARTS ANIMATION
───────────────────────────────────────────────────────── */
.hearts-container {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.heart-particle {
  position: absolute;
  bottom: -60px;
  font-size: 20px;
  animation: floatHeart linear infinite;
  opacity: 0;
  user-select: none;
}

@keyframes floatHeart {
  0%   { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-110vh) rotate(30deg) scale(1.1); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────
   ════════════════ LOGIN PAGE ════════════════
───────────────────────────────────────────────────────── */
.login-page {
  background: var(--plum);
}

/* Backdrop */
.backdrop {
  position: fixed; inset: 0;
  background-image: url('./images/backdrop.jpg');
  background-size: cover;
  background-position: center center;
  filter: blur(2px) brightness(0.95) saturate(1.05);
  transform: scale(1.04);
  z-index: 0;
}

.backdrop-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20,10,30,0.10) 0%,
    rgba(20,10,30,0.15) 50%,
    rgba(20,10,30,0.35) 100%
  );
  z-index: 1;
}

/* Login wrapper */
.login-wrapper {
  position: relative; z-index: 10;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px 24px;
}

/* Login card */
.login-card {
  width: 100%; max-width: 380px;
  background: rgba(12, 6, 22, 0.58);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 18px 20px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  text-align: center;
  animation: cardEntrance 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.login-title em {
  color: #f0b98a;
  font-style: italic;
}

.login-ring-icon {
  font-size: 22px;
  display: inline-block;
  animation: ringPulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.login-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.60);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.login-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
  font-weight: 300;
}

/* PIN dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: transparent;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.dot.filled {
  background: var(--rose-gold);
  border-color: var(--rose-gold);
  transform: scale(1.15);
}

.dot.shake {
  animation: dotShake 0.4s ease;
}

@keyframes dotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Hidden real input */
.pin-input-hidden {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* Login button */
.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--rose-gold), var(--plum-mid));
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(201,149,108,0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: 0;
}

.login-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(201,149,108,0.3);
}

/* Error */
.login-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  min-height: 20px;
}

.login-error.visible { opacity: 1; }

/* Success overlay */
.login-success-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle, rgba(201,149,108,0.9) 0%, rgba(92,45,75,0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.login-success-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.login-success-overlay .success-emoji {
  font-size: 72px;
  animation: successBounce 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

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

.login-success-overlay p {
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────
   ════════════════ TRIP PAGE ════════════════
───────────────────────────────────────────────────────── */
.trip-page {
  background: var(--cream);
  min-height: 100dvh;
}

/* Top bar */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(250,240,230,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.top-bar-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--plum);
}

.logout-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.logout-btn:active { background: var(--blush); }

/* ── Hero Section ── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--plum) 0%, var(--plum-mid) 50%, var(--rose-gold) 100%);
  padding: 48px 24px 56px;
  text-align: center;
  color: var(--white);
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('./images/backdrop.jpg') center/cover no-repeat;
  opacity: 0.18;
  filter: saturate(1.4);
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blush);
  margin-bottom: 20px;
}

.hero-emoji { font-size: 56px; margin-bottom: 12px; display: block; }

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-title span { color: var(--blush-deep); font-style: italic; }

.hero-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  margin-bottom: 24px;
}

.hero-dates {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.hero-dates .dot-sep { opacity: 0.4; }

/* hero wave */
.hero-wave {
  position: absolute; bottom: -2px; left: 0; right: 0;
  line-height: 0;
}

.hero-wave svg { display: block; width: 100%; }

/* ── Section ── */
.section {
  padding: 28px 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blush), var(--blush-deep));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--plum);
}

/* ── Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blush-deep), var(--rose-gold), var(--blush-deep));
  border-radius: 2px;
}

.day-card {
  display: flex;
  gap: 20px;
  padding: 4px 0 20px;
  position: relative;
}

.day-card:last-child { padding-bottom: 0; }

.day-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-gold), var(--plum-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201,149,108,0.35);
  position: relative; z-index: 1;
}

.day-content {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,149,108,0.1);
}

.day-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose-gold);
  margin-bottom: 4px;
}

.day-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--plum);
  margin-bottom: 10px;
}

.day-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mid);
  padding: 6px 0;
  border-top: 1px solid var(--blush);
}

.day-detail:first-of-type { border-top: none; }

.day-detail-icon { font-size: 15px; flex-shrink: 0; }

.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blush);
  color: var(--plum);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  margin-top: 4px;
}

.tbd-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--blush), #f0c4bb);
  color: var(--plum-mid);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px dashed var(--blush-deep);
}

/* ── Places Section ── */
.places-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 80px;
}

.place-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,149,108,0.1);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: placeSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  position: relative;
  overflow: hidden;
}

@keyframes placeSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.place-card:active { transform: scale(0.98); }

.place-card.visited {
  background: linear-gradient(135deg, #f0faf2, #e8f5eb);
  border-color: rgba(126,200,160,0.3);
}

.place-card.visited::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--success);
  border-radius: 4px 0 0 4px;
}

.place-emoji-wrap {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blush), var(--blush-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.place-card.visited .place-emoji-wrap {
  background: linear-gradient(135deg, #c8ecd1, #a8d5b5);
}

.place-info { flex: 1; min-width: 0; }

.place-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-card.visited .place-name {
  text-decoration: line-through;
  color: var(--text-soft);
}

.place-category {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
  text-transform: capitalize;
}

.place-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visit-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--blush-deep);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}

.place-card.visited .visit-btn {
  background: var(--success);
  border-color: var(--success);
}

.delete-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(224,112,112,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--danger);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.delete-btn:active {
  background: rgba(224,112,112,0.25);
  transform: scale(0.9);
}

/* loading skeleton */
.place-skeleton {
  height: 74px;
  background: linear-gradient(90deg, var(--cream) 25%, var(--blush) 50%, var(--cream) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* Progress bar */
.progress-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,149,108,0.1);
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.progress-bar-track {
  height: 8px;
  background: var(--blush);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-gold), var(--success));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 28px; right: 20px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-gold), var(--plum-mid));
  color: var(--white);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(92,45,75,0.35);
  z-index: 90;
  transition: transform var(--transition), box-shadow var(--transition-fast);
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 4px 14px rgba(92,45,75,0.25);
}

/* ── Add Place Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,10,25,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-sheet {
  width: 100%; max-width: 480px;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 24px 40px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

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

.modal-handle {
  width: 40px; height: 4px;
  background: var(--blush-deep);
  border-radius: 100px;
  margin: 0 auto 24px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--plum);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 24px;
}

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--blush-deep);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--ivory);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--rose-gold);
  box-shadow: 0 0 0 3px rgba(201,149,108,0.15);
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.emoji-opt {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 2px solid var(--blush);
  background: var(--ivory);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.emoji-opt.selected {
  border-color: var(--rose-gold);
  background: var(--blush);
  transform: scale(1.1);
}

.category-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--blush-deep);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--ivory);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A4060' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.add-place-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--rose-gold), var(--plum-mid));
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(201,149,108,0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 8px;
}

.add-place-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(201,149,108,0.3);
}

.add-place-btn:disabled {
  opacity: 0.6;
  transform: none;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--plum);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 100px;
  box-shadow: 0 8px 24px rgba(92,45,75,0.4);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

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

/* ── Divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--blush-deep), transparent);
  margin: 0 20px;
  opacity: 0.5;
}

/* ── Responsive ── */
@media (min-width: 480px) {
  .login-card { max-width: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  *, .heart-particle { animation: none !important; transition: none !important; }
}
