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

:root {
  --rose: #c9738a;
  --rose-light: #f7e8ed;
  --rose-dark: #8a3f52;
  --cream: #faf7f4;
  --dark: #1c1a1f;
  --muted: #7a6e75;
  --gold: #c4a35a;
  --card-bg: rgba(255,255,255,0.9);
  --shadow: 0 8px 40px rgba(100,50,65,0.10);
  --radius: 14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(201,115,138,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(196,163,90,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Lock Screen ── */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.5s ease;
}

.lock-screen.hidden { display: none; }

.lock-box {
  text-align: center;
  padding: 48px 40px;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid rgba(201,115,138,0.15);
  box-shadow: 0 24px 80px rgba(100,50,65,0.12);
  max-width: 400px;
  width: 90%;
}

.lock-heart {
  font-size: 48px;
  color: var(--rose);
  margin-bottom: 12px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.lock-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 8px;
}
.lock-title em { color: var(--rose); font-style: italic; }

.lock-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.lock-form {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.lock-form input {
  padding: 12px 16px;
  border: 1.5px solid rgba(201,115,138,0.25);
  border-radius: 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: white;
  color: var(--dark);
  outline: none;
  flex: 1;
  transition: border-color 0.2s;
}
.lock-form input:focus { border-color: var(--rose); }

.lock-form button {
  padding: 12px 22px;
  background: var(--rose);
  color: white;
  border: none;
  border-radius: 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.lock-form button:hover { background: var(--rose-dark); }

.lock-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #e05555;
  min-height: 18px;
}

/* ── App ── */
.app { position: relative; z-index: 1; }
.app.hidden { display: none; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 56px 24px 32px;
  position: relative;
}

.heart-deco {
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--rose);
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 10px;
}

header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 300;
  line-height: 1;
  color: var(--dark);
  letter-spacing: -1px;
}
header h1 em { color: var(--rose); font-style: italic; font-weight: 400; }

.since {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.since span { color: var(--gold); font-weight: 500; }

.settings-btn {
  position: absolute;
  top: 60px;
  right: 0;
  background: none;
  border: 1.5px solid rgba(201,115,138,0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-btn:hover { border-color: var(--rose); color: var(--rose); }

/* ── Nav ── */
nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 32px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 18px;
  border-radius: 40px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}
.tab:hover { color: var(--rose); border-color: rgba(201,115,138,0.3); }
.tab.active { background: var(--rose); color: white; border-color: var(--rose); }

/* ── Sections ── */
.section { display: none; }
.section.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

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

.section-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* ── Memories ── */
.upload-zone {
  border: 2px dashed rgba(201,115,138,0.35);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 32px;
  background: rgba(247,232,237,0.3);
}
.upload-zone:hover,
.upload-zone.dragover { border-color: var(--rose); background: rgba(247,232,237,0.6); }
.upload-zone h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--rose-dark);
}
.upload-zone p { font-size: 13px; color: var(--muted); }
#fileInput { display: none; }

.memories-grid {
  columns: 3;
  column-gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 680px) { .memories-grid { columns: 2; } }
@media (max-width: 400px) { .memories-grid { columns: 1; } }

.memory-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.12);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.memory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(100,50,65,0.15);
}

.memory-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.memory-thumb.tall { aspect-ratio: 0.75; }

.memory-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--rose-light) 0%, #ede0ea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}
.memory-placeholder.tall { aspect-ratio: 0.75; }
.memory-placeholder span { font-size: 11px; color: var(--muted); opacity: 0.6; }

.memory-info { padding: 10px 12px 12px; }
.memory-info h3 { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.memory-info p { font-size: 11px; color: var(--muted); }

/* ── Notes ── */
.note-compose {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.15);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.note-compose input {
  width: 100%;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  color: var(--dark);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(201,115,138,0.2);
  padding-bottom: 8px;
}
.note-compose textarea {
  width: 100%;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: transparent;
  color: var(--muted);
  resize: none;
  min-height: 80px;
  line-height: 1.65;
}
.compose-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.notes-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
@media (max-width: 560px) { .notes-layout { grid-template-columns: 1fr; } }

.note-card {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.15);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.note-card:hover { transform: translateY(-2px); }
.note-card.pinned { border-color: var(--gold); }
.note-card.pinned .note-tag { background: rgba(196,163,90,0.15); color: var(--gold); }

.note-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--rose-light);
  color: var(--rose);
  margin-bottom: 10px;
}
.note-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.2;
}
.note-card p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.note-meta { margin-top: 12px; font-size: 11px; color: #b0a0a8; }

/* ── Dates ── */
.dates-hero {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  border: 1px solid rgba(201,115,138,0.12);
  position: relative;
  overflow: hidden;
}
.dates-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(201,115,138,0.07), transparent);
  pointer-events: none;
}

.countdown-label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 16px;
}
.countdown-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cd-unit { text-align: center; }
.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 300;
  line-height: 1;
  color: var(--dark);
}
.cd-lbl {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.cd-sep {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 300;
  color: rgba(201,115,138,0.3);
  padding-top: 4px;
}
.dates-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--muted);
}

