:root {
  --bg-1: #2a1530;
  --bg-2: #4a1d3a;
  --bg-3: #6d2a4f;
  --pink: #ff8fb1;
  --red: #ff5c7c;
  --rose: #ffd6e3;
  --cream: #fff8f0;
  --teal: #5ec5c5;
  --glass: rgba(255, 248, 240, 0.10);
  --glass-strong: rgba(255, 248, 240, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============ NAV WRAPPER ============ */
.nav-wrapper {
  position: relative;
  z-index: 100;
}

/* ============ TOP NAV ============ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(42, 21, 48, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.topnav-brand {
  font-family: 'Dancing Script', cursive;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rose);
  text-decoration: none;
}
.topnav-tabs {
  display: flex;
  gap: 6px;
}
.topnav-tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 248, 240, 0.7);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.25s;
}
.topnav-tab:hover {
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.2);
}
.topnav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--pink));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 92, 124, 0.35);
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(1200px 800px at 20% -10%, var(--bg-3), transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, #7a2f5c, transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, #3a1230);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* decorative blurred blobs */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
body::before {
  width: 380px; height: 380px;
  background: var(--red);
  top: -80px; left: -60px;
}
body::after {
  width: 420px; height: 420px;
  background: var(--teal);
  bottom: -120px; right: -80px;
}

/* ============ FLOATING HEARTS ============ */
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.floating-heart {
  position: absolute;
  bottom: -40px;
  opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.7; }
  100% { transform: translateY(-110vh) rotate(40deg) scale(1.1); opacity: 0; }
}

/* ============ PASSWORD MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 8, 24, 0.78);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal-card {
  width: min(380px, 90vw);
  padding: 38px 32px 32px;
  text-align: center;
  border-radius: 28px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: popIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popIn {
  from { transform: scale(0.9) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.bears-login, .bears-header {
  display: flex;
  justify-content: center;
}
.bears-login svg { width: 180px; height: auto; }
.bears-header svg { width: 230px; height: auto; }

.modal-card h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.6rem;
  margin: 8px 0 4px;
  color: var(--rose);
  text-shadow: 0 2px 14px rgba(255, 140, 170, 0.45);
}
.subtitle {
  font-size: 0.92rem;
  opacity: 0.82;
  margin-bottom: 22px;
}
#password-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--cream);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
#password-input::placeholder { color: rgba(255, 248, 240, 0.5); letter-spacing: 1px; }
#password-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 143, 177, 0.25);
}
.btn-primary {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 10px 24px rgba(255, 92, 124, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }
.password-error {
  margin-top: 14px;
  color: #ffd0da;
  font-size: 0.88rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.password-error.visible { opacity: 1; }
.shake { animation: shake 0.45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ============ MAIN CONTENT ============ */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 80px 22px 40px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.main-content.visible { opacity: 1; transform: translateY(0); }

header { text-align: center; }
.couple-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  margin: 6px 0 18px;
  color: var(--rose);
  text-shadow: 0 2px 20px rgba(255, 140, 170, 0.4);
}
.name-bubu { color: var(--pink); }
.name-dudu { color: var(--teal); }
.heart-pulse {
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.counter {
  font-size: clamp(0.92rem, 2.4vw, 1.15rem);
  font-weight: 300;
  line-height: 1.7;
  padding: 16px 22px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  display: inline-block;
  max-width: 100%;
}
.counter .highlight {
  font-weight: 700;
  color: var(--pink);
  font-size: 1.25em;
  text-shadow: 0 0 16px rgba(255, 143, 177, 0.5);
}

/* Next-8 countdown */
.next-counter {
  margin: 18px auto 0;
  max-width: 460px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}
.next-counter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.next-counter-label {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
}
.next-counter-time {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--teal);
}
.next-bar {
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.next-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--pink), var(--red));
  transition: width 1s linear;
}
.next-counter-sub {
  margin-top: 8px;
  font-size: 0.82rem;
  opacity: 0.8;
}

.divider {
  height: 1px;
  margin: 34px auto 0;
  max-width: 240px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 227, 0.6), transparent);
}

/* ============ TABS ============ */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 30px 0 26px;
}
.tab-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--glass);
  color: var(--cream);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.25s, transform 0.18s, border-color 0.25s;
}
.tab-btn:hover { transform: translateY(-2px); border-color: var(--pink); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--red), var(--pink));
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(255, 92, 124, 0.4);
}

