/* ============================================
   WEDDING INVITATION - ANIMATIONS
   Advanced keyframe animations and effects
   ============================================ */

/* ============================================
   SEAL BREAKING ANIMATION
   ============================================ */
.seal-breaking {
    animation: sealBreak 1.5s ease forwards;
}

@keyframes sealBreak {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.2) rotate(5deg);
    }
    50% {
        transform: scale(1.3) rotate(-3deg);
    }
    70% {
        transform: scale(0.8) rotate(10deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
    }
}

/* Seal crack effect */
.seal-crack {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.seal-crack::before,
.seal-crack::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    animation: crackSpread 0.5s ease-out forwards;
}

@keyframes crackSpread {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 2px;
        opacity: 0;
    }
}

/* Wax pieces flying */
.wax-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-wax-red);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: waxFly 1s ease-out forwards;
}

@keyframes waxFly {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 100px), var(--ty, -100px)) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* ============================================
   PARCHMENT UNROLLING
   ============================================ */
.parchment-unroll {
    animation: unrollParchment 2s ease-out forwards;
    transform-origin: top center;
}

@keyframes unrollParchment {
    0% {
        transform: scaleY(0) rotateX(90deg);
        opacity: 0;
    }
    50% {
        transform: scaleY(0.5) rotateX(45deg);
        opacity: 0.5;
    }
    100% {
        transform: scaleY(1) rotateX(0deg);
        opacity: 1;
    }
}

/* ============================================
   TEXT REVEAL ANIMATIONS
   ============================================ */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: textRevealUp 0.8s ease forwards;
    animation-delay: var(--delay, 0s);
    opacity: 0;
    transform: translateY(100%);
}

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

/* Letter by letter reveal */
.letter-reveal {
    display: inline-block;
    animation: letterReveal 0.5s ease forwards;
    animation-delay: var(--letter-delay, 0s);
    opacity: 0;
    transform: translateY(20px) rotateX(-90deg);
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-gold);
    white-space: nowrap;
    animation:
        typing 3.5s steps(40, end),
        blinkCaret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCaret {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-gold); }
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */
.float-gentle {
    animation: floatGentle 6s ease-in-out infinite;
}

@keyframes floatGentle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(0.5deg);
    }
}

.float-strong {
    animation: floatStrong 4s ease-in-out infinite;
}

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

/* Bobbing like a ship */
.ship-bob {
    animation: shipBob 5s ease-in-out infinite;
}

@keyframes shipBob {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    25% {
        transform: translateY(-8px) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(2deg);
    }
    75% {
        transform: translateY(-12px) rotate(0deg);
    }
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */
.parallax-slow {
    will-change: transform;
    transition: transform 0.1s linear;
}

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

.parallax-fast {
    will-change: transform;
    transition: transform 0.02s linear;
}

/* ============================================
   GLOW & SHIMMER EFFECTS
   ============================================ */
.shimmer {
    position: relative;
    overflow: hidden;
}

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

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

/* Golden glow pulse */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 164, 71, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 164, 71, 0.6), 0 0 60px rgba(212, 164, 71, 0.3);
    }
}

/* Text glow */
.text-glow {
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(212, 164, 71, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(212, 164, 71, 0.8), 0 0 30px rgba(212, 164, 71, 0.5);
    }
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

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

.fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
}

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

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

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

.fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

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

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.8s ease forwards;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease forwards;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ============================================
   SCROLL INDICATOR ANIMATION
   ============================================ */
.scroll-arrow span {
    display: block;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--color-gold);
    border-right: 2px solid var(--color-gold);
    transform: rotate(45deg);
    margin: -8px auto;
    animation: scrollArrow 2s infinite;
}

.scroll-arrow span:nth-child(2) {
    animation-delay: -0.2s;
}

.scroll-arrow span:nth-child(3) {
    animation-delay: -0.4s;
}

@keyframes scrollArrow {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-10px, -10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) translate(10px, 10px);
    }
}

/* ============================================
   WAVE ANIMATIONS
   ============================================ */
