/* ==========================================================================
   NEURAL EXPRESSIVE INVITE SYSTEM - STYLES
   Designed for Trang Si Thai's 22nd Birthday
   ========================================================================== */

/* 1. CSS VARIABLES & THEME SYSTEM */
:root {
  --font-heading: 'Comfortaa', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Comfortaa', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'Comfortaa', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette (Gemini Glow Inspired HSL) */
  --bg-dark: hsl(252, 40%, 6%);
  --bg-card: hsla(252, 30%, 12%, 0.7);
  --border-glass: hsla(250, 100%, 80%, 0.08);
  --border-focus: hsla(270, 90%, 65%, 0.4);

  --color-primary: hsl(270, 85%, 65%);   /* Gemini Purple */
  --color-secondary: hsl(210, 90%, 55%); /* Gemini Blue */
  --color-accent: hsl(325, 85%, 60%);    /* Gemini Magenta */
  --color-success: hsl(150, 80%, 45%);   /* Soft Green */
  --color-warning: hsl(35, 90%, 55%);    /* Soft Gold */
  
  --text-primary: hsl(240, 20%, 95%);
  --text-secondary: hsl(240, 10%, 75%);
  --text-muted: hsl(240, 8%, 55%);
  
  /* Envelope Design */
  --envelope-width: min(460px, 90vw);
  --envelope-height: calc(var(--envelope-width) * 350 / 500);
  --paper-color: hsl(0, 0%, 98%);
  --paper-shadow: hsla(252, 40%, 3%, 0.5);
  --letter-folded-height: min(42.5vh, 340px);
  
  --z-back: 1;
  --z-letter: 2;
  --z-front: 3;
  --z-flap: 4;
}

/* 2. BASE RESET & SCROLLBARS */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar for Letter scroll area */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 10px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* 3. NEURAL BACKGROUND CANVAS */
#neural-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* 4. LOADING OVERLAY */
/* 4. LOADING OVERLAY */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
  transition: 
    opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.overlay.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}
.overlay:not(.active) {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

/* Unified Premium Background Mesh Gradient */
.mesh-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  background: #0b071a;
  pointer-events: none;
}

.mesh-background .mesh-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.mesh-background .bubble-wrapper {
  position: absolute;
  width: 600px;
  height: 600px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: 
    top 2.5s cubic-bezier(0.25, 1, 0.5, 1),
    left 2.5s cubic-bezier(0.25, 1, 0.5, 1),
    transform 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.mesh-background .mesh-bubble {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.7;
  transition: transform 2.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 2.8s ease;
}

.mesh-background .bubble-wrapper.bubble-1 .mesh-bubble {
  background: radial-gradient(circle, rgba(138, 92, 246, 0.75) 0%, transparent 70%);
  animation: floatBubble1 22s ease-in-out infinite;
}
.mesh-background .bubble-wrapper.bubble-2 .mesh-bubble {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.65) 0%, transparent 70%);
  animation: floatBubble2 26s ease-in-out infinite;
}
.mesh-background .bubble-wrapper.bubble-3 .mesh-bubble {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.65) 0%, transparent 70%);
  animation: floatBubble3 24s ease-in-out infinite;
}

/* STATE 1: LOADING (Circular Orbit Loading Indicator - Rotation driven via JS) */
.mesh-background.state-loading .mesh-container {
  transform: rotate(0deg);
}
.mesh-background.state-loading .bubble-wrapper.bubble-1 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translate(0, -140px) scale(0.41);
}
.mesh-background.state-loading .bubble-wrapper.bubble-2 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translate(121px, 70px) scale(0.41);
}
.mesh-background.state-loading .bubble-wrapper.bubble-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translate(-121px, 70px) scale(0.41);
}
.mesh-background.state-loading .mesh-bubble {
  opacity: 0.85;
  animation: none !important;
}

/* STATE 2: ENVELOPE (Move close to center behind envelope, float slowly) */
.mesh-background.state-envelope .bubble-wrapper.bubble-1 {
  top: 22%;
  left: 48%;
  transform: translate(-50%, -50%) scale(1.0);
}
.mesh-background.state-envelope .bubble-wrapper.bubble-2 {
  top: 70%;
  left: 62%;
  transform: translate(-50%, -50%) scale(1.0);
}
.mesh-background.state-envelope .bubble-wrapper.bubble-3 {
  top: 58%;
  left: 16%;
  transform: translate(-50%, -50%) scale(1.0);
}
.mesh-background.state-envelope .mesh-bubble {
  opacity: 0.7;
}

