/* ==========================================================================
   DIWALI LUXURY FESTIVE THEME - diwali.tanish.digital
   Designed with deep obsidian glassmorphism, warm amber ambient glows,
   and mobile-first responsive typography.
   ========================================================================== */

:root {
  --bg-primary: #08070b;
  --bg-secondary: #0f0c16;
  --card-bg: rgba(18, 14, 26, 0.76);
  --card-border: rgba(245, 158, 11, 0.22);
  --card-border-hover: rgba(251, 191, 36, 0.45);
  
  --gold-primary: #f59e0b;
  --gold-light: #fde68a;
  --gold-warm: #fbbf24;
  --gold-deep: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.25);
  
  --text-main: #f9fafb;
  --text-muted: #d1d5db;
  --text-subtle: #9ca3af;
  --text-gold: #fde047;
  
  --diya-glow: rgba(251, 146, 60, 0.45);
  --radius-card: 24px;
  --radius-sm: 12px;
  --radius-pill: 9999px;
  
  --font-serif: "Cinzel", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-script: "Great Vibes", "Brush Script MT", cursive;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Atmosphere */
body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(245, 158, 11, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(217, 119, 6, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(180, 83, 9, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #09070d 0%, #0c0914 50%, #06050a 100%);
  background-attachment: fixed;
}

/* Interactive Canvas for Embers and Floating Stardust */
#stardust-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Subtle Rangoli / Mandala Ambient Watermark */
.ambient-mandala {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: min(85vw, 680px);
  height: min(85vw, 680px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23f59e0b' stop-opacity='0.16'/%3E%3Cstop offset='100%25' stop-color='%23fbbf24' stop-opacity='0.02'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='100' cy='100' r='90' fill='none' stroke='url(%23g)' stroke-width='0.8' stroke-dasharray='3 3'/%3E%3Ccircle cx='100' cy='100' r='75' fill='none' stroke='url(%23g)' stroke-width='0.6'/%3E%3Ccircle cx='100' cy='100' r='55' fill='none' stroke='url(%23g)' stroke-width='0.7' stroke-dasharray='5 2'/%3E%3Ccircle cx='100' cy='100' r='35' fill='none' stroke='url(%23g)' stroke-width='0.8'/%3E%3Cpath d='M100 10 L100 190 M10 100 L190 100 M36 36 L164 164 M36 164 L164 36' stroke='url(%23g)' stroke-width='0.4'/%3E%3Cpolygon points='100,20 120,60 180,60 130,95 150,150 100,115 50,150 70,95 20,60 80,60' fill='none' stroke='url(%23g)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.65;
  pointer-events: none;
  z-index: 2;
  animation: slowSpin 140s linear infinite;
}

@keyframes slowSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Audio & Settings Floating Bar */
.floating-header {
  position: fixed;
  top: 18px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  z-index: 30;
  pointer-events: none;
}

.brand-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 14, 26, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold-light);
  text-decoration: none;
  transition: all 0.25s ease;
}

.brand-badge:hover {
  border-color: var(--gold-warm);
  background: rgba(28, 20, 38, 0.85);
  box-shadow: 0 0 16px var(--gold-glow);
}

.brand-badge .sparkle {
  color: var(--gold-warm);
  font-size: 0.95rem;
}

.audio-toggle-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 14, 26, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.audio-toggle-btn:hover {
  background: rgba(30, 23, 40, 0.9);
  border-color: var(--gold-warm);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.audio-toggle-btn.playing {
  border-color: var(--gold-warm);
  color: var(--gold-light);
  background: rgba(38, 26, 48, 0.9);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.audio-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

/* Main Container */
.page-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 760px;
  padding: 85px 20px 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Master Greeting Card */
.festive-card {
  position: relative;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 44px 38px 48px 38px;
  box-shadow: 
    0 24px 60px -15px rgba(0, 0, 0, 0.75),
    0 0 45px -10px rgba(245, 158, 11, 0.15),
    inset 0 1px 1px 0 rgba(254, 240, 138, 0.2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.festive-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 
    0 28px 70px -15px rgba(0, 0, 0, 0.8),
    0 0 60px -8px rgba(245, 158, 11, 0.22),
    inset 0 1px 1px 0 rgba(254, 240, 138, 0.3);
}

/* Card Inner Watermark Accents */
.card-corner-accent {
  position: absolute;
  width: 70px;
  height: 70px;
  pointer-events: none;
  opacity: 0.3;
}

.corner-tl {
  top: 10px;
  left: 10px;
  border-top: 1px solid var(--gold-warm);
  border-left: 1px solid var(--gold-warm);
  border-top-left-radius: 16px;
}

.corner-tr {
  top: 10px;
  right: 10px;
  border-top: 1px solid var(--gold-warm);
  border-right: 1px solid var(--gold-warm);
  border-top-right-radius: 16px;
}

.corner-bl {
  bottom: 10px;
  left: 10px;
  border-bottom: 1px solid var(--gold-warm);
  border-left: 1px solid var(--gold-warm);
  border-bottom-left-radius: 16px;
}

.corner-br {
  bottom: 10px;
  right: 10px;
  border-bottom: 1px solid var(--gold-warm);
  border-right: 1px solid var(--gold-warm);
  border-bottom-right-radius: 16px;
}

/* Hero Diya Section */
.diya-hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.interactive-diya {
  position: relative;
  cursor: pointer;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.interactive-diya:hover {
  transform: scale(1.08);
}

.interactive-diya:active {
  transform: scale(0.96);
}

/* Diya Ambient Glow */
.diya-halo {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.45) 0%, rgba(245, 158, 11, 0.15) 45%, transparent 70%);
  animation: breatheGlow 3.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes breatheGlow {
  0% { transform: scale(0.92); opacity: 0.65; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.6)); }
}

.diya-svg {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* Animated Flame */
.flame-path {
  transform-origin: 50% 85%;
  animation: flicker 1.8s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: rotate(-2deg) scale(0.98); }
  25% { transform: rotate(2deg) scale(1.03); }
  50% { transform: rotate(-1.5deg) scale(0.99); }
  75% { transform: rotate(1.8deg) scale(1.04); }
  100% { transform: rotate(0deg) scale(1); }
}

.diya-caption {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gold-light);
  opacity: 0.8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.interactive-diya:hover + .diya-caption {
  opacity: 1;
  color: var(--gold-warm);
}

/* Recipient Pill Badge */
.recipient-badge-wrapper {
  text-align: center;
  margin-bottom: 20px;
}

/* Shared Festive Memory Photo Frame */
.shared-memory-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 18px auto 26px auto;
  border-radius: 20px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.45) 0%, rgba(217, 119, 6, 0.15) 50%, rgba(245, 158, 11, 0.4) 100%);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.75), 0 0 35px -5px rgba(245, 158, 11, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.shared-memory-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.85), 0 0 45px 0 rgba(245, 158, 11, 0.4);
}