.wave-parallax > use {
    animation: waveMove 25s cubic-bezier(.55,.5,.45,.5) infinite;
}

.wave-parallax > use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.wave-parallax > use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.wave-parallax > use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 13s;
}

.wave-parallax > use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 20s;
}

@keyframes waveMove {
    0% {
        transform: translate3d(-90px, 0, 0);
    }
    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* ============================================
   COUNTDOWN ANIMATIONS
   ============================================ */
.countdown-flip {
    animation: countdownFlip 0.6s ease-in-out;
}

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

/* ============================================
   HEART ANIMATIONS
   ============================================ */
.heart-beat {
    animation: heartBeat 1.2s ease-in-out infinite;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

/* Floating hearts */
.floating-heart {
    position: absolute;
    animation: heartFloat 4s ease-in-out infinite;
    opacity: 0;
}

@keyframes heartFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-80px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* ============================================
   ORNAMENT ANIMATIONS
   ============================================ */
.ornament-draw {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawOrnament 2s ease forwards;
}

@keyframes drawOrnament {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   IMAGE FRAME EFFECTS
   ============================================ */
.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--color-gold);
    border-style: solid;
    transition: all var(--transition-medium);
}

.frame-corner.tl {
    top: -5px;
    left: -5px;
    border-width: 3px 0 0 3px;
}

.frame-corner.tr {
    top: -5px;
    right: -5px;
    border-width: 3px 3px 0 0;
}

.frame-corner.bl {
    bottom: -5px;
    left: -5px;
    border-width: 0 0 3px 3px;
}

.frame-corner.br {
    bottom: -5px;
    right: -5px;
    border-width: 0 3px 3px 0;
}

/* Hover effect */
.image-frame:hover .frame-corner {
    width: 40px;
    height: 40px;
}

.image-frame:hover .frame-corner.tl {
    top: -10px;
    left: -10px;
}

.image-frame:hover .frame-corner.tr {
    top: -10px;
    right: -10px;
}

.image-frame:hover .frame-corner.bl {
    bottom: -10px;
    left: -10px;
}

.image-frame:hover .frame-corner.br {
    bottom: -10px;
    right: -10px;
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

button:hover .btn-shine {
    left: 100%;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   PLAY BUTTON ANIMATION
   ============================================ */
.play-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    animation: playRipple 1.5s ease-out infinite;
}

@keyframes playRipple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(212, 164, 71, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.event-card:hover .card-glow {
    opacity: 1;
}

/* ============================================
   SUCCESS ANIMATION
   ============================================ */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--color-gold);
    stroke-miterlimit: 10;
    animation: successFill 0.4s ease-in-out 0.4s forwards, successScale 0.3s ease-in-out 0.9s both;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--color-gold);
    fill: none;
    animation: successStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: successStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

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

@keyframes successScale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes successFill {
    100% {
        box-shadow: inset 0 0 0 30px rgba(212, 164, 71, 0.1);
    }
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */
.transition-none { transition: none !important; }
.transition-fast { transition: all var(--transition-fast) !important; }
.transition-medium { transition: all var(--transition-medium) !important; }
.transition-slow { transition: all var(--transition-slow) !important; }

/* ============================================
   VIP WELCOME SCREEN
   ============================================ */
.vip-welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%),
                radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.vip-welcome-content {
    text-align: center;
    color: #1a1a2e;
    max-width: 500px;
}

.vip-welcome-badge {
    margin-bottom: 2rem;
}

.vip-star-large {
    width: 120px;
    height: 120px;
    color: #ffd700;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    animation: vip-star-glow 2s ease-in-out infinite;
}

@keyframes vip-star-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
}

.vip-welcome-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin: 1rem 0;
    font-family: 'Cinzel Decorative', serif;
    color: #b8968b;
}

.vip-welcome-subtitle {
    font-size: 1.2rem;
    color: #ffd700;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.vip-welcome-message {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.8;
    font-style: italic;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.5px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