/* ============ YEARS / TIMELINE ============ */
.year-section { display: none; }
.year-section.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.year-header {
  text-align: center;
  margin-bottom: 26px;
}
.year-header h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.3rem;
  color: var(--rose);
}
.year-sub {
  display: block;
  font-size: 0.82rem;
  opacity: 0.65;
  letter-spacing: 1px;
  margin-top: 2px;
}
.year-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  padding-left: 28px;
}
.year-timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--pink), rgba(255, 143, 177, 0.1));
}

.card {
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.card.visible { opacity: 1; transform: translateY(0); }
.card-dot {
  position: absolute;
  left: -28px;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 5px rgba(255, 143, 177, 0.22);
  z-index: 2;
}
.card.milestone .card-dot {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 92, 124, 0.32), 0 0 16px rgba(255, 92, 124, 0.6);
}
.card-content {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  height: 100%;
}
.card-content:hover {
  transform: translateY(-6px);
  border-color: var(--pink);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(255, 143, 177, 0.18), rgba(94, 197, 197, 0.18));
  overflow: hidden;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.card-content:hover .card-photo img { transform: scale(1.06); }

.placeholder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 143, 177, 0.16), rgba(94, 197, 197, 0.16));
}
.placeholder-heart-bg { font-size: 2.4rem; opacity: 0.6; }
.placeholder-month { font-size: 1.6rem; font-weight: 700; }
.placeholder-date { font-size: 0.8rem; opacity: 0.85; }
.placeholder-label { font-size: 0.72rem; letter-spacing: 2px; opacity: 0.5; text-transform: uppercase; }

.card-body { padding: 16px 18px 18px; }
.card-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-month-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  letter-spacing: 0.5px;
}
.badge-milestone {
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
}
.badge-upcoming {
  background: rgba(94, 197, 197, 0.28);
}
.card-mood { font-size: 1.1rem; }
.card-date {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-bottom: 6px;
}
.card-title {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--rose);
}
.card-message {
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.92;
}
.card-from {
  margin-top: 12px;
  font-size: 0.82rem;
  font-style: italic;
  opacity: 0.75;
  text-align: right;
}

/* upcoming card */
.card-upcoming .card-content {
  border-style: dashed;
  border-color: rgba(94, 197, 197, 0.4);
}
.upcoming-label {
  font-size: 0.74rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}
.upcoming-timer {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal);
  margin: 4px 0;
}
.upcoming-sub {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ============ FOOTER ============ */
footer {
  text-align: center;
  margin-top: 50px;
  font-size: 0.85rem;
  opacity: 0.7;
}
.heart-icon { color: var(--red); }

/* ============ MUSIC BUTTON ============ */
.music-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  color: var(--cream);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, background 0.25s;
}
.music-btn:hover { transform: scale(1.08); }
.music-btn.playing {
  background: linear-gradient(135deg, var(--red), var(--pink));
  animation: spinPulse 2.4s ease-in-out infinite;
}
@keyframes spinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 143, 177, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 143, 177, 0); }
}
.music-btn.no-file { opacity: 0.4; cursor: not-allowed; }

/* ============ IMAGE MODAL ============ */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.image-modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 5, 18, 0.78);
  backdrop-filter: blur(8px);
}
.modal-content-image {
  position: relative;
  z-index: 2;
  width: min(880px, 100%);
  max-height: 88vh;
  border-radius: 24px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: popIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.modal-close:hover { background: var(--red); transform: rotate(90deg); }
.modal-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  max-height: 88vh;
}
.modal-image-box {
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 88vh;
}
.modal-image-box img { max-height: 88vh; }
.modal-details {
  padding: 34px 30px;
  overflow-y: auto;
}
.modal-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
  margin-bottom: 14px;
}
.modal-date {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 14px;
}
.modal-message {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 18px;
}
.modal-from {
  font-style: italic;
  opacity: 0.8;
  text-align: right;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-image-box { max-height: 42vh; min-height: 200px; }
  .modal-image-box img { max-height: 42vh; }
}
@media (max-width: 640px) {
  .main-content { padding: 40px 16px 30px; }
  .year-timeline { padding-left: 24px; gap: 18px; }
  .bears-header svg { width: 180px; }
  .counter { font-size: 0.85rem; }
}
@media (max-width: 380px) {
  .modal-card { padding: 30px 22px 24px; }
  .modal-card h1 { font-size: 2.2rem; }
  .couple-title { font-size: 1.9rem; }
}
