:root {
  --primary: #8B1A1A;
  --primary-dark: #6b1010;
  --primary-light: #a52525;
  --accent: #c9a84c;
  --accent-soft: rgba(201, 168, 76, 0.15);
  --green: #2d4a2d;
  --green-dark: #1e331e;
  --text: #f0e8dc;
  --text-light: #d4c8b4;
  --text-muted: #a89880;
  --bg: #141210;
  --bg-card: #1e1b16;
  --bg-card-hover: #262218;
  --secondary: #1a1510;
  --border: #3a3428;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --font-display: 'Playfair Display', serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Lato', sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* ============================================
   NAVIGATION
   ============================================ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  background: rgba(20, 18, 16, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 400;
  transition: color 0.3s, border-color 0.3s;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 500px;
  margin-top: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero picture {
  position: absolute;
  inset: 0;
}

.hero picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 18, 16, 0.3) 0%,
    rgba(20, 18, 16, 0.45) 40%,
    rgba(20, 18, 16, 0.65) 70%,
    rgba(20, 18, 16, 0.8) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  padding: 2rem;
}

.hero-subtitle {
  font-size: 0.85rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 400;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.5);
}

.hero-title {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.1;
  margin: 0.5rem 0 1.5rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 30px rgba(0,0,0,0.4);
}

.hero-name {
  display: block;
  font-size: 4.5rem;
}

.hero-amp {
  display: block;
  font-size: 2.5rem;
  opacity: 0.6;
  margin: 0.2rem 0;
}

.hero-date {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 15px rgba(0,0,0,0.4);
}

.hero-venue {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 15px rgba(0,0,0,0.4);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--accent);
  margin: 0.8rem auto 0;
}

/* ---- Countdown ---- */
.countdown-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.countdown-item { text-align: center; }

.countdown-item span {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
}

.countdown-item label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: block;
}

/* ---- Story ---- */
.story-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.story-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.story-text {
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---- Photo Grid ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.photo-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.3s;
  cursor: pointer;
}

.photo-grid img:hover { transform: scale(1.03); }

/* ---- Venue ---- */
.venue-section { text-align: center; }

.venue-card {
  max-width: 650px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.venue-card > img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.venue-info { padding: 1.5rem 2rem; }
.venue-info h3 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.venue-info p { color: var(--text-light); }
.venue-date { color: var(--accent) !important; font-weight: 600; margin-top: 0.4rem; }

/* ---- CTA ---- */
.cta-section { text-align: center; }
.cta-section p { color: var(--text-light); font-size: 1.05rem; margin-bottom: 0.5rem; }
.rsvp-deadline-text { color: var(--text-muted); margin-bottom: 1.5rem; }

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.footer p { margin: 0.3rem 0; color: var(--text-muted); }
.footer p:first-child {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--accent);
}

/* ============================================
   PAGES
   ============================================ */
.page { display: none; padding-top: 52px; }
.page.active { display: block; }

.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.page-container h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select,
.search-input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus, .search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: #e74c3c;
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.9rem;
}

.radio-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.3rem; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400;
  color: var(--text-light);
}

.radio-label input[type="radio"] { accent-color: var(--accent); }

.divider {
  text-align: center;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-danger {
  background: transparent;
  color: #e74c3c;
  border-color: #e74c3c;
}

.btn-danger:hover {
  background: #e74c3c;
  color: #fff;
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

/* Touch/click feedback */
.btn:active {
  transform: scale(0.96);
  transition: transform 0.1s;
}

@media (hover: none) {
  .btn {
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
  }
  .btn:active {
    transform: scale(0.94);
    opacity: 0.85;
  }
  .btn-primary:active {
    background: var(--primary-dark);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
  }
  .btn-outline:active {
    background: var(--accent-soft);
  }
  .tab:active {
    transform: scale(0.97);
    transition: transform 0.1s;
  }
  .nav-menu a:active {
    transform: scale(0.96);
    opacity: 0.7;
    transition: all 0.1s;
  }
  .gallery-item:active {
    transform: scale(0.97);
    transition: transform 0.15s;
  }
  .card {
    transition: transform 0.15s;
  }
  .card:active {
    transform: scale(0.99);
  }
  .menu-select-option:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
  .upload-area:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.tab:hover { color: var(--text-light); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ---- Lightbox ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  transition: color 0.3s;
}

.lightbox-prev:hover, .lightbox-next:hover { color: #fff; }
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

.lightbox-caption {
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ============================================
   UPLOAD
   ============================================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  color: var(--text-muted);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.photo-previews {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.photo-previews img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

/* ============================================
   MENU DISPLAY
   ============================================ */
.menu-course {
  margin-bottom: 2rem;
}

.menu-course h3 {
  font-family: var(--font-display);
  color: var(--accent);
  text-transform: capitalize;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.menu-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.menu-item:last-child { border-bottom: none; }
.menu-item h4 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.2rem; }
.menu-item p { color: var(--text-muted); font-size: 0.9rem; }

.menu-badges { margin-top: 0.3rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.3rem;
}

.badge-veg { background: var(--green-dark); color: #81c784; }
.badge-vegan { background: #1b3d1b; color: #a5d6a7; }
.badge-gf { background: #3d2d1b; color: #ffb74d; }

/* ---- Menu Selection ---- */
.menu-select-course { margin-bottom: 1.5rem; }
.menu-select-course h4 {
  font-family: var(--font-display);
  color: var(--accent);
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

.menu-select-option {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.menu-select-option:hover { border-color: var(--text-muted); }
.menu-select-option.selected { border-color: var(--accent); background: var(--accent-soft); }

.menu-select-option input[type="radio"] {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.menu-select-info strong { display: block; font-size: 0.95rem; }
.menu-select-info p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.toast-success { background: var(--green); }
.toast-error { background: #c62828; }
.toast-info { background: #37474f; }

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2500;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 550px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-family: var(--font-display); font-size: 1.1rem; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 1.5rem; }

/* ---- QR Code Display ---- */
.qr-display { text-align: center; }
.qr-display img { max-width: 250px; margin: 0 auto 1rem; display: block; }
.qr-url {
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .topnav { padding: 0.7rem 1rem; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  .nav-menu.open { display: flex; }

  .nav-menu a {
    padding: 0.8rem 1.5rem;
    border-bottom: none;
  }

  .nav-menu a:hover,
  .nav-menu a.active { border-bottom: none; }

  .nav-toggle { display: block; }

  .hero { height: 85vh; min-height: 400px; }
  .hero-name { font-size: 3rem; }
  .hero-amp { font-size: 1.8rem; }

  .section { padding: 3rem 1.2rem; }
  .section-title { font-size: 1.6rem; }

  .story-content { grid-template-columns: 1fr; gap: 1.5rem; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid img { height: 180px; }

  .venue-card > img { height: 200px; }

  .countdown { gap: 1.5rem; }
  .countdown-item span { font-size: 2.2rem; }

  .form-row { grid-template-columns: 1fr; }

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

  .modal { max-width: 95vw; }

  .toast-container { right: 1rem; left: 1rem; }
  .toast { width: 100%; }

  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 200px; }
}

@media (max-width: 480px) {
  .hero { height: 75vh; }
  .hero-name { font-size: 2.5rem; }
  .hero-amp { font-size: 1.5rem; }
  .hero-date { font-size: 1rem; }

  .photo-grid { grid-template-columns: 1fr; }
  .photo-grid img { height: 220px; }

  .countdown-item span { font-size: 1.8rem; }
}