/* STATE 3: BLOOM (Enlarge, move away quickly, free float around screen) */
.mesh-background.state-bloom .bubble-wrapper.bubble-1 {
  top: -10%;
  left: -10%;
  transform: translate(-50%, -50%) scale(1.65);
}
.mesh-background.state-bloom .bubble-wrapper.bubble-2 {
  top: 110%;
  left: 110%;
  transform: translate(-50%, -50%) scale(1.65);
}
.mesh-background.state-bloom .bubble-wrapper.bubble-3 {
  top: 105%;
  left: -5%;
  transform: translate(-50%, -50%) scale(1.65);
}
.mesh-background.state-bloom .mesh-bubble {
  opacity: 0.75;
}

/* Dynamic floating keyframes directly on the child mesh bubbles */
@keyframes floatBubble1 {
  0% { transform: translate(0, 0); }
  33% { transform: translate(50px, -30px); }
  66% { transform: translate(-35px, 45px); }
  100% { transform: translate(0, 0); }
}
@keyframes floatBubble2 {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-45px, 50px); }
  66% { transform: translate(40px, -35px); }
  100% { transform: translate(0, 0); }
}
@keyframes floatBubble3 {
  0% { transform: translate(0, 0); }
  33% { transform: translate(40px, 45px); }
  66% { transform: translate(-50px, -40px); }
  100% { transform: translate(0, 0); }
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: hsla(252, 20%, 15%, 0.95);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-family: var(--font-body);
  font-size: 0.9rem;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}
.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* 5. GESTURE & SWIPE INDICATORS */
.hint-pulse {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  gap: 8px;
  pointer-events: none;
  z-index: 50;
  animation: pulseGradual 2s infinite ease-in-out;
}
.hint-icon-sym {
  font-size: 1.8rem;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(138, 92, 246, 0.4);
  animation: floatArrow 1.5s infinite ease-in-out;
}
.hint-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--font-heading);
}

@keyframes pulseGradual {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.95; }
}
@keyframes floatArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 6. SCREEN SYSTEMS */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  z-index: 1;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  z-index: 2;
}

/* 7. THE 3D ENVELOPE INTERFACE */
.envelope-container {
  width: var(--envelope-width);
  height: var(--envelope-height);
  perspective: 1500px;
  position: relative;
  opacity: 0;
  transform: scale(0.5);
  transition: 
    transform 1s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.8s ease;
}

.screen.active .envelope-container {
  opacity: 1;
  transform: scale(1);
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.1s ease; /* For smooth physical hover/drag responsiveness */
}

.envelope.flap-open {
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.envelope.letter-pulling {
  transform: translateY(100px) !important;
}

/* Envelope Layers with Rounded Corners */
.envelope-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  border-radius: 20px;
  overflow: hidden;
}

.envelope-front {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 20px;
  overflow: hidden;
}

.envelope-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: var(--z-flap);
}

.envelope-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Realistic Paper Styling */
.envelope-paper-back {
  fill: hsl(0, 0%, 93%);
}
.envelope-paper-front {
  fill: hsl(0, 0%, 97%);
  filter: drop-shadow(0 -4px 12px rgba(0,0,0,0.08));
}
.envelope-paper-side {
  fill: hsl(0, 0%, 94%);
  filter: drop-shadow(0 -2px 5px rgba(0,0,0,0.04));
}
.envelope-paper-flap {
  fill: hsl(0, 0%, 97%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
}

.envelope-back {
  z-index: var(--z-back);
  filter: drop-shadow(0 15px 35px var(--paper-shadow));
  background: hsl(0, 0%, 93%);
}

.envelope-front {
  z-index: var(--z-front);
}

/* Closed state vs open state */
.envelope.flap-open .envelope-top {
  transform: rotateX(180deg);
  z-index: 0; /* Fall behind the back of the envelope */
}


/* 9. INVITATION LETTER */
.letter-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, 90vw);
  height: var(--letter-folded-height);
  background: transparent;
  border-radius: 12px;
  box-shadow: none;
  color: hsl(250, 40%, 12%);
  z-index: var(--z-letter);
  transform: translate(-50%, -50%) translateY(15px) scale(0.68);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 
    transform 0.7s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.6s ease,
    visibility 0.6s ease,
    height 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 3000px;
}

