@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --rose: #e8a4b8;
  --rose-light: #f5d5e0;
  --rose-dark: #c47a92;
  --gold: #d4a574;
  --gold-light: #f0e0c8;
  --bg: #faf6f2;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #8a8a9a;
  --shadow: rgba(200, 160, 160, 0.15);
  --radius: 20px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Navigation === */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 246, 242, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(200, 160, 160, 0.1);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose-dark), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: auto;
  letter-spacing: 2px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 30px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}

.nav-link:hover { color: var(--rose-dark); background: var(--rose-light); }
.nav-link.active { color: white; background: linear-gradient(135deg, var(--rose), var(--gold)); }
.nav-link.admin-btn {
  border: 1.5px solid var(--gold-light);
  color: var(--gold);
}
.nav-link.admin-btn:hover { background: var(--gold-light); color: var(--rose-dark); }

/* === Pages === */
.page {
  display: none;
  min-height: 100vh;
  padding-top: 64px;
  animation: fadeIn 0.6s ease;
}
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heartBeat { 0% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } 60% { transform: scale(1); } }

/* === Home Page === */
.home-hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.home-hero-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(228, 164, 184, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(212, 165, 116, 0.08) 0%, transparent 50%);
}

.home-hero-inner {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 20px;
  width: 100%;
  position: relative;
  z-index: 1;
  text-align: center;
}

.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  font-size: 20px;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose-dark), var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: 4px;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-light);
  font-weight: 300;
  letter-spacing: 8px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.countdown-section {
  position: relative;
  z-index: 1;
}

.countdown-label {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.countdown-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.countdown-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 90px;
  box-shadow: 0 8px 32px var(--shadow);
  text-align: center;
  transition: var(--transition);
}
.countdown-item:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(200, 160, 160, 0.25); }

.countdown-num {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  color: var(--rose-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.countdown-unit {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.countdown-name {
  font-family: 'Noto Serif SC', serif;
  color: var(--rose-dark);
  font-size: 16px;
  margin-top: 24px;
  opacity: 0.7;
}

/* === Anniversary Celebration Page === */
.celebration-page {
  position: relative;
  overflow: hidden;
}

.celebration-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #faf6f2 0%, #fce4ec 30%, #faf6f2 60%, #f5e6d3 100%);
  z-index: -1;
}

.celebration-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
}

.celebration-badge {
  display: inline-block;
  padding: 8px 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--rose), var(--gold-light));
  color: white;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

.celebration-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose-dark), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  animation: slideUp 1s ease;
}

.celebration-date {
  color: var(--text-light);
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 48px;
}

.celebration-quote {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 48px;
  padding: 0 24px;
  position: relative;
}
.celebration-quote::before {
  content: '"';
  font-size: 60px;
  color: var(--rose);
  opacity: 0.3;
  position: absolute;
  left: -10px;
  top: -20px;
}

.celebration-hearts {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 32px;
  margin-bottom: 48px;
  animation: heartBeat 2s ease-in-out infinite;
}

.celebration-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.celebration-gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}
.celebration-gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(200, 160, 160, 0.3);
}

/* === Gallery Page === */
.gallery-page {
  padding: 80px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 48px;
}

.gallery-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  color: var(--rose-dark);
  margin-bottom: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  aspect-ratio: 1;
}
.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(200, 160, 160, 0.3);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-light);
}
.gallery-empty .empty-icon { font-size: 48px; margin-bottom: 16px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

/* === Admin Page === */
.admin-page {
  padding: 80px 24px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.admin-login {
  text-align: center;
  padding: 80px 24px;
}
.admin-login h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  color: var(--rose-dark);
  margin-bottom: 24px;
}
.admin-input {
  padding: 12px 20px;
  border: 2px solid var(--rose-light);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  width: 280px;
  max-width: 100%;
  background: var(--card);
  color: var(--text);
}
.admin-input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(228, 164, 184, 0.15); }

