/* ===== Global ===== */
* { box-sizing: border-box; }

/* ===== CSS Custom Properties for Theming ===== */
:root {
    --inv-primary: #7c3aed;
    --inv-primary-rgb: 124, 58, 237;
    --inv-gold: #d4a574;
    --inv-gold-rgb: 212, 165, 116;
    --inv-glass-bg: rgba(255, 255, 255, 0.6);
    --inv-glass-border: rgba(255, 255, 255, 0.3);
    --inv-shadow-soft: rgba(0, 0, 0, 0.06);
    --inv-transition-smooth: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --inv-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --inv-radius: 1rem;
    --inv-duration-fast: 0.3s;
    --inv-duration-normal: 0.6s;
    --inv-duration-slow: 0.9s;
}

/* ===== Animated gradient background ===== */
.gradient-bg {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== Glassmorphism ===== */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===== Glow effects ===== */
.glow {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.3), 0 0 60px rgba(124, 58, 237, 0.1);
}

.glow-text {
    text-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
}

/* ===== Float animation ===== */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-20px); }
}

/* ===== Fade in animations ===== */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up-delay-1 { animation-delay: 0.2s; }
.fade-in-up-delay-2 { animation-delay: 0.4s; }
.fade-in-up-delay-3 { animation-delay: 0.6s; }
.fade-in-up-delay-4 { animation-delay: 0.8s; }

/* ===== Shine effect ===== */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%   { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== Particle dots ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(124, 58, 237, 0.4);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Card hover ===== */
.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2);
}

/* ===== Button pulse ===== */
.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    50%      { box-shadow: 0 0 0 15px rgba(124, 58, 237, 0); }
}

/* ===== Invitation-specific ===== */
.inv-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.inv-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Confetti ===== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confettiFall {
    0%   { top: -10px; transform: rotate(0deg) scale(1); opacity: 1; }
    80%  { opacity: 1; }
    100% { top: 110vh; transform: rotate(720deg) scale(0.5); opacity: 0; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #7c3aed; border-radius: 3px; }

/* ===== Invitation themes ===== */
.theme-elegante { font-family: 'Playfair Display', serif; }
.theme-fiesta   { font-family: 'Poppins', sans-serif; }
.theme-romantico { font-family: 'Great Vibes', cursive; }
.theme-moderno  { font-family: 'Inter', sans-serif; }
.theme-natural  { font-family: 'Lora', serif; }
.theme-infantil { font-family: 'Quicksand', sans-serif; }

/* ===== Countdown ===== */
.countdown-box {
    min-width: 70px;
    text-align: center;
}

/* ===== Loading spinner ===== */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #7c3aed;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ===== Toast notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    animation: slideInRight 0.4s ease-out;
}

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

/* ==========================================================================
   INVITATION TEMPLATE ENHANCEMENTS
   ========================================================================== */

/* ===== 1. Shimmer effect for buttons ===== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmerSlide 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerSlide {
    0%   { left: -100%; }
    100% { left: 100%; }
}

/* ===== 2. Timeline styles for itinerary ===== */
.timeline-container {
    position: relative;
    padding-left: 2rem;
}

.timeline-line {
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(var(--inv-primary-rgb), 0.1),
        rgba(var(--inv-primary-rgb), 0.5),
        rgba(var(--inv-primary-rgb), 0.1)
    );
}

.timeline-dot {
    position: absolute;
    left: calc(0.5rem - 5px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--inv-primary);
    box-shadow: 0 0 0 4px rgba(var(--inv-primary-rgb), 0.15);
    z-index: 1;
}

.timeline-dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: white;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--inv-duration-normal) var(--inv-transition-ease),
                transform var(--inv-duration-normal) var(--inv-transition-ease);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    transition-delay: 0.15s;
}

/* ===== 3. Decorative frame for cards ===== */
.decorated-frame {
    position: relative;
    padding: 1.5rem;
}

.decorated-frame::before,
.decorated-frame::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--inv-gold, #d4a574);
    border-style: solid;
    pointer-events: none;
    opacity: 0.6;
}

.decorated-frame::before {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
    border-radius: 4px 0 0 0;
}

.decorated-frame::after {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 4px 0;
}