.letter-body {
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.letter-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 30px 140px 30px;
}

/* 3D Unfolding Paper Mockup (Horizontal Fold) */
.letter-unfold-mockup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  perspective: 3000px;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: opacity 0.4s ease 0.1s;
  pointer-events: none;
}

.mockup-panel {
  width: 100%;
  height: var(--letter-folded-height);
  position: absolute;
  transform-style: preserve-3d;
}

.mockup-top {
  bottom: calc(var(--letter-folded-height) - 1px);
  transform-origin: bottom center;
  transform: rotateX(-180deg);
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 12px 12px 0 0;
}

.mockup-bottom {
  bottom: 0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: inset 0 15px 15px -15px rgba(0, 0, 0, 0.15); /* Crease shadow */
}

.mockup-content, .mockup-backside {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
  background: var(--paper-color);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mockup-top .mockup-content {
  border-bottom: none;
  border-radius: 12px 12px 0 0 !important;
}

.mockup-top .mockup-backside {
  border-top: none;
  border-radius: 0 0 12px 12px !important;
}

.mockup-bottom .mockup-content {
  border-top: none;
  border-radius: 0 0 12px 12px !important;
}

.mockup-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.mockup-backside {
  transform: rotateX(180deg);
  display: flex;
  justify-content: center;
  align-items: center;
}

.mockup-line {
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  margin: 6px 0;
  width: 80%;
}
.mockup-line.title {
  height: 14px;
  background: rgba(124, 58, 237, 0.2);
  width: 50%;
}
.mockup-line.subtitle {
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  width: 30%;
}
.mockup-line.paragraph {
  width: 90%;
}
.mockup-line.button {
  height: 28px;
  background: rgba(124, 58, 237, 0.35);
  width: 60%;
  border-radius: 6px;
  margin-top: 12px;
}
.mockup-monogram {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.gold-seal {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #4c1d95 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.05em;
  box-shadow: 
    0 4px 15px rgba(124, 58, 237, 0.4),
    inset 0 0 8px rgba(255,255,255,0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.6s ease;
}
.letter-content-inside {
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* LETTER OPEN AND EXPANDED ANIMATIONS */
/* Phase 1: Letter slides up out of open envelope */
/* Phase 1.5: Letter slides up out of open envelope */
.envelope.letter-pulling .letter-wrapper {
  transform: translate(-50%, -50%) translateY(-200px) scale(0.72) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  cursor: pointer;
}

/* Phase 2: Letter pops up and fills screen */
.envelope-container.letter-pulled-out {
  z-index: 1000 !important;
}

.envelope.letter-pulled-out .letter-wrapper {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: min(600px, 90vw) !important;
  height: var(--letter-folded-height) !important; /* Starts at folded height */
  transform: translate(-50%, -50%) scale(1) !important;
  z-index: 999 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  cursor: default;
  box-shadow: none !important;
}

/* Unfold trigger states */
.envelope.letter-unfolding .letter-wrapper {
  height: calc(var(--letter-folded-height) * 2) !important;
  box-shadow: none !important;
}

.envelope.letter-unfolding:not(.unfold-complete) .letter-wrapper {
  overflow: visible !important;
}

.envelope.letter-unfolding .mockup-top {
  transform: rotateX(0deg);
}

.envelope.letter-unfolding .mockup-content,
.envelope.letter-unfolding .mockup-backside {
  box-shadow: none !important;
}

.envelope.unfold-complete .letter-unfold-mockup {
  opacity: 0;
}

.envelope.unfold-complete .letter-content-inside {
  opacity: 1;
  pointer-events: all;
}

.envelope.unfold-complete .letter-wrapper {
  background: var(--paper-color) !important;
  overflow: hidden !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.45),
    0 0 100px rgba(138, 92, 246, 0.2) !important;
}

/* 10. TYPOGRAPHY & LETTER DESIGN */
.letter-header {
  text-align: center;
  margin-bottom: 20px;
}

.monogram {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--color-primary);
  border: 1px solid rgba(138, 92, 246, 0.2);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.avatar-container {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 
    0 0 20px rgba(138, 92, 246, 0.45),
    0 0 40px rgba(138, 92, 246, 0.2);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--paper-color);
  transition: transform 0.3s ease;
}

.avatar-container:hover {
  transform: scale(1.05);
}

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

.celebration-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: hsl(252, 40%, 15%);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.celebration-subtitle {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.letter-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(138, 92, 246, 0.15) 20%, rgba(138, 92, 246, 0.15) 80%, transparent);
  margin: 15px 0 25px 0;
}

.letter-greeting {
  font-family: var(--font-accent);
  font-size: 1.3rem;
  font-style: italic;
  margin-bottom: 15px;
  color: hsl(252, 40%, 25%);
}

.letter-message {
  font-size: 0.95rem;
  color: hsl(252, 25%, 30%);
  margin-bottom: 30px;
}
.letter-message p {
  margin-bottom: 12px;
}
.celebration-tagline {
  font-weight: 500;
  color: hsl(252, 40%, 20%);
}

/* Event Detail Badges */
.letter-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(138, 92, 246, 0.04);
  border: 1px solid rgba(138, 92, 246, 0.05);
  padding: 14px 18px;
  border-radius: 12px;
}

