/**
 * ==========================================================================
 * ROYAL WEDDING INVITATION - CORE STYLES & THEME
 * Palette: Royal Gold, Ivory, Deep Maroon
 * ==========================================================================
 */

:root {
  /* Royal Color Palette (Light Theme / Ivory & Royal Gold) */
  --color-maroon-deep: #3A0A10;
  --color-maroon: #5C101D;
  --color-maroon-rich: #781729;
  --color-maroon-light: #942236;
  --color-maroon-subtle: #FAF1F2;

  --color-gold-deep: #9A7410;
  --color-gold: #C99A2C;
  --color-gold-rich: #DDAE3B;
  --color-gold-light: #F7E5A9;
  --color-gold-shimmer: #FFF6D6;
  
  --color-ivory-dark: #EFE8DA;
  --color-ivory: #F8F4EB;
  --color-ivory-light: #FDFCF8;
  --color-cream: #FAF7F0;

  --color-text-primary: #2B050B;
  --color-text-secondary: #5C4549;
  --color-text-muted: #876E73;
  --color-text-gold: #B3861B;
  --color-text-light: #FDFCF8;

  --bg-primary: #FAF7F0;
  --bg-secondary: #F4EFE3;
  --bg-card: rgba(253, 252, 248, 0.85);
  --bg-card-solid: #FDFCF8;
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-maroon: rgba(92, 16, 29, 0.85);

  --border-gold: rgba(201, 154, 44, 0.35);
  --border-gold-solid: #C99A2C;
  --border-gold-rich: rgba(221, 174, 59, 0.6);
  --border-card: rgba(201, 154, 44, 0.25);

  --shadow-sm: 0 4px 12px rgba(58, 10, 16, 0.06);
  --shadow-md: 0 8px 24px rgba(58, 10, 16, 0.1);
  --shadow-lg: 0 16px 40px rgba(58, 10, 16, 0.15);
  --shadow-gold: 0 0 25px rgba(221, 174, 59, 0.35);
  --shadow-maroon: 0 10px 30px rgba(92, 16, 29, 0.3);

  /* Typography */
  --font-serif-display: 'Cinzel Decorative', 'Playfair Display', Georgia, serif;
  --font-serif-text: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Alex Brush', 'Great Vibes', cursive;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;
  --font-sans: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Dimensions & Spacing */
  --container-max-width: 1140px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --radius-arch: 180px 180px 16px 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif-text);
  background-color: var(--bg-primary);
  color: var(--color-text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  background-image: 
    radial-gradient(var(--border-gold) 1px, transparent 1px),
    radial-gradient(rgba(201, 154, 44, 0.08) 1px, transparent 1px);
  background-size: 40px 40px, 20px 20px;
  background-position: 0 0, 20px 20px;
  min-height: 100vh;
  min-height: 100dvh;
}

html.video-locked,
body.video-locked {
  overflow: hidden !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif-display);
  font-weight: 700;
  color: var(--color-maroon);
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-gold-deep);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover, a:focus {
  color: var(--color-gold-rich);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* Selection */
::selection {
  background-color: var(--color-gold-rich);
  color: var(--color-maroon-deep);
}

/* ==========================================================================
   CONTAINER & SECTION LAYOUT
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: max(3.5rem, calc(2.5rem + env(safe-area-inset-top))) 1rem max(3.5rem, calc(2.5rem + env(safe-area-inset-bottom))) 1rem;
}

@media (min-width: 768px) {
  .section {
    padding: max(5rem, calc(3.5rem + env(safe-area-inset-top))) 2rem max(5rem, calc(3.5rem + env(safe-area-inset-bottom))) 2rem;
  }
}

/* Section Header Styles */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.25rem auto;
  position: relative;
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: 3.5rem;
  }
}

.section-subtitle {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--color-gold-rich);
  margin-bottom: 0.25rem;
  display: block;
}

.section-title {
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-maroon);
  position: relative;
  padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.6rem;
    letter-spacing: 2px;
    padding-bottom: 1rem;
  }
}

.section-title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0.5rem auto 0 auto;
}

.section-title-divider .line {
  height: 1.5px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--color-gold-rich), transparent);
}

.section-title-divider .ornament {
  color: var(--color-gold-rich);
  font-size: 1.2rem;
  display: inline-block;
  animation: pulse-gold 3s ease-in-out infinite;
}

.section-description {
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  color: var(--color-text-secondary);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ==========================================================================
   ROYAL GOLD CARD & FRAMING
   ========================================================================== */
.royal-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.1rem;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

@media (min-width: 640px) {
  .royal-card {
    padding: 2rem;
  }
}

.royal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border-color: var(--border-gold-rich);
}

.royal-card-arch {
  border-radius: var(--radius-arch);
  padding-top: 2.8rem;
}

@media (min-width: 640px) {
  .royal-card-arch {
    padding-top: 3.5rem;
  }
}

/* Islamic Mihrab & Filigree Corner Ornaments */
.ornate-corner-tl,
.ornate-corner-tr,
.ornate-corner-bl,
.ornate-corner-br {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  opacity: 0.75;
}