.decorated-frame-full::before {
    top: 0;
    right: 0;
    left: auto;
    border-width: 2px 2px 0 0;
    border-radius: 0 4px 0 0;
}

.decorated-frame-full::after {
    bottom: 0;
    left: 0;
    right: auto;
    border-width: 0 0 2px 2px;
    border-radius: 0 0 0 4px;
}

/* ===== 4. Number animation for countdown ===== */
@keyframes numberPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.countdown-number {
    animation: numberPop 0.3s ease;
    display: inline-block;
}

/* ===== 5. Enhanced section transition variants ===== */
.inv-section-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s var(--inv-transition-ease),
                transform 0.8s var(--inv-transition-smooth);
}

.inv-section-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.inv-section-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s var(--inv-transition-ease),
                transform 0.8s var(--inv-transition-smooth);
}

.inv-section-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.inv-section-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s var(--inv-transition-ease),
                transform 0.8s var(--inv-transition-smooth);
}

.inv-section-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===== 6. Sparkle effect ===== */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: var(--inv-gold, #d4a574);
    border-radius: 2px;
}

.sparkle::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.sparkle::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.sparkle:nth-child(2n) { animation-delay: 0.5s; }
.sparkle:nth-child(3n) { animation-delay: 1s; }
.sparkle:nth-child(4n) { animation-delay: 1.5s; }

/* ===== 7. Wax seal animation ===== */
@keyframes sealStamp {
    0% {
        transform: scale(2.5) rotate(-30deg);
        opacity: 0;
    }
    60% {
        transform: scale(0.9) rotate(3deg);
        opacity: 1;
    }
    80% {
        transform: scale(1.05) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.wax-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #c0392b, #8e1a0e);
    box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, 0.2),
        inset 0 -3px 6px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: sealStamp 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
}

.wax-seal::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

/* ===== 8. Elegant scroll indicator ===== */
@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(8px);
        opacity: 1;
    }
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    animation: scrollBounce 2s ease-in-out infinite;
    cursor: pointer;
}

.scroll-indicator::before {
    content: '';
    width: 20px;
    height: 32px;
    border: 2px solid rgba(var(--inv-primary-rgb), 0.5);
    border-radius: 10px;
    position: relative;
}

.scroll-indicator::after {
    content: '';
    width: 3px;
    height: 6px;
    background: var(--inv-primary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50%      { opacity: 0.4; transform: translateY(8px); }
}

/* ===== 9. Frosted glass card (enhanced glassmorphism) ===== */
.inv-glass {
    background: var(--inv-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--inv-glass-border);
    box-shadow: 0 8px 32px var(--inv-shadow-soft);
}

.inv-glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ===== 10. Attendance button active states ===== */
.att-btn-active {
    transition: all 0.35s var(--inv-transition-ease);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(var(--inv-primary-rgb), 0.25),
                0 4px 16px rgba(var(--inv-primary-rgb), 0.2);
}

.att-btn-active.att-btn-confirm {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.att-btn-active.att-btn-decline {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

.att-btn-active.att-btn-maybe {
    background-color: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

/* ===== 11. Form field enhanced focus ===== */
.inv-input-enhanced {
    transition: border-color var(--inv-duration-fast) ease,
                box-shadow var(--inv-duration-fast) ease;
}

.inv-input-enhanced:focus {
    outline: none;
    border-color: var(--inv-primary);
    box-shadow: 0 0 0 3px rgba(var(--inv-primary-rgb), 0.15),
                0 0 16px rgba(var(--inv-primary-rgb), 0.1);
}

/* ===== 12. Ornament fade-in / draw-in animation ===== */
@keyframes ornamentDraw {
    0% {
        opacity: 0;
        stroke-dashoffset: 200;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        stroke-dashoffset: 0;
        transform: scale(1);
    }
}

.ornament-draw {
    opacity: 0;
    animation: ornamentDraw 1.2s ease-out forwards;
}

.ornament-draw svg {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.ornament-draw.visible svg {
    animation: ornamentDraw 1.2s ease-out forwards;
}

/* ===== 13. Petal float variations ===== */
@keyframes petalFloat2 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(-40px, 25vh) rotate(90deg) scale(0.9);
    }
    50% {
        transform: translate(20px, 50vh) rotate(200deg) scale(0.85);
    }
    75% {
        transform: translate(-30px, 75vh) rotate(300deg) scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translate(10px, 100vh) rotate(400deg) scale(0.7);
        opacity: 0;
    }
}

@keyframes petalFloat3 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translate(30px, 20vh) rotate(-60deg) scale(0.95);
    }
    40% {
        transform: translate(-20px, 40vh) rotate(-150deg) scale(0.9);
    }
    60% {
        transform: translate(40px, 60vh) rotate(-240deg) scale(0.85);
        opacity: 0.7;
    }
    80% {
        transform: translate(-10px, 80vh) rotate(-320deg) scale(0.75);
        opacity: 0.4;
    }
    100% {
        transform: translate(20px, 100vh) rotate(-400deg) scale(0.7);
        opacity: 0;
    }
}

.petal-v2 {
    animation-name: petalFloat2;
}

.petal-v3 {
    animation-name: petalFloat3;
}

/* ===== 14. Section background patterns (CSS only) ===== */
.pattern-dots {
    background-image: radial-gradient(
        circle,
        rgba(var(--inv-primary-rgb), 0.07) 1px,
        transparent 1px
    );
    background-size: 20px 20px;
}

.pattern-lines {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(var(--inv-primary-rgb), 0.03) 10px,
        rgba(var(--inv-primary-rgb), 0.03) 11px
    );
}