.detail-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(138, 92, 246, 0.3);
}

.detail-text {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(252, 40%, 15%);
}

/* Responsive details layout */
@media (min-width: 480px) {
  .letter-details {
    grid-template-columns: 1fr 1fr;
  }
  .letter-details :nth-child(3) {
    grid-column: span 2;
  }
}

/* Map Styling */
.letter-map-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(138, 92, 246, 0.1);
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.letter-map-container iframe {
  display: block;
}

/* RSVP Actions styling */
.letter-rsvp-section {
  text-align: center;
  padding: 10px 0 20px 0;
}

.rsvp-prompt {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: hsl(252, 40%, 20%);
}

.rsvp-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.rsvp-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.btn-confirm {
  background: var(--bg-dark);
  color: #fff;
  border: 1px solid rgba(138, 92, 246, 0.4);
  box-shadow: 0 4px 15px rgba(138, 92, 246, 0.25);
}
.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 92, 246, 0.4);
  border-color: var(--color-primary);
}
.btn-confirm:active {
  transform: translateY(0);
}

.btn-decline {
  background: transparent;
  color: hsl(252, 30%, 45%);
  border: 1px solid rgba(252, 40%, 15%, 0.15);
}
.btn-decline:hover {
  background: rgba(239, 68, 68, 0.05);
  color: hsl(0, 75%, 50%);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Shimmer shine effect for Accept button */
.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: skewX(-25deg);
  animation: shineShimmer 4s infinite linear;
}
@keyframes shineShimmer {
  0% { left: -100%; }
  35%, 100% { left: 150%; }
}

/* Status Panel */
.rsvp-status-panel {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 24px;
  border-radius: 12px;
  animation: scalePopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes scalePopIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.status-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.status-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: hsl(150, 80%, 25%);
  margin-bottom: 4px;
}
.status-msg {
  font-size: 0.85rem;
  color: hsl(252, 20%, 40%);
  margin-bottom: 16px;
}

.rsvp-change-btn {
  background: transparent;
  border: none;
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}
.rsvp-change-btn:hover {
  color: var(--color-accent);
}

/* 11. ADMIN SCREEN PANEL (TSThai AUTH) */
.admin-card {
  width: 96%;
  max-width: 1400px;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 20px;
  padding: 35px;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 25px;
  animation: slideFadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 100;
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(25px) saturate(170%);
  -webkit-backdrop-filter: blur(25px) saturate(170%);
}

.admin-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 20px;
}

.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.admin-title-row h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
}

.admin-avatar-container {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(138, 92, 246, 0.6);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: #141024;
}

.admin-avatar-container:hover {
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(138, 92, 246, 0.9);
}

.admin-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Grid Layout for Admin Form and guest tables */
.admin-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
@media (min-width: 800px) {
  .admin-card {
    height: 85vh;
    height: 85dvh;
    overflow: hidden;
  }
  .admin-content-grid {
    grid-template-columns: 1.1fr 1.9fr;
    flex: 1;
    min-height: 0;
    height: calc(100% - 90px);
  }
  .admin-section {
    height: 100%;
    min-height: 0;
  }
  .card-details {
    display: flex;
    flex-direction: column;
  }
  #party-details-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .admin-form-fields {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
  }
  .card-guests {
    display: flex;
    flex-direction: column;
  }
  .guest-list-container {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-section h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  border-left: 3px solid var(--color-primary);
  padding-left: 10px;
  margin-bottom: 4px;
}

