:root {
  --midnight: #0A0A0A;
  --blood-rose: #8B0000;
  --celestial-gold: #C9A227;
  --moonlight: #E6E6FA;
  --ash: #B0B0B0;
  --ivory: #FFFBF7;
  --shadow: rgba(10,10,10,0.08);
  --shadow-lg: rgba(10,10,10,0.12);
  --glow-gold: rgba(201,162,39,0.15);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--midnight);
  background: linear-gradient(180deg, #FFFBF7 0%, #F8F5F0 100%);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
.font-display {
  font-family: 'Cinzel Decorative', serif;
}

.font-heading {
  font-family: 'Cinzel', serif;
}

.font-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.font-ui {
  font-family: 'Josefin Sans', system-ui, sans-serif;
}

.text-midnight { color: var(--midnight); }
.text-rose { color: var(--blood-rose); }
.text-gold { color: var(--celestial-gold); }
.text-ash { color: var(--ash); }
.text-ivory { color: var(--ivory); }

.bg-ivory { background-color: var(--ivory); }
.bg-moonlight { background-color: var(--moonlight); }
.bg-rose { background-color: var(--blood-rose); }
.bg-gold { background-color: var(--celestial-gold); }

/* Spacing System */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.p-xl { padding: 32px; }

/* Layout */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

main {
  padding-bottom: 80px;
  min-height: 100vh;
}

/* Decorative Elements */
.filigree-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.filigree-divider::before,
.filigree-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--celestial-gold), transparent);
}

.filigree-divider .ornament {
  color: var(--celestial-gold);
  font-size: 14px;
}

/* Action Cards */
.action-card {
  background: #FFFFFF;
  border: 1px solid rgba(176,176,176,0.3);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  transition: border-color 0.2s ease;
}

.action-card:hover::before {
  border-color: var(--celestial-gold);
}

.action-card:active {
  transform: scale(0.98);
  box-shadow: 0 0 12px var(--glow-gold);
}

.action-card .card-icon {
  width: 32px;
  height: 32px;
  color: var(--blood-rose);
  margin-bottom: 8px;
}

.action-card .card-title {
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--midnight);
}

.action-card .card-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--ash);
  margin-top: 4px;
}

/* Photo Cards */
.photo-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px var(--shadow);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  border-left: 2px solid var(--celestial-gold);
  border-top: 2px solid var(--celestial-gold);
  border-radius: 2px 0 0 0;
  pointer-events: none;
  z-index: 2;
}

.photo-card::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--celestial-gold);
  border-top: 2px solid var(--celestial-gold);
  border-radius: 0 2px 0 0;
  pointer-events: none;
  z-index: 2;
}

.photo-card .bottom-left-corner,
.photo-card .bottom-right-corner {
  position: absolute;
  bottom: 8px;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 2;
}

.photo-card .bottom-left-corner {
  left: 8px;
  border-left: 2px solid var(--celestial-gold);
  border-bottom: 2px solid var(--celestial-gold);
  border-radius: 0 0 0 2px;
}

.photo-card .bottom-right-corner {
  right: 8px;
  border-right: 2px solid var(--celestial-gold);
  border-bottom: 2px solid var(--celestial-gold);
  border-radius: 0 0 2px 0;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-card .caption {
  padding: 12px;
  font-size: 14px;
  color: var(--midnight);
  font-family: 'Cormorant Garamond', serif;
}

.photo-card .meta {
  padding: 0 12px 12px;
  font-size: 12px;
  color: var(--ash);
  font-family: 'Josefin Sans', system-ui, sans-serif;
}

/* Tab Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255,251,247,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(176,176,176,0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ash);
  font-size: 12px;
  font-family: 'Josefin Sans', system-ui, sans-serif;
  text-decoration: none;
  padding: 8px 16px;
  transition: color 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;
}

.tab-item.active {
  color: var(--blood-rose);
}

.tab-item .tab-icon {
  width: 28px;
  height: 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--blood-rose);
  color: var(--ivory);
}

.btn-primary:hover {
  box-shadow: 0 0 12px rgba(139,0,0,0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--blood-rose);
  border: 1px solid var(--blood-rose);
}

.btn-secondary:hover {
  background: rgba(139,0,0,0.05);
}

.btn-gold {
  background: var(--celestial-gold);
  color: var(--midnight);
}

.btn-gold:hover {
  box-shadow: 0 0 12px var(--glow-gold);
}

.btn-full {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ash);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(176,176,176,0.4);
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--midnight);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--celestial-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}

.form-input::placeholder {
  color: var(--ash);
  font-style: italic;
}

.form-error {
  font-size: 14px;
  color: var(--blood-rose);
  margin-top: 6px;
  font-family: 'Josefin Sans', system-ui, sans-serif;
}

textarea.form-input {
  height: auto;
  min-height: 100px;
  padding: 12px 16px;
  resize: vertical;
}

/* Cards */
.card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  border: 1px solid rgba(176,176,176,0.2);
}

.card-moonlight {
  background: var(--moonlight);
}

/* Comment Bubbles */
.comment-bubble {
  background: #FFFFFF;
  border: 1px solid rgba(176,176,176,0.3);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(10,10,10,0.04);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-author {
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--midnight);
  font-weight: 500;
}

.comment-time {
  font-size: 12px;
  color: var(--ash);
}

.comment-text {
  font-size: 16px;
  font-family: 'Cormorant Garamond', serif;
  color: var(--midnight);
  line-height: 1.5;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 4px;
  align-items: center;
}

.star {
  width: 28px;
  height: 28px;
  color: var(--ash);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.star:hover {
  transform: scale(1.1);
}

.star.filled {
  color: var(--celestial-gold);
  filter: drop-shadow(0 0 4px rgba(201,162,39,0.3));
}

.star-rating-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ash);
  margin-left: 8px;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 32px 0;
  text-align: center;
}

.hero-image {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 24px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(10,10,10,0.3);
  border-radius: 16px;
  pointer-events: none;
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 28px;
  color: var(--midnight);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero-names {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--blood-rose);
  margin-bottom: 8px;
}

.hero-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--ash);
}

/* QR Code Section */
.qr-section {
  text-align: center;
  padding: 24px;
}

.qr-label {
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ash);
  margin-bottom: 12px;
}

.qr-code {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  padding: 12px;
  background: #FFFFFF;
  border: 2px solid var(--celestial-gold);
  border-radius: 12px;
}

.qr-code img {
  width: 100%;
  height: auto;
}

/* Animations */
@keyframes sparkle {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

.sparkle {
  animation: sparkle 1.5s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

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

.slide-up {
  animation: slideUp 0.4s ease;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-content {
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.flash-messages {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3000;
}

.flash-messages .flash {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 14px;
  animation: slideUp 0.3s ease;
}

.flash-success {
  background: rgba(91,138,94,0.1);
  border: 1px solid rgba(91,138,94,0.3);
  color: #5B8A5E;
}

.flash-error {
  background: rgba(196,75,75,0.1);
  border: 1px solid rgba(196,75,75,0.3);
  color: #C44B4B;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }

.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }

.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Safe Area Support */
@supports (padding: max(0px)) {
  .tab-bar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  
  main {
    padding-bottom: max(64px, calc(64px + env(safe-area-inset-bottom)));
  }
}