.memory-photo-container {
  position: relative;
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  background: #110e19;
}

.memory-photo {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

.memory-photo-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  text-align: center;
}

.recipient-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: var(--gold-light);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

/* Headings */
.card-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.8vw, 2.85rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.22;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #ffffff 15%, #fde68a 55%, #fbbf24 85%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(245, 158, 11, 0.22));
}

.card-subtitle {
  text-align: center;
  font-size: clamp(0.95rem, 2.2vw, 1.08rem);
  color: var(--gold-light);
  opacity: 0.9;
  max-width: 580px;
  margin: 0 auto 32px auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Golden Divider */
.festive-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 34px auto;
  max-width: 380px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
}

.divider-ornament {
  color: var(--gold-warm);
  font-size: 1.1rem;
}

/* Heartfelt Letter Content */
.letter-body {
  position: relative;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.08rem);
  line-height: 1.82;
  margin-bottom: 40px;
  padding: 0 4px;
}

.letter-body p {
  margin-bottom: 20px;
}

.letter-body p:last-child {
  margin-bottom: 0;
}

.letter-highlight {
  color: var(--text-main);
  font-weight: 500;
}

.festive-callout {
  margin: 26px 0;
  padding: 18px 24px;
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid var(--gold-warm);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--gold-light);
  line-height: 1.7;
}

/* Sender & Personal Signature Section */
.signature-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(245, 158, 11, 0.16);
  margin-top: 16px;
}

.sender-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-halo-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.avatar-glow {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-warm), #b45309);
  opacity: 0.75;
  filter: blur(4px);
  animation: rotateBorder 8s linear infinite;
}

@keyframes rotateBorder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sender-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  background: #1a1622;
  z-index: 2;
}

.sender-details {
  display: flex;
  flex-direction: column;
}

.sender-salutation {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-warm);
  font-weight: 600;
  margin-bottom: 2px;
}

.sender-name {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.sender-origin {
  font-size: 0.82rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sender-origin-flag {
  font-size: 0.9rem;
}

/* Action Buttons Bar */
.action-buttons-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.action-btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b090f;
  border: 1px solid rgba(253, 230, 138, 0.4);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}

.action-btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
  color: #06050a;
}

.action-btn-secondary {
  background: rgba(28, 22, 38, 0.85);
  color: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(10px);
}

.action-btn-secondary:hover {
  background: rgba(38, 29, 52, 0.95);
  border-color: var(--gold-warm);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}

/* Toast Notification for Link Copying */
.toast-notice {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: rgba(20, 16, 30, 0.92);
  border: 1px solid var(--gold-warm);
  color: var(--gold-light);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

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

/* Footer Section */
.page-footer {
  margin-top: 36px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-nav-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav-links a {
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav-links a:hover {
  color: var(--gold-warm);
}

.footer-copy {
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 70px 14px 40px 14px;
  }
  
  .festive-card {
    padding: 32px 20px 36px 20px;
    border-radius: 20px;
  }
  
  .card-title {
    font-size: 1.85rem;
  }
  
  .card-subtitle {
    font-size: 0.92rem;
    margin-bottom: 24px;
  }
  
  .signature-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .action-buttons-bar {
    width: 100%;
  }
  
  .action-btn {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 0.82rem;
  }
  
  .floating-header {
    padding: 0 14px;
    top: 14px;
  }
}
