/**
 * Wedding Page Styles
 * Minimal CSS - Only for animations, decorative elements, and utilities
 * All layout and styling done with Tailwind CSS
 * Depends on: variables.css
 */

/* Typography Utilities - Keep for custom fonts */
.script-font { 
    font-family: var(--font-script);
    font-feature-settings: "liga" 1, "kern" 1;
}

.elegant-font { 
    font-family: var(--font-elegant);
    font-feature-settings: "liga" 1, "kern" 1;
}

.bilingual-text {
    font-family: var(--font-body);
}

/* Decorative elements for hero - animations and clip-paths */
.hero-decorative-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--soft-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    pointer-events: none;
    animation: gentle-float 4s ease-in-out infinite;
    opacity: 0.7;
    z-index: 1;
}

.hero-decorative-star:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.hero-decorative-star:nth-child(2) { top: 20%; left: 90%; animation-delay: 1.5s; }
.hero-decorative-star:nth-child(3) { top: 80%; left: 10%; animation-delay: 3s; }
.hero-decorative-star:nth-child(4) { top: 60%; left: 95%; animation-delay: 0.5s; }

.hero-decorative-heart {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--blush-pink);
    clip-path: path('M12,21.35l-1.45-1.32C5.4,15.36,2,12.28,2,8.5 C2,5.42,4.42,3,7.5,3c1.74,0,3.41,0.81,4.5,2.09C13.09,3.81,14.76,3,16.5,3 C19.58,3,22,5.42,22,8.5c0,3.78-3.4,6.86-8.55,11.54L12,21.35z');
    pointer-events: none;
    animation: gentle-float 5s ease-in-out infinite;
    opacity: 0.6;
    z-index: 1;
}

.hero-decorative-heart:nth-child(5) { top: 15%; left: 50%; animation-delay: 2s; }
.hero-decorative-heart:nth-child(6) { top: 85%; left: 55%; animation-delay: 1s; }

@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-8px) rotate(5deg);
        opacity: 1;
    }
}

/* Pulse animation for countdown section */
.countdown-pulse {
    animation: countdown-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.98;
    }
}

/* Decorative sparkle elements - shared across sections */
.countdown-sparkle,
.story-sparkle,
.gallery-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--soft-gold);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--soft-gold), 0 0 12px var(--light-gold);
    z-index: 1;
}

.countdown-sparkle:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.countdown-sparkle:nth-child(2) { top: 20%; right: 15%; animation-delay: 0.5s; }
.countdown-sparkle:nth-child(3) { bottom: 25%; left: 20%; animation-delay: 1s; }
.countdown-sparkle:nth-child(4) { bottom: 15%; right: 10%; animation-delay: 1.5s; }

.story-sparkle:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.story-sparkle:nth-child(2) { top: 15%; right: 8%; animation-delay: 0.5s; }
.story-sparkle:nth-child(3) { bottom: 20%; left: 10%; animation-delay: 1s; }
.story-sparkle:nth-child(4) { bottom: 10%; right: 5%; animation-delay: 1.5s; }

.gallery-sparkle:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.gallery-sparkle:nth-child(2) { top: 15%; right: 8%; animation-delay: 0.5s; }
.gallery-sparkle:nth-child(3) { bottom: 20%; left: 10%; animation-delay: 1s; }
.gallery-sparkle:nth-child(4) { bottom: 10%; right: 5%; animation-delay: 1.5s; }

@keyframes sparkle-twinkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(2) rotate(180deg);
    }
}

/* Advanced Animations for Premium Design */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.6;
    }
    33% {
        transform: translateY(-15px) translateX(5px);
        opacity: 0.8;
    }
    66% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 1;
    }
}

@keyframes float-slow-delay {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.5;
    }
    33% {
        transform: translateY(-12px) translateX(-3px);
        opacity: 0.7;
    }
    66% {
        transform: translateY(-8px) translateX(3px);
        opacity: 0.9;
    }
}

@keyframes float-slow-delay-2 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.4;
    }
    33% {
        transform: translateY(-10px) translateX(4px);
        opacity: 0.6;
    }
    66% {
        transform: translateY(-6px) translateX(-4px);
        opacity: 0.8;
    }
}