/* Form Styles */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.3s;
  outline: none;
  color-scheme: dark;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(138, 92, 246, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.admin-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  outline: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn-save {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  font-weight: 700;
  margin-top: 10px;
}
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(138, 92, 246, 0.25);
}

.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

/* Guest Stats */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.guest-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  opacity: 0.55;
}
.stat-badge:hover, .stat-badge.active {
  opacity: 1;
  transform: translateY(-1px);
}
.stat-total { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255,255,255,0.05); }
.stat-total.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}
.stat-yes { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.2); color: hsl(150, 80%, 45%); }
.stat-yes.active {
  border-color: rgb(16, 185, 129);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}
.stat-no { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.2); color: hsl(0, 80%, 65%); }
.stat-no.active {
  border-color: rgb(239, 68, 68);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}
.stat-pending { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.2); color: hsl(35, 90%, 55%); }
.stat-pending.active {
  border-color: rgb(245, 158, 11);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* Add Guest input row */
.add-guest-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
}
.btn-add {
  background: var(--color-primary);
  color: #fff;
}
.btn-add:hover {
  background: hsl(270, 85%, 58%);
}

/* Guest Table details */
.guest-list-container {
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  overflow: hidden;
  max-height: 580px;
  overflow-y: auto;
  position: relative;
}

/* Guest list control row (sorting) */
.guest-list-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 15px;
  margin-bottom: 12px;
}
.sort-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
}
.sort-control-group select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 6px 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
}
.sort-control-group select:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Centered Guest List Loader overlay */
.guest-list-loader-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.guest-list-loader-overlay.hidden {
  opacity: 0;
  display: none;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.guest-table th,
.guest-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
}

.guest-table th {
  background: rgba(20, 16, 36, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 10;
}

.guest-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.2s;
}
.guest-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

/* Status column tags */
.status-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-tag.confirmed { background: rgba(16, 185, 129, 0.15); color: hsl(150, 80%, 45%); }
.status-tag.declined { background: rgba(239, 68, 68, 0.15); color: hsl(0, 80%, 65%); }
.status-tag.pending { background: rgba(245, 158, 11, 0.15); color: hsl(35, 90%, 55%); }

.guest-link-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.guest-link {
  font-size: 0.7rem;
  color: var(--color-secondary);
  word-break: break-all;
}

/* Copy Link and Delete buttons */
.cell-actions {
  display: flex;
  gap: 8px;
}
.btn-action {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--color-secondary);
}
.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: hsl(0, 80%, 65%);
}

