:root {
  --gold-primary: #d4af37;
  --gold-light: #f5e6a3;
  --gold-dark: #997819;
  --burgundy: #4a0e17;
  --maroon: #2c070c;
  --warm-bg: #120b0b;
  --warm-surface: #1e1315;
  --card-bg: rgba(36, 21, 24, 0.88);
  --diya-orange: #ff7700;
  --diya-amber: #ffaa00;
  --cream: #faf5eb;
  --text-muted: #d9c8b4;
  --border-gold: rgba(212, 175, 55, 0.35);
  --shadow-warm: 0 12px 40px rgba(0, 0, 0, 0.65);
  --font-serif: 'Playfair Display', 'Cinzel', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-festive: 'Cinzel Decorative', cursive, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--warm-bg);
  color: var(--cream);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
}

/* Background Atmospheric Canvas & Glows */
#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
}

.festive-bg-glow {
  position: fixed;
  top: -10vw;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 60vh;
  background: radial-gradient(ellipse at 50% 20%, rgba(212, 175, 55, 0.15), rgba(255, 120, 0, 0.08) 50%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}

/* App Header & Navigation Bar (Mobile-First) */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 11, 11, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-festive);
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Glass Buttons & Icon Controls */
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.btn-icon:active, .btn-icon:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: scale(1.05);
  border-color: var(--gold-light);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.audio-playing-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: #25d366;
  border-radius: 50%;
  box-shadow: 0 0 6px #25d366;
  animation: pulse-dot 1.4s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* View Mode Selector (Story vs Gallery) */
.view-tabs {
  display: flex;
  background: rgba(44, 25, 29, 0.6);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.view-tab-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-tab-btn.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #1a0f07;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Main Container */
.app-main {
  padding-top: 76px;
  padding-bottom: 84px; /* for bottom actions on mobile */
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

/* STORY / SWIPE VIEW (Mobile First Hero Carousel) */
.story-view-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mobile Story Card */
.story-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border-gold);
  overflow: hidden;
  box-shadow: var(--shadow-warm), 0 0 24px rgba(212, 175, 55, 0.15);
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.story-card-media {
  position: relative;
  width: 100%;
  background: #170d10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  border-bottom: 1px solid var(--border-gold);
  padding: 0;
  margin: 0;
}

.story-card-img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.story-card-img:active {
  transform: scale(1.02);
}

/* Golden Arch Overlay & Diya Accents */
.media-diya-glow {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(255, 170, 0, 0.4), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  animation: diya-flicker 2.5s infinite ease-in-out;
}

@keyframes diya-flicker {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  35% { opacity: 0.95; transform: translateX(-50%) scale(1.1); }
  65% { opacity: 0.6; transform: translateX(-50%) scale(0.92); }
}

/* Story Card Indicators placed non-obtrusively */
.story-page-indicator {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(18, 11, 11, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 700;
  z-index: 2;
}

/* Story Card Content Section */
.story-card-body {
  padding: 16px 18px 20px;
  background: linear-gradient(180deg, rgba(32, 17, 21, 0.95), rgba(18, 11, 11, 0.98));
}

.story-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.story-title {
  font-family: var(--font-festive);
  font-size: 1.6rem;
  color: var(--gold-light);
  letter-spacing: 1px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.story-tagline {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-primary);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.4;
}

.story-emotion {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 3px solid var(--gold-primary);
}

/* Items List in Hamper */
.hamper-items-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hamper-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.hamper-items-list li {
  font-size: 0.82rem;
  color: var(--cream);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.hamper-items-list li::before {
  content: '✦';
  color: var(--gold-primary);
  font-size: 0.8rem;
  margin-top: 1px;
}

/* Action Buttons */
.story-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-festive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  text-align: center;
}

.btn-primary-gold {
  background: linear-gradient(135deg, #f5e6a3 0%, #d4af37 50%, #aa8012 100%);
  color: #1a0f07;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.btn-primary-gold:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.2);
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:active {
  transform: translateY(1px) scale(0.98);
}

.btn-secondary-outline {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
}

.btn-secondary-outline:active {
  background: rgba(212, 175, 55, 0.18);
}

/* Story Carousel Navigation Arrows */
.carousel-nav-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
}

.nav-page-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(36, 21, 24, 0.8);
  border: 1px solid var(--border-gold);
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* THUMBNAILS TRAY */
.thumbs-strip {
  width: 100%;
  overflow-x: auto;
  display: flex;
  gap: 8px;
  padding: 12px 2px;
  margin-top: 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.thumb-item {
  flex: 0 0 54px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  position: relative;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item.active {
  opacity: 1;
  border-color: var(--gold-light);
  transform: scale(1.06);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* GALLERY / GRID VIEW */
.gallery-view-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.gallery-card {
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-warm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
}

.gallery-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  overflow: hidden;
}

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

.gallery-card:hover .gallery-card-img-wrap img {
  transform: scale(1.04);
}

.gallery-card-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gallery-card-title {
  font-family: var(--font-festive);
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.gallery-card-tagline {
  font-size: 0.8rem;
  color: var(--gold-primary);
  font-style: italic;
  margin-bottom: 12px;
  flex: 1;
}

/* INTERACTIVE MEMORY CARD CREATOR MODAL / SECTION */
.memory-creator-box {
  background: rgba(28, 16, 20, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.memory-creator-title {
  font-family: var(--font-festive);
  color: var(--gold-light);
  font-size: 1.25rem;
  margin-bottom: 8px;
  text-align: center;
}

.memory-input-group {
  margin-bottom: 14px;
}

.memory-input-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--gold-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.memory-input, .memory-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(14, 8, 10, 0.85);
  color: var(--cream);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.memory-input:focus, .memory-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

/* Preview Canvas for Memory Card */
.memory-card-preview {
  width: 100%;
  background: linear-gradient(135deg, #2b1117 0%, #15090b 100%);
  border: 2px solid var(--gold-primary);
  border-radius: 14px;
  padding: 24px 20px;
  margin: 16px 0;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.preview-diya-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  animation: diya-flicker 2s infinite ease-in-out;
}

.preview-recipient {
  font-family: var(--font-festive);
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.preview-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 12px;
}

.preview-sender {
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--gold-primary);
  text-transform: uppercase;
}

/* MOBILE BOTTOM BAR (Always reachable CTA) */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: rgba(18, 11, 11, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-gold);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  gap: 8px;
}

.bottom-cta-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

/* Fullscreen Lightbox for Zoomed Images */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

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

.lightbox-img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Toast Notification */
.festive-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: linear-gradient(135deg, var(--burgundy), #1a0f07);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.festive-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Sparkler cursor trail effect */
.sparkler-particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 1000;
  mix-blend-mode: screen;
}

/* Responsive tweaks for tablets / desktops */
@media (min-width: 768px) {
  .story-view-container {
    max-width: 620px;
  }
  
  .story-card-body {
    padding: 22px 26px 26px;
  }
  
  .story-title {
    font-size: 2rem;
  }
}