/* Butterfly orbit paths (ceremony) */
.butterfly-path-left {
    animation: butterfly-left 12s ease-in-out infinite;
    transform-origin: center;
}

.butterfly-path-right {
    animation: butterfly-right 12s ease-in-out infinite;
    transform-origin: center;
}

@keyframes butterfly-left {
    0% { transform: translate3d(-6px, 0, 0) rotate(-6deg) scale(1); }
    20% { transform: translate3d(10px, -12px, 0) rotate(4deg) scale(1.05); }
    40% { transform: translate3d(18px, 8px, 0) rotate(10deg) scale(0.98); }
    60% { transform: translate3d(-8px, 12px, 0) rotate(-4deg) scale(1.02); }
    80% { transform: translate3d(-14px, -6px, 0) rotate(-10deg) scale(1.04); }
    100% { transform: translate3d(-6px, 0, 0) rotate(-6deg) scale(1); }
}

@keyframes butterfly-right {
    0% { transform: translate3d(6px, 0, 0) rotate(6deg) scale(1); }
    20% { transform: translate3d(-12px, 10px, 0) rotate(-2deg) scale(1.03); }
    40% { transform: translate3d(-18px, -10px, 0) rotate(-8deg) scale(0.97); }
    60% { transform: translate3d(8px, 12px, 0) rotate(4deg) scale(1.05); }
    80% { transform: translate3d(14px, -6px, 0) rotate(10deg) scale(1.02); }
    100% { transform: translate3d(6px, 0, 0) rotate(6deg) scale(1); }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fade-in-delay {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Apply animations */
.animate-gradient-shift {
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.animate-float-slow-delay {
    animation: float-slow-delay 10s ease-in-out infinite;
    animation-delay: 2s;
}

.animate-float-slow-delay-2 {
    animation: float-slow-delay-2 12s ease-in-out infinite;
    animation-delay: 4s;
}

.animate-fade-in-up {
    animation: fade-in-up 1s ease-out;
}

.animate-slide-in-down {
    animation: slide-in-down 0.8s ease-out;
}

.animate-scale-in {
    animation: scale-in 1s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

.animate-fade-in-delay {
    animation: fade-in-delay 1.5s ease-out;
    animation-fill-mode: both;
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}


.ceremony-corner {
    position: absolute;
    width: 110px;
    height: 110px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 110 110'%3E%3Cg stroke='%23DABEA0' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round' opacity='0.65'%3E%3Cpath d='M10 100 C22 76 34 70 46 64 C60 56 68 44 72 30 C76 16 86 8 100 10'/%3E%3Cpath d='M36 90 C44 82 48 72 50 62'/%3E%3Cpath d='M60 42 C68 40 76 34 82 26'/%3E%3Cpath d='M72 58 C82 54 90 46 96 36'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.4;
    filter: drop-shadow(0 10px 18px rgba(107, 70, 60, 0.12));
    pointer-events: none;
}

.ceremony-corner-tl { top: 0; left: 0; transform: translate(-22%, -18%) rotate(0deg); }
.ceremony-corner-tr { top: 0; right: 0; transform: translate(22%, -18%) rotate(90deg); }
.ceremony-corner-bl { bottom: 0; left: 0; transform: translate(-22%, 18%) rotate(-90deg); }
.ceremony-corner-br { bottom: 0; right: 0; transform: translate(22%, 18%) rotate(180deg); }

.ceremony-butterfly {
    position: absolute;
    width: 68px;
    height: 36px;
    background:
        radial-gradient(circle at 30% 30%, rgba(232, 213, 183, 0.9), rgba(232, 213, 183, 0.1)),
        radial-gradient(circle at 70% 70%, rgba(244, 228, 228, 0.7), transparent 60%);
    border-radius: 60% 40% 60% 40%;
    filter: drop-shadow(0 10px 18px rgba(107, 70, 60, 0.12));
    opacity: 0.75;
    animation: butterfly-float 12s ease-in-out infinite;
}

.ceremony-butterfly::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35), transparent 70%);
}

.ceremony-butterfly-left {
    top: 18px;
    left: 8%;
    transform: rotate(-8deg);
    animation-delay: 0.8s;
}

.ceremony-butterfly-right {
    bottom: 18px;
    right: 10%;
    transform: rotate(10deg);
    animation-delay: 1.6s;
}

@keyframes butterfly-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.75; }
    25% { transform: translate3d(6px, -10px, 0) rotate(4deg); opacity: 0.9; }
    50% { transform: translate3d(-4px, 12px, 0) rotate(-3deg); opacity: 0.8; }
    75% { transform: translate3d(10px, 6px, 0) rotate(6deg); opacity: 0.85; }
}