.admin-btn {
  padding: 12px 32px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--rose), var(--gold));
  color: white;
}
.admin-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(228, 164, 184, 0.3); }
.admin-btn:active { transform: translateY(0); }
.admin-btn-sm {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 8px;
}
.admin-btn-outline {
  background: transparent;
  border: 1.5px solid var(--rose);
  color: var(--rose-dark);
}
.admin-btn-outline:hover { background: var(--rose-light); }
.admin-btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.admin-btn-danger:hover { box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3); }

.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px var(--shadow);
}
.admin-card h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--rose-dark);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.anniversary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anniversary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: 12px;
  transition: var(--transition);
  flex-wrap: wrap;
  gap: 8px;
}
.anniversary-item:hover { background: var(--rose-light); }
.anniversary-item .name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  color: var(--rose-dark);
}
.anniversary-item .date {
  font-size: 13px;
  color: var(--text-light);
}
.anniversary-item .actions {
  display: flex;
  gap: 8px;
}

.upload-area {
  border: 2px dashed var(--rose-light);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.upload-area:hover { border-color: var(--rose); background: var(--rose-light); }
.upload-area input { display: none; }
.upload-preview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.upload-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

/* === Status Indicator === */
.status-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 4px 20px var(--shadow);
  font-size: 12px;
  color: var(--text-light);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.error { background: #f44336; }

/* === Masonry Gallery === */
.masonry-grid {
  columns: 3;
  column-gap: 16px;
}
.masonry-grid img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}
.masonry-grid img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 32px rgba(200, 160, 160, 0.3);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-light);
}
.annual-item {
  border-left: 3px solid var(--gold);
  background: rgba(212, 165, 116, 0.05);
}
.cancel-edit-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--text-light);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}
.cancel-edit-btn:hover {
  border-color: var(--rose);
  color: var(--rose-dark);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 16px; display: block; }

/* === Toast === */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 3000;
  font-size: 14px;
  display: none;
  animation: slideUp 0.3s ease;
}
.toast.show { display: block; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rose-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

/* === Anniversary Timeline === */
.timeline-section {
  position: relative;
  z-index: 1;
}
.timeline-section h2 {
  font-family: 'Noto Serif SC', serif;
  color: var(--rose-dark);
  text-align: center;
  font-size: 24px;
  margin-bottom: 32px;
  position: relative;
}

.timeline {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--rose-light), var(--gold-light));
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.timeline-item:nth-child(odd) { flex-direction: row-reverse; text-align: right; }

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--rose-light);
  animation: pulse 2s ease-in-out infinite;
}

.timeline-content {
  flex: 1;
  background: var(--card);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow);
  transition: var(--transition);
}
.timeline-content:hover { transform: translateY(-2px); }
.timeline-content .t-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  color: var(--rose-dark);
  font-size: 16px;
}
.timeline-content .t-date { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.timeline-content .t-days { font-size: 13px; color: var(--gold); font-weight: 600; margin-top: 4px; }

/* === Floating Sparkles === */
.sparkle { position: fixed; pointer-events: none; z-index: 9999; }

/* === Fireworks === */
.firework-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-bar { padding: 0 12px; }
  .nav-link { padding: 6px 12px; font-size: 12px; }
  .nav-logo { font-size: 14px; }
  .countdown-grid { gap: 8px; }
  .countdown-item { min-width: 70px; padding: 14px 16px; }
  .countdown-num { font-size: 24px; }
  .admin-card { padding: 20px; }
  .anniversary-item { flex-direction: column; align-items: flex-start; }
  .masonry-grid { columns: 2; }
  .timeline::before { left: 20px; }
  .timeline-item { flex-direction: row !important; text-align: left !important; }
  .timeline-item:nth-child(odd) { flex-direction: row !important; text-align: left !important; }
  .timeline-dot { margin-left: 12px; }
}

@media (max-width: 480px) {
  .masonry-grid { columns: 1; }
  .gallery-grid { grid-template-columns: 1fr; }
}