/* 12. RESPONSIVENESS AND PHYSICAL VIEW SCALING */
@media (max-width: 799px) {
  .admin-form-fields {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }
  .guest-list-container {
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 600px) {
  :root {
    --letter-folded-height: 250px;
  }
  .celebration-title {
    font-size: 1.6rem;
  }
  .letter-body {
    padding: 0;
  }
  .letter-scroll-area {
    padding: 24px 20px 180px 20px;
  }
  .envelope.unfold-complete .letter-wrapper {
    height: min(720px, 85vh) !important;
  }
  .envelope.letter-pulling .letter-wrapper {
    transform: translate(-50%, -50%) translateY(-200px) scale(0.88) !important;
  }
  .decline-input-row .decline-send-btn .send-btn-text {
    display: none;
  }
  .decline-input-row .decline-send-btn {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }
  .letter-footer-credits {
    padding: 0 20px;
    margin-bottom: 50px;
  }
  .detail-item {
    padding: 10px 12px;
    gap: 10px;
  }
  .detail-icon {
    font-size: 1.2rem;
  }
  .detail-value {
    font-size: 0.85rem;
  }
  .rsvp-btn {
    padding: 12px 20px;
    font-size: 0.85rem;
  }
  .admin-card {
    padding: 20px 16px;
    width: 96%;
  }
  .admin-title-row h2 {
    font-size: 1.4rem;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .add-guest-row {
    grid-template-columns: 1fr;
  }
  .guest-table, 
  .guest-table thead, 
  .guest-table tbody, 
  .guest-table tr, 
  .guest-table td {
    display: block;
    width: 100%;
  }
  .guest-table thead {
    display: none;
  }
  .guest-table tr {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .guest-table td {
    padding: 0;
    border: none;
  }
  .guest-table td:nth-child(2) {
    display: flex;
    align-items: center;
  }
  .guest-table td:last-child {
    margin-top: 4px;
  }
  .cell-actions {
    display: flex;
    gap: 10px;
    width: 100%;
  }
  .cell-actions .btn-action {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
  .hint-pulse {
    top: 6%;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  /* Landscape mobile height fixes */
  .envelope-container {
    transform: scale(0.7) translateY(-10px);
  }
}

/* 13. FLOATING BOTTOM RSVP CARD */
.letter-floating-rsvp {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 520px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 16px 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.rsvp-prompt-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(252, 40%, 15%);
  text-align: center;
}

.rsvp-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.rsvp-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--bg-dark);
  color: #ffffff;
  border: 1px solid rgba(138, 92, 246, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  flex: 1;
  font-family: var(--font-heading);
}

.rsvp-action-btn:hover {
  transform: translateY(-2px);
  background: hsl(252, 40%, 10%);
}

.rsvp-action-btn.undo-btn {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  color: hsl(252, 30%, 30%);
  border: 1px solid rgba(0,0,0,0.1);
}

.rsvp-action-btn.undo-btn:hover {
  background: rgba(0,0,0,0.1);
}

/* Calendar Dropdown Options */
.calendar-dropdown-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

.calendar-dropdown-menu {
  position: absolute;
  bottom: 120%; /* Position above the button */
  left: 50%;
  transform: translateX(-50%);
  background: hsla(252, 30%, 12%, 0.98);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 190px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding: 6px;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.calendar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
  cursor: pointer;
  white-space: nowrap;
  
  /* Button reset styles */
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
  outline: none;
}

.calendar-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.calendar-dropdown-item .material-symbols-outlined {
  font-size: 1.1rem;
}

.rsvp-decline-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.decline-sorry-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: hsl(252, 35%, 25%);
  text-align: center;
  line-height: 1.4;
}

.decline-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.decline-input-row input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(138, 92, 246, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  outline: none;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: hsl(252, 40%, 15%);
  box-sizing: border-box;
}

.decline-input-row .decline-send-btn {
  flex: 0 0 auto !important;
  height: 42px;
  padding: 0 16px;
  background: var(--bg-dark) !important;
  border-color: rgba(138, 92, 246, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(138, 92, 246, 0.15) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.decline-input-row .decline-send-btn:hover {
  background: hsl(252, 40%, 10%) !important;
  border-color: var(--color-primary) !important;
}

/* Custom Accept/Decline Button Styles for the Floating RSVP Card */
.btn-floating-accept {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(138, 92, 246, 0.4);
  outline: none;
  background: var(--bg-dark);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(138, 92, 246, 0.25);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
}
.btn-floating-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 92, 246, 0.45);
  border-color: var(--color-primary);
}
.btn-floating-accept:active {
  transform: translateY(0);
}

.btn-floating-decline-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: hsl(252, 30%, 45%);
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-floating-decline-text:hover {
  color: hsl(0, 75%, 50%);
  transform: translateY(-2px);
}

/* Floating Card Transition Effects and Spinner */
.floating-rsvp-content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

.letter-floating-rsvp.transitioning .floating-rsvp-content-wrapper {
  opacity: 0;
}

.rsvp-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(138, 92, 246, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: rsvpSpinnerRotate 0.8s linear infinite;
  margin: 12px 0;
}

@keyframes rsvpSpinnerRotate {
  to { transform: rotate(360deg); }
}

/* Prevent wrapping on desktop action row buttons and adjust size */
.rsvp-actions-row .rsvp-action-btn {
  padding: 10px 12px;
  font-size: 0.8rem;
  gap: 6px;
  white-space: nowrap;
}

.rsvp-actions-row .rsvp-action-btn.undo-btn .undo-text {
  display: none;
}

/* Responsive grid for Accept state on mobile */
@media (max-width: 440px) {
  .rsvp-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .rsvp-actions-row .rsvp-action-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    justify-content: center;
  }
  .rsvp-actions-row .rsvp-action-btn.undo-btn {
    grid-column: span 1;
    border-radius: 8px;
    height: auto;
    width: 100%;
    padding: 10px 8px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0,0,0,0.05);
    color: hsl(252, 30%, 30%);
    border: 1px solid rgba(0,0,0,0.1);
  }
  .rsvp-actions-row .rsvp-action-btn.undo-btn .undo-text {
    display: inline;
  }
}

/* Quote and Display layout for submitted decline reason */
.decline-reason-display {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: hsl(252, 45%, 15%);
  background: linear-gradient(135deg, hsla(252, 100%, 99%, 0.9), hsla(252, 100%, 97%, 0.7));
  border: 1px solid rgba(138, 92, 246, 0.12);
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  padding: 16px 20px 16px 45px;
  margin: 16px 0 10px 0;
  text-align: left;
  max-width: 100%;
  word-break: break-word;
  box-sizing: border-box;
  box-shadow: 
    0 10px 25px -10px rgba(138, 92, 246, 0.08),
    inset 0 1px 1px #ffffff;
}

.decline-reason-display::before {
  content: "“";
  position: absolute;
  top: 6px;
  left: 14px;
  font-family: Georgia, serif;
  font-size: 3.5rem;
  color: var(--color-primary);
  opacity: 0.28;
  line-height: 1;
  user-select: none;
}

.decline-reason-text-val {
  font-style: italic;
  font-weight: 500;
  line-height: 1.5;
  display: block;
}

.decline-reason-quote {
  display: none;
}

/* Admin Dashboard Decline Reason Item styling */
.guest-decline-reason {
  margin-top: 6px;
  font-size: 0.75rem;
  color: hsl(0, 70%, 45%);
  background: rgba(239, 68, 68, 0.06);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid rgba(239, 68, 68, 0.4);
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
  font-weight: 500;
}

/* Keyframe animation for card content fade-in & slide-up */
.floating-rsvp-content-wrapper {
  animation: rsvpContentFadeIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

.party-countdown-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 12px 0 6px 0;
  font-family: var(--font-heading);
}

.party-countdown-widget .countdown-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  transition: transform 0.3s;
}