/* ==========================================================================
   ADDITIONAL ENHANCEMENTS
   ========================================================================== */

/* ===== 15. Envelope animation improvements ===== */
/* Complements the inline envelope styles in invitation view.html */
@keyframes envelopeGlow {
    0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); }
    50%      { box-shadow: 0 8px 40px rgba(var(--inv-primary-rgb), 0.15), 0 0 60px rgba(var(--inv-primary-rgb), 0.05); }
}

.envelope-wrapper {
    animation: envelopeGlow 3s ease-in-out infinite;
}

.envelope-hint {
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
}

@keyframes envelopeShake {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(-2deg); }
    30%      { transform: rotate(2deg); }
    45%      { transform: rotate(-1deg); }
    60%      { transform: rotate(1deg); }
}

.envelope-shake {
    animation: envelopeShake 2s ease-in-out 3s infinite;
}

/* ===== 16. Icon circle pulse for event details ===== */
/* Used in the invitation view detail cards */
@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--inv-primary-rgb), 0.1); }
    50%      { box-shadow: 0 0 0 8px rgba(var(--inv-primary-rgb), 0); }
}

.icon-circle-animated {
    animation: iconPulse 3s ease-in-out infinite;
}

.icon-circle-animated:nth-child(2) { animation-delay: 0.5s; }
.icon-circle-animated:nth-child(3) { animation-delay: 1s; }
.icon-circle-animated:nth-child(4) { animation-delay: 1.5s; }

/* ===== 17. Ornament divider with fade animation ===== */
/* Enhanced version of the inline .ornament-divider from view.html */
.ornament-divider-animated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 1rem 0;
    opacity: 0;
    transition: opacity var(--inv-duration-slow) ease;
}

.ornament-divider-animated.visible {
    opacity: 1;
}

.ornament-divider-animated .line {
    width: 0;
    height: 1px;
    transition: width var(--inv-duration-slow) var(--inv-transition-ease);
}

.ornament-divider-animated.visible .line {
    width: 60px;
}

@keyframes diamondSpin {
    from { transform: rotate(45deg); }
    to   { transform: rotate(225deg); }
}

.ornament-divider-animated .diamond {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity var(--inv-duration-fast) ease var(--inv-duration-normal);
}

.ornament-divider-animated.visible .diamond {
    opacity: 1;
}

/* ===== 18. Invitation card lift on scroll (visible state) ===== */
/* Enhanced version of inv-card for the invitation view */
.inv-card-animated {
    transition: transform var(--inv-duration-normal) var(--inv-transition-ease),
                box-shadow var(--inv-duration-normal) ease;
}

