/* Professional Animations & Effects for R3E */

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 113, 188, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 113, 188, 0.4);
    }
}

/* Scroll-triggered Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.animate-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Enhanced Button Styles */
.btn-primary {
    position: relative;
    background: linear-gradient(135deg, #0071BC 0%, #005A96 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 113, 188, 0.3);
}

.btn-primary::before {
    content: '';
    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;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 113, 188, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    position: relative;
    background: transparent;
    color: #0071BC;
    padding: 12px 30px;
    border-radius: 50px;
    border: 2px solid #0071BC;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #0071BC;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover {
    color: white;
}

.btn-secondary:hover::before {
    width: 100%;
}

/* Card Hover Effects */
.card-hover {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 2em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0071BC, #1E88E5, #60a5fa);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 113, 188, 0.2);
}

/* Image Hover Effects */
.image-hover-zoom {
    overflow: hidden;
    border-radius: 8px;
}

.image-hover-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-hover-zoom:hover img {
    transform: scale(1.1);
}

.image-hover-rotate {
    overflow: hidden;
    border-radius: 8px;
    perspective: 1000px;
}

.image-hover-rotate img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.image-hover-rotate:hover img {
    transform: rotateY(5deg) scale(1.05);
}

/* Text Effects */
.text-gradient {
    background: linear-gradient(135deg, #0071BC, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-glow {
    text-shadow: 0 0 20px rgba(0, 113, 188, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0071BC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Parallax Effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-content {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    padding: 4em 2em;
    backdrop-filter: blur(5px);
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #0071BC;
    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: #0071BC }
}

/* Blob Animation Background */
.blob-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #0071BC, #60a5fa);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #1E88E5, #0071BC);
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #60a5fa, #1E88E5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Navigation Scroll Effect */
#header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Section Transitions */
.section-transition {
    position: relative;
    padding: 80px 0;
}

.section-transition::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1));
    pointer-events: none;
}

/* Interactive Icons */
.icon-interactive {
    font-size: 2em;
    color: #0071BC;
    transition: all 0.3s ease;
    display: inline-block;
}

.icon-interactive:hover {
    transform: rotate(360deg) scale(1.2);
    color: #60a5fa;
}

/* Number Counter Animation */
.counter {
    font-size: 2.5em;
    font-weight: bold;
    color: #0071BC;
}

/* Progress Bar Animation */
.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0071BC, #60a5fa);
    border-radius: 3px;
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0;
    }
    to {
        width: var(--progress);
    }
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Neumorphism Effect */
.neumorphic {
    background: #f0f0f3;
    border-radius: 20px;
    box-shadow: 20px 20px 60px #cccccc, -20px -20px 60px #ffffff;
    padding: 2em;
    transition: all 0.3s ease;
}

.neumorphic:hover {
    box-shadow: inset 20px 20px 60px #cccccc, inset -20px -20px 60px #ffffff;
}

/* Keep sharp-corner treatment consistent on pages that load animations.css last */
body *,
body *::before,
body *::after {
    border-radius: 0 !important;
}
