/* ============================================
   ANIMATIONS - Fundo do Mar
   ============================================ */

/* ============================================
   ONDULAÇÃO DO OCEANO
   ============================================ */
@keyframes oceanWave {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3%);
    }
}

/* ============================================
   RAIOS DE LUZ
   ============================================ */
@keyframes raysPulse {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        opacity: 0.95;
        transform: translateX(-50%) scaleY(1.02);
    }
}

/* ============================================
   ALGAS BALANÇANDO
   ============================================ */
@keyframes seaweedSway {
    0%, 100% {
        transform: rotate(-2deg) skewX(0deg);
    }
    25% {
        transform: rotate(1.5deg) skewX(2deg);
    }
    50% {
        transform: rotate(-1deg) skewX(-1deg);
    }
    75% {
        transform: rotate(2deg) skewX(1deg);
    }
}

/* ============================================
   ESTRELAS
   ============================================ */
@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(15deg);
    }
}

@keyframes starfishFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

/* ============================================
   CONCHAS
   ============================================ */
@keyframes shellFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(2deg);
    }
}

/* ============================================
   PEIXES NADANDO - Da esquerda para direita
   ============================================ */
@keyframes fishSwim {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0;
    }
    3% {
        opacity: 0.4;
    }
    25% {
        transform: translateX(calc(25vw + 30px)) translateY(-10px);
    }
    50% {
        transform: translateX(calc(50vw + 60px)) translateY(5px);
    }
    75% {
        transform: translateX(calc(75vw + 90px)) translateY(-8px);
    }
    97% {
        opacity: 0.4;
    }
    100% {
        transform: translateX(calc(100vw + 120px)) translateY(0);
        opacity: 0;
    }
}

/* ============================================
   BOLHAS - Subindo suavemente com movimento lateral
   ============================================ */
@keyframes bubbleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.5;
    }
    15% {
        transform: translateY(-15vh) translateX(12px) scale(1.08);
        opacity: 0.65;
    }
    30% {
        transform: translateY(-30vh) translateX(-8px) scale(1.02);
        opacity: 0.6;
    }
    45% {
        transform: translateY(-45vh) translateX(15px) scale(1.05);
        opacity: 0.55;
    }
    60% {
        transform: translateY(-60vh) translateX(-10px) scale(0.98);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-75vh) translateX(8px) scale(0.95);
        opacity: 0.4;
    }
    90% {
        transform: translateY(-90vh) translateX(-5px) scale(0.92);
        opacity: 0.25;
    }
    100% {
        transform: translateY(-105vh) translateX(0) scale(0.9);
        opacity: 0;
    }
}

/* Bolhas com movimento diferente */
@keyframes bubbleFloat2 {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.45;
    }
    20% {
        transform: translateY(-20vh) translateX(-10px) scale(1.1);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-40vh) translateX(12px) scale(1.03);
        opacity: 0.55;
    }
    60% {
        transform: translateY(-60vh) translateX(-15px) scale(1.06);
        opacity: 0.5;
    }
    80% {
        transform: translateY(-80vh) translateX(6px) scale(0.95);
        opacity: 0.35;
    }
    100% {
        transform: translateY(-105vh) translateX(-3px) scale(0.88);
        opacity: 0;
    }
}

/* ============================================
   PARTÍCULAS DOURADAS - Brilho flutuante
   ============================================ */
@keyframes goldenFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 0.7;
        filter: brightness(1);
    }
    15% {
        transform: translateY(-15vh) translateX(8px) rotate(60deg) scale(1.2);
        opacity: 0.95;
        filter: brightness(1.3);
    }
    30% {
        transform: translateY(-30vh) translateX(-5px) rotate(120deg) scale(1.05);
        opacity: 0.85;
        filter: brightness(1.1);
    }
    45% {
        transform: translateY(-45vh) translateX(10px) rotate(180deg) scale(1.15);
        opacity: 0.9;
        filter: brightness(1.4);
    }
    60% {
        transform: translateY(-60vh) translateX(-8px) rotate(240deg) scale(1);
        opacity: 0.75;
        filter: brightness(1.2);
    }
    75% {
        transform: translateY(-75vh) translateX(5px) rotate(300deg) scale(0.95);
        opacity: 0.6;
        filter: brightness(1);
    }
    90% {
        transform: translateY(-90vh) translateX(-3px) rotate(340deg) scale(0.9);
        opacity: 0.35;
        filter: brightness(0.9);
    }
    100% {
        transform: translateY(-105vh) translateX(0) rotate(360deg) scale(0.85);
        opacity: 0;
        filter: brightness(0.8);
    }
}

/* Partículas douradas alternativas */
@keyframes goldenFloat2 {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-25vh) translateX(-12px) scale(1.3);
        opacity: 1;
    }
    50% {
        transform: translateY(-50vh) translateX(8px) scale(1.1);
        opacity: 0.85;
    }
    75% {
        transform: translateY(-75vh) translateX(-6px) scale(0.9);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-105vh) translateX(0) scale(0.8);
        opacity: 0;
    }
}

/* ============================================
   ESTILOS DAS PARTÍCULAS
   ============================================ */

/* Bolhas de água */
.bubble {
    position: absolute;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(200, 230, 255, 0.45) 25%,
        rgba(150, 210, 245, 0.25) 50%,
        rgba(100, 180, 230, 0.1) 100%
    );
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        inset -2px -2px 4px rgba(255, 255, 255, 0.35),
        0 0 10px rgba(150, 200, 240, 0.15);
    animation: bubbleFloat linear infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Partículas douradas */
.golden-particle {
    position: absolute;
    background: radial-gradient(circle,
        rgba(255, 235, 120, 1) 0%,
        rgba(255, 215, 0, 0.85) 25%,
        rgba(212, 175, 55, 0.5) 55%,
        rgba(212, 175, 55, 0) 100%
    );
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    animation: goldenFloat ease-in-out infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ============================================
   DICA DE CLIQUE
   ============================================ */
@keyframes hintPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-3px);
    }
}

/* ============================================
   SELO BRILHANDO
   ============================================ */
@keyframes sealShimmer {
    0%, 100% {
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 15px rgba(212, 175, 55, 0.2));
    }
    50% {
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 25px rgba(212, 175, 55, 0.4));
    }
}

.wax-seal {
    animation: sealShimmer 3s ease-in-out infinite;
}

/* ============================================
   ENVELOPE FLUTUANDO
   ============================================ */
@keyframes envelopeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.envelope-wrapper:not(.opened) {
    animation: envelopeFloat 4s ease-in-out infinite;
}

/* ============================================
   ANIMAÇÕES DE CONTEÚDO
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    .envelope-wrapper:not(.opened) {
        animation: none;
    }

    .wax-seal {
        animation: none;
    }

    .bubble,
    .golden-particle {
        animation: none;
        opacity: 0.4;
    }

    .fish,
    .seaweed,
    .starfish,
    .shell {
        animation: none;
    }
}