.inv-card-animated:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* ===== 19. Stagger delay utility classes ===== */
/* Generic stagger delays for any animated children */
.stagger-1 { transition-delay: 0.1s !important; animation-delay: 0.1s !important; }
.stagger-2 { transition-delay: 0.2s !important; animation-delay: 0.2s !important; }
.stagger-3 { transition-delay: 0.3s !important; animation-delay: 0.3s !important; }
.stagger-4 { transition-delay: 0.4s !important; animation-delay: 0.4s !important; }
.stagger-5 { transition-delay: 0.5s !important; animation-delay: 0.5s !important; }
.stagger-6 { transition-delay: 0.6s !important; animation-delay: 0.6s !important; }
.stagger-7 { transition-delay: 0.7s !important; animation-delay: 0.7s !important; }
.stagger-8 { transition-delay: 0.8s !important; animation-delay: 0.8s !important; }

/* ===== 20. Music player animations ===== */
/* Enhances the inline music-player-widget from view.html */
@keyframes musicBars {
    0%, 100% { height: 3px; }
    50%      { height: 12px; }
}

.music-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.music-bars span {
    display: block;
    width: 3px;
    background: currentColor;
    border-radius: 1px;
    animation: musicBars 0.8s ease-in-out infinite;
}

.music-bars span:nth-child(1) { animation-delay: 0s; }
.music-bars span:nth-child(2) { animation-delay: 0.15s; }
.music-bars span:nth-child(3) { animation-delay: 0.3s; }
.music-bars span:nth-child(4) { animation-delay: 0.45s; }

.music-bars.paused span {
    animation-play-state: paused;
}

/* ===== 21. Confetti variations (ribbon and star shapes) ===== */
.confetti-ribbon {
    position: fixed;
    width: 4px;
    height: 16px;
    top: -16px;
    border-radius: 2px;
    animation: confettiRibbon linear forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confettiRibbon {
    0%   { top: -16px; transform: rotate(0deg) scaleX(1); opacity: 1; }
    50%  { transform: rotate(360deg) scaleX(0.6); }
    80%  { opacity: 1; }
    100% { top: 110vh; transform: rotate(720deg) scaleX(1); opacity: 0; }
}

.confetti-star {
    position: fixed;
    width: 0;
    height: 0;
    top: -12px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid currentColor;
    animation: confettiStar linear forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confettiStar {
    0%   { top: -12px; transform: rotate(0deg); opacity: 1; }
    80%  { opacity: 0.8; }
    100% { top: 110vh; transform: rotate(540deg); opacity: 0; }
}

/* ===== 22. Hover glow effect for buttons ===== */
/* Adds a subtle glow on hover, useful for inv-btn, CTA, share buttons */
.hover-glow {
    transition: box-shadow var(--inv-duration-fast) ease,
                transform var(--inv-duration-fast) ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--inv-primary-rgb), 0.25),
                0 4px 15px rgba(var(--inv-primary-rgb), 0.15);
    transform: translateY(-1px);
}

.hover-glow:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(var(--inv-primary-rgb), 0.2);
}

/* ===== 23. Text reveal animation ===== */
/* For headline / title dramatic reveals */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.text-reveal {
    opacity: 0;
    animation: textReveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.text-reveal-delay-1 { animation-delay: 0.15s; }
.text-reveal-delay-2 { animation-delay: 0.3s; }
.text-reveal-delay-3 { animation-delay: 0.45s; }

/* ===== 24. Typing cursor for AI-generated feel ===== */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    font-weight: 300;
    color: var(--inv-primary);
}

