/* Keyframe Animations */

/* Bubble Float Animation */
@keyframes bubbleFloat {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* Title Glow Animation */
@keyframes titleGlow {
    0% { 
        text-shadow: 0 0 30px rgba(0, 119, 182, 0.8), 0 0 60px rgba(0, 180, 216, 0.4), 0 0 90px rgba(0, 245, 255, 0.2);
        transform: scale(1);
    }
    100% { 
        text-shadow: 0 0 50px rgba(0, 119, 182, 1), 0 0 80px rgba(0, 180, 216, 0.6), 0 0 120px rgba(0, 245, 255, 0.4);
        transform: scale(1.02);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wave Movement Animation */
@keyframes waveMove {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-30px) scale(1.02); }
    50% { transform: translateX(-60px) scale(0.98); }
    75% { transform: translateX(-30px) scale(1.01); }
}

/* Floating Animation */
@keyframes floating {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(1deg); }
    50% { transform: translateY(-20px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(-1deg); }
}

/* Particle Float Animation */
@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) translateX(20px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) translateX(100px) scale(1);
    }
    100% {
        transform: translateY(-10vh) translateX(120px) scale(0);
        opacity: 0;
    }
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 180, 216, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 180, 216, 0.6);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scale Animation */
@keyframes scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Particles System */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(0, 180, 216, 0.8);
    border-radius: 50%;
    animation: particleFloat 20s infinite linear;
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.5);
}

/* Hover Effects */
.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.6);
    transition: box-shadow 0.3s ease;
}

.hover-slide:hover {
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 180, 216, 0.3);
    border-top: 4px solid #00b4d8;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: #00b4d8;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

/* Text Animations */
.text-glow {
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.text-typewriter {
    overflow: hidden;
    border-right: 2px solid #00b4d8;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00b4d8; }
}

/* Entrance Animations */
.animate-fade-in {
    animation: fadeInUp 1s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 1s ease-out;
}

.animate-slide-right {
    animation: slideInRight 1s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 1s ease-out;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Delayed Animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Background Animations */
.animated-gradient {
    background: linear-gradient(-45deg, #001d3d, #003566, #0077b6, #00b4d8);
    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%; }
}

/* Interactive Animations */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 180, 216, 0.3);
}

.button-hover {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.button-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button-hover:hover::before {
    left: 100%;
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Animation States */
.paused {
    animation-play-state: paused;
}

.playing {
    animation-play-state: running;
}

/* Reduced Motion Respect */
@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;
    }
    
    .floating,
    .particles,
    .animated-gradient {
        animation: none;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}