.date-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.date-inputs > div { flex: 1; min-width: 160px; }
.date-inputs label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.date-inputs input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid rgba(201,115,138,0.25);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  background: var(--card-bg);
  transition: border-color 0.2s;
}
.date-inputs input:focus { border-color: var(--rose); }

.special-dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}
.date-item {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.12);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.date-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.date-item h4 { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.date-item p { font-size: 12px; color: var(--muted); }
.days-away { font-size: 11px; color: var(--rose); font-weight: 500; margin-top: 3px; }

/* ── Wishlist ── */
.wish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.wish-card {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.12);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wish-card:hover { transform: translateY(-2px); }
.wish-emoji { font-size: 28px; }
.wish-card h3 { font-size: 15px; font-weight: 500; }
.wish-card p { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.5; }
.wish-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.wish-who { font-size: 11px; color: var(--rose); font-weight: 500; }
.wish-status {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
}
.wish-status.dream { background: rgba(247,232,237,0.8); color: var(--rose); }
.wish-status.planned { background: rgba(196,163,90,0.12); color: var(--gold); }
.wish-status.done { background: rgba(80,180,120,0.1); color: #3a9460; }

/* ── Letter ── */
.letter-wrap { max-width: 600px; margin: 0 auto 40px; }
.letter-card {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.18);
  border-radius: 20px;
  padding: 40px 48px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.letter-card::before {
  content: '♡';
  position: absolute;
  top: -20px; right: 30px;
  font-size: 140px;
  color: rgba(201,115,138,0.04);
  line-height: 1;
  pointer-events: none;
}
.letter-header {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(201,115,138,0.15);
}
.letter-card textarea {
  width: 100%;
  min-height: 220px;
  border: none;
  outline: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--dark);
  background: transparent;
  resize: none;
}
.letter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid rgba(201,115,138,0.12);
  padding-top: 16px;
}

/* ── Playlist ── */
.playlist-card {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}
.playlist-header {
  padding: 24px;
  background: linear-gradient(135deg, rgba(201,115,138,0.08), rgba(196,163,90,0.06));
  border-bottom: 1px solid rgba(201,115,138,0.12);
  display: flex; align-items: center; gap: 16px;
}
.playlist-icon { font-size: 36px; }
.playlist-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
}
.playlist-header p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.song-list { list-style: none; }
.song-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 24px;
  border-bottom: 1px solid rgba(201,115,138,0.08);
  cursor: pointer;
  transition: background 0.15s;
}
.song-item:last-child { border-bottom: none; }
.song-item:hover { background: rgba(247,232,237,0.5); }
.song-num { width: 20px; text-align: center; font-size: 12px; color: var(--muted); }
.song-info { flex: 1; }
.song-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 1px; }
.song-info p { font-size: 12px; color: var(--muted); }
.song-meaning { font-size: 11px; font-style: italic; color: var(--rose); margin-top: 2px; }
.song-dur { font-size: 12px; color: var(--muted); }
.playlist-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(201,115,138,0.1);
}

/* ── Places ── */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.place-card {
  background: var(--card-bg);
  border: 1px solid rgba(201,115,138,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  cursor: pointer;
}
.place-card:hover { transform: translateY(-3px); }
.place-thumb {
  height: 120px;
  background: linear-gradient(135deg, var(--rose-light), #ede0ea);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.add-place-card { border: 2px dashed rgba(201,115,138,0.25); }
.add-icon { background: transparent; opacity: 0.5; }
.place-info { padding: 14px; }
.place-info h3 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.place-info h3.muted { color: var(--muted); }
.place-info p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.place-tag { font-size: 10px; color: var(--rose); margin-top: 6px; font-weight: 500; }

/* ── Buttons ── */
.btn-rose {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--rose);
  color: white;
  border: none;
  border-radius: 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-rose:hover { background: var(--rose-dark); }
.btn-rose:active { transform: scale(0.97); }

.btn-ghost {
  padding: 8px 18px;
  border: 1.5px solid rgba(201,115,138,0.3);
  border-radius: 40px;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--rose);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--rose-light); }

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,26,31,0.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--cream);
  border-radius: 20px;
  max-width: 440px;
  width: 92%;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  animation: fadeIn 0.25s ease;
}
.modal h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--rose); }

.modal label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
  text-transform: uppercase;
}
.modal label:first-of-type { margin-top: 0; }

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(201,115,138,0.2);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: white;
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s;
}
.modal input:focus,
.modal textarea:focus,
.modal select:focus { border-color: var(--rose); }
.modal textarea { min-height: 80px; resize: vertical; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 40px 24px 56px;
  font-size: 12px;
  color: rgba(122,110,117,0.5);
  letter-spacing: 1px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  nav { gap: 3px; }
  .tab { padding: 7px 12px; font-size: 12px; }
  .letter-card { padding: 28px 24px; }
  .dates-hero { padding: 28px 20px; }
  .settings-btn { display: none; }
}