/* ===== 25. Gradient border (for premium card look) ===== */
.gradient-border {
    position: relative;
    background: transparent;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(var(--inv-primary-rgb), 0.4),
        rgba(var(--inv-gold-rgb), 0.3),
        rgba(var(--inv-primary-rgb), 0.1)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ===== 26. Parallax depth layers ===== */
/* For creating subtle parallax within invitation sections */
.parallax-slow {
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-medium {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ===== 27. RSVP success celebration ===== */
@keyframes successPop {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.2); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.rsvp-success {
    animation: successPop 0.6s var(--inv-transition-smooth) forwards;
}

@keyframes checkDraw {
    0%   { stroke-dashoffset: 30; }
    100% { stroke-dashoffset: 0; }
}

.rsvp-check svg {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: checkDraw 0.5s ease-out 0.3s forwards;
}

/* ===== 28. Photo gallery lightbox overlay ===== */
/* For future photo gallery feature */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    transition: opacity var(--inv-duration-fast) ease;
    pointer-events: none;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== 29. Itinerary card alternating layout ===== */
/* For a more visual left-right itinerary display */
.itinerary-alt:nth-child(even) {
    flex-direction: row-reverse;
}

.itinerary-alt {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

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

.itinerary-alt:nth-child(odd) .itinerary-content {
    animation: slideInLeft var(--inv-duration-normal) var(--inv-transition-ease) both;
}

.itinerary-alt:nth-child(even) .itinerary-content {
    animation: slideInFromRight var(--inv-duration-normal) var(--inv-transition-ease) both;
}

/* ===== 30. Countdown enhanced with separator ===== */
.countdown-separator {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.3;
    padding: 0 0.125rem;
}

@keyframes countdownFlip {
    0%   { transform: perspective(200px) rotateX(0deg); }
    50%  { transform: perspective(200px) rotateX(-90deg); opacity: 0.5; }
    100% { transform: perspective(200px) rotateX(0deg); opacity: 1; }
}

.countdown-flip {
    animation: countdownFlip 0.4s ease-out;
    transform-origin: center;
}

/* ===== 31. Share button hover ripple ===== */
@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.4; }
    100% { transform: scale(2.5); opacity: 0; }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.btn-ripple:active::after {
    animation: ripple 0.5s ease-out;
}

/* ===== 32. Smooth image reveal ===== */
/* For itinerary item icons or any image that loads */
@keyframes imageReveal {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.img-reveal {
    animation: imageReveal 0.5s ease-out forwards;
}

/* ===== 33. Section pattern variations ===== */
.pattern-chevron {
    background-image:
        linear-gradient(135deg, rgba(var(--inv-primary-rgb), 0.03) 25%, transparent 25%),
        linear-gradient(225deg, rgba(var(--inv-primary-rgb), 0.03) 25%, transparent 25%),
        linear-gradient(315deg, rgba(var(--inv-primary-rgb), 0.03) 25%, transparent 25%),
        linear-gradient(45deg, rgba(var(--inv-primary-rgb), 0.03) 25%, transparent 25%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.pattern-grid {
    background-image:
        linear-gradient(rgba(var(--inv-primary-rgb), 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--inv-primary-rgb), 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ===== 34. Tooltip for interactive elements ===== */
.inv-tooltip {
    position: relative;
}

.inv-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--inv-duration-fast) ease,
                transform var(--inv-duration-fast) ease;
}

.inv-tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 35. Focus-visible for keyboard accessibility ===== */
.inv-focus-ring:focus-visible {
    outline: 2px solid var(--inv-primary);
    outline-offset: 2px;
}

/* ===== 36. Loading skeleton for invitation preview ===== */
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin: 0 auto 1em;
    border-radius: 4px;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ===== 37. Entrance overlay backdrop enhancements ===== */
/* Complements the inline .entrance-overlay from view.html */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.entrance-content {
    animation: overlayFadeIn 0.8s ease-out;
}

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

.entrance-cta-hint {
    animation: gentlePulse 2s ease-in-out infinite;
    font-size: 0.75rem;
}

/* ===== 38. Responsive spacing helpers ===== */
/* Useful for invitation sections that need different spacing on mobile */
.inv-py-responsive {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    .inv-py-responsive {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* ===== 39. Print styles for invitation ===== */
@media print {
    .music-player-widget,
    .music-badge,
    .scroll-indicator,
    .entrance-overlay,
    .particles,
    .petal,
    .confetti-piece,
    .confetti-ribbon,
    .confetti-star,
    .toast {
        display: none !important;
    }

    .inv-section {
        opacity: 1 !important;
        transform: none !important;
    }

    .inv-bg {
        background: white !important;
        color: #333 !important;
    }

    .inv-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ===== 40. Reduced motion preference ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .float,
    .btn-pulse,
    .shimmer::after,
    .shine::after,
    .sparkle,
    .scroll-indicator,
    .envelope-shake,
    .music-bars span {
        animation: none !important;
    }

    .inv-section,
    .inv-section-left,
    .inv-section-right,
    .inv-section-scale,
    .timeline-item {
        opacity: 1 !important;
        transform: none !important;
    }

    .particle,
    .petal,
    .confetti-piece {
        display: none !important;
    }
}