.party-countdown-widget .countdown-item:hover {
  transform: translateY(-2px);
}

.countdown-val-container {
  position: relative;
  overflow: hidden;
  height: 2rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.countdown-val-container .digit {
  position: absolute;
  display: inline-block;
  line-height: 1;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(138, 92, 246, 0.3);
}

.countdown-val-container .digit.digit-active {
  transform: translateY(0);
  opacity: 1;
}

.countdown-val-container .digit.digit-slide-in {
  animation: slideUpIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.countdown-val-container .digit.digit-slide-out {
  animation: slideUpOut 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.countdown-colon {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(138, 92, 246, 0.3);
  margin-top: -2px;
  animation: colonBlink 1s step-end infinite;
  user-select: none;
}

.countdown-started-msg {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(138, 92, 246, 0.4);
  background: rgba(138, 92, 246, 0.08);
  border: 1px solid rgba(138, 92, 246, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  animation: pulseCountdownMsg 2s infinite ease-in-out;
  margin-top: 10px;
}

@keyframes pulseCountdownMsg {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes slideUpIn {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUpOut {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Footer Credits styling under the map */
.letter-footer-credits {
  text-align: center;
  font-size: 0.72rem;
  color: hsl(252, 15%, 50%);
  margin-top: 24px;
  margin-bottom: 24px;
  font-weight: 500;
  line-height: 1.4;
}

/* Decline RSVP View Centered Actions styling */
.rsvp-decline-actions-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  width: 100%;
}

/* RSVP Confirmation Note Modal */
.rsvp-note-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 8, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  padding: 20px;
}

.rsvp-note-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.rsvp-note-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 30px;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rsvp-note-modal-overlay.active .rsvp-note-modal-card {
  transform: scale(1) translateY(0);
}

.rsvp-note-modal-content {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
}

.rsvp-note-modal-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #ffffff;
  border: none;
  padding: 12px 32px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 4px 15px rgba(138, 92, 246, 0.4);
}

.rsvp-note-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 92, 246, 0.6);
}

.rsvp-note-modal-btn:active {
  transform: translateY(0);
}