.ceremony-petal {
    position: absolute;
    width: 22px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, rgba(244, 228, 228, 0.85), transparent 70%);
    border-radius: 60% 60% 50% 50%;
    filter: blur(0.2px) drop-shadow(0 6px 10px rgba(107, 70, 60, 0.08));
    opacity: 0.65;
    animation: petal-drift 14s ease-in-out infinite;
}

.ceremony-petal-1 { top: 12%; left: 18%; animation-delay: 0s; }
.ceremony-petal-2 { top: 8%; right: 20%; animation-delay: 2s; transform: rotate(12deg); }
.ceremony-petal-3 { bottom: 16%; left: 12%; animation-delay: 4s; transform: rotate(-8deg); }
.ceremony-petal-4 { bottom: 10%; right: 16%; animation-delay: 6s; transform: rotate(16deg); }

@keyframes petal-drift {
    0% { transform: translate3d(0,0,0) rotate(0deg); opacity: 0.65; }
    30% { transform: translate3d(-6px, 12px, 0) rotate(-6deg); opacity: 0.8; }
    60% { transform: translate3d(8px, -10px, 0) rotate(8deg); opacity: 0.7; }
    100% { transform: translate3d(12px, 6px, 0) rotate(12deg); opacity: 0.6; }
}

.ceremony-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--soft-gold);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-twinkle 2s ease-in-out infinite, shimmer 6s ease-in-out infinite;
    box-shadow: 0 0 8px var(--soft-gold), 0 0 12px var(--light-gold);
    z-index: 1;
}

.ceremony-sparkle:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.ceremony-sparkle:nth-child(2) { top: 15%; right: 8%; animation-delay: 0.5s; }
.ceremony-sparkle:nth-child(3) { bottom: 20%; left: 10%; animation-delay: 1s; }
.ceremony-sparkle:nth-child(4) { bottom: 10%; right: 5%; animation-delay: 1.5s; }

@keyframes shimmer {
    0% { filter: drop-shadow(0 0 6px rgba(232, 213, 183, 0.5)); }
    50% { filter: drop-shadow(0 0 12px rgba(232, 213, 183, 0.8)); }
    100% { filter: drop-shadow(0 0 6px rgba(232, 213, 183, 0.5)); }
}

/* Lightbox Specific Transitions */
#galleryLightbox {
    will-change: opacity;
    backface-visibility: hidden;
}

#lightboxImage {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    will-change: transform, opacity;
}

#galleryLightbox.opacity-100 #lightboxImage.scale-100 {
    transform: scale(1);
}

#galleryLightbox.opacity-100 #lightboxImage.scale-95 {
    transform: scale(0.95);
}

/**
 * Language Visibility System
 * Uses CSS classes on body element to toggle between Vietnamese and English content
 * High specificity to override Tailwind CSS if needed
 */

/* Default state: Show Vietnamese, hide English */
body.template-wedding .lang-vi { 
    display: block !important; 
}

body.template-wedding .lang-en { 
    display: none !important; 
}

/* Inline elements (spans in navigation, links) */
body.template-wedding span.lang-vi,
body.template-wedding a .lang-vi {
    display: inline !important;
}

body.template-wedding span.lang-en,
body.template-wedding a .lang-en {
    display: none !important;
}

/* English state: Show English, hide Vietnamese */
body.template-wedding.lang-en .lang-vi { 
    display: none !important; 
}

body.template-wedding.lang-en .lang-en { 
    display: block !important; 
}

body.template-wedding.lang-en span.lang-en,
body.template-wedding.lang-en a .lang-en {
    display: inline !important;
}