.ornate-corner-tl {
  top: 12px;
  left: 12px;
  border-top: 2px solid var(--color-gold-rich);
  border-left: 2px solid var(--color-gold-rich);
}

.ornate-corner-tr {
  top: 12px;
  right: 12px;
  border-top: 2px solid var(--color-gold-rich);
  border-right: 2px solid var(--color-gold-rich);
}

.ornate-corner-bl {
  bottom: 12px;
  left: 12px;
  border-bottom: 2px solid var(--color-gold-rich);
  border-left: 2px solid var(--color-gold-rich);
}

.ornate-corner-br {
  bottom: 12px;
  right: 12px;
  border-bottom: 2px solid var(--color-gold-rich);
  border-right: 2px solid var(--color-gold-rich);
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn-royal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.9rem 2.2rem;
  font-family: var(--font-serif-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-maroon-deep);
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-rich), var(--color-gold-deep));
  border: 1px solid var(--color-gold-shimmer);
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(201, 154, 44, 0.35);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  z-index: 1;
}

.btn-royal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.7s ease;
  z-index: -1;
}

.btn-royal:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(201, 154, 44, 0.5), 0 0 15px rgba(255, 223, 115, 0.5);
  color: var(--color-maroon-deep);
}

.btn-royal:hover::before {
  left: 100%;
}

.btn-royal:active {
  transform: translateY(1px);
}

.btn-royal-outline {
  background: transparent;
  color: var(--color-gold-rich);
  border: 1.5px solid var(--color-gold-rich);
  box-shadow: none;
}

.btn-royal-outline:hover {
  background: var(--color-gold-rich);
  color: var(--color-maroon-deep);
  box-shadow: 0 6px 20px rgba(201, 154, 44, 0.35);
}

.btn-maroon {
  background: linear-gradient(135deg, var(--color-maroon-light), var(--color-maroon), var(--color-maroon-deep));
  color: var(--color-gold-light);
  border: 1px solid var(--border-gold);
  box-shadow: 0 6px 20px rgba(92, 16, 29, 0.35);
}

.btn-maroon:hover {
  color: var(--color-gold-shimmer);
  box-shadow: 0 10px 28px rgba(92, 16, 29, 0.5), 0 0 15px rgba(201, 154, 44, 0.3);
}

/* ==========================================================================
   FLOATING ACTION BUTTONS (Audio, Back-to-Top)
   ========================================================================== */
.floating-controls {
  position: fixed;
  bottom: max(18px, calc(18px + env(safe-area-inset-bottom)));
  right: max(18px, calc(18px + env(safe-area-inset-right)));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-card-solid);
  border: 1.5px solid var(--border-gold-rich);
  color: var(--color-gold-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md), 0 0 15px rgba(201, 154, 44, 0.2);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.floating-btn:hover {
  transform: scale(1.1);
  color: var(--color-maroon-deep);
  background: var(--color-gold-rich);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(201, 154, 44, 0.5);
}

.floating-btn svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
}

/* Equalizer Bars Animation for Audio Button */
.audio-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 18px;
}

.audio-equalizer span {
  width: 3px;
  background-color: currentColor;
  border-radius: 1.5px;
  transition: height var(--transition-fast);
}

.audio-playing .audio-equalizer span:nth-child(1) {
  animation: eq-bar 0.8s ease-in-out infinite alternate;
}

.audio-playing .audio-equalizer span:nth-child(2) {
  animation: eq-bar 1.1s ease-in-out infinite alternate 0.2s;
}

.audio-playing .audio-equalizer span:nth-child(3) {
  animation: eq-bar 0.7s ease-in-out infinite alternate 0.4s;
}

.audio-playing .audio-equalizer span:nth-child(4) {
  animation: eq-bar 0.9s ease-in-out infinite alternate 0.1s;
}

.audio-muted .audio-equalizer span {
  height: 3px !important;
  animation: none !important;
}

@keyframes eq-bar {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* Back to top scroll indicator ring */
#backToTopBtn {
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all var(--transition-normal);
}

#backToTopBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-progress-ring {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 52px;
  height: 52px;
  pointer-events: none;
  transform: rotate(-90deg);
}

.scroll-progress-ring circle {
  fill: none;
  stroke: var(--color-gold-rich);
  stroke-width: 2.5;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.1s ease;
}

/* ==========================================================================
   CANVAS OVERLAYS (Petals & Fireworks)
   ========================================================================== */
#petalsCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  transition: opacity 1.5s ease;
}

#fireworksCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

/* ==========================================================================
   TOAST NOTIFICATION MODAL
   ========================================================================== */
.toast-container {
  position: fixed;
  top: max(20px, calc(16px + env(safe-area-inset-top)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast-msg {
  background: var(--bg-glass-maroon);
  backdrop-filter: blur(12px);
  color: var(--color-gold-light);
  border: 1px solid var(--color-gold-rich);
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(201, 154, 44, 0.3);
  font-family: var(--font-serif-text);
  font-size: 0.95rem;
  text-align: center;
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-msg.hide {
  animation: toast-out 0.3s forwards ease-in;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

