/* ScholarUnlock Professional Animations */

:root {
    /* Animation Colors */
    --anim-primary: #2563eb;
    --anim-secondary: #60a5fa;
    --anim-accent: #0ea5e9;
    --anim-glow: rgba(37, 99, 235, 0.4);
    --anim-glow-intense: rgba(37, 99, 235, 0.6);
    --anim-shimmer: rgba(96, 165, 250, 0.1);
}

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

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px var(--anim-glow);
        transform: scale(1);
        text-shadow: 0 0 20px var(--anim-glow);
    }
    50% { 
        box-shadow: 0 0 30px var(--anim-glow-intense);
        transform: scale(1.02);
        text-shadow: 0 0 30px var(--anim-glow-intense);
    }
}

/* Additional pulse animation for text */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

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

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

@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 fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #9896ff; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes rotate-360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes particles {
    0% {
        transform: translateY(0px) translateX(0px) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) scale(1);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes morph-blob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate3d(0, 0, 0) rotateZ(0deg);
    }
    20% {
        border-radius: 40% 60% 70% 30% / 50% 60% 40% 50%;
        transform: translate3d(-5px, 5px, 0) rotateZ(90deg);
    }
    40% {
        border-radius: 70% 30% 50% 50% / 30% 50% 50% 70%;
        transform: translate3d(5px, -5px, 0) rotateZ(180deg);
    }
    60% {
        border-radius: 30% 70% 40% 60% / 70% 40% 60% 30%;
        transform: translate3d(-2px, 2px, 0) rotateZ(270deg);
    }
    80% {
        border-radius: 50% 50% 60% 40% / 40% 70% 30% 60%;
        transform: translate3d(3px, -3px, 0) rotateZ(360deg);
    }
}

@keyframes float-up-down {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) translateX(5px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) translateX(-3px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) translateX(2px) rotate(1deg);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes wave {
    0% {
        d: path("M 0,100 Q 150,50 300,100 T 600,100 V 300 H 0 V 100 Z");
    }
    50% {
        d: path("M 0,100 Q 150,150 300,100 T 600,100 V 300 H 0 V 100 Z");
    }
    100% {
        d: path("M 0,100 Q 150,50 300,100 T 600,100 V 300 H 0 V 100 Z");
    }
}

@keyframes logo-morph {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(90deg);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: scale(0.95) rotate(180deg);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: scale(1.02) rotate(270deg);
        filter: hue-rotate(270deg);
    }
}

@keyframes text-reveal {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

@keyframes particle-float {
    0% {
        transform: translateY(0px) translateX(0px) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(0);
        opacity: 0;
    }
}

/* Advanced Animation Classes */
.morph-blob {
    animation: morph-blob 8s ease-in-out infinite;
}

.float-up-down {
    animation: float-up-down 6s ease-in-out infinite;
}

.pulse-ring {
    animation: pulse-ring 2s ease-out infinite;
}

.logo-morph {
    animation: logo-morph 10s ease-in-out infinite;
}

.text-reveal {
    animation: text-reveal 2s ease-out forwards;
    overflow: hidden;
    white-space: nowrap;
}

.particle-float {
    animation: particle-float 8s linear infinite;
}

/* Morphing Background Elements */
.morphing-bg {
    position: absolute;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.1) 0%, 
        rgba(59, 130, 246, 0.15) 50%, 
        rgba(14, 165, 233, 0.1) 100%);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
}

.morphing-bg:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -10%;
    left: -10%;
    animation: morph-blob 12s ease-in-out infinite;
}

.morphing-bg:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    animation: morph-blob 8s ease-in-out infinite reverse;
}

.morphing-bg:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 30%;
    animation: morph-blob 15s ease-in-out infinite;
    animation-delay: -5s;
}

/* Floating Particles */
.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--anim-secondary);
    border-radius: 50%;
    opacity: 0.7;
}

.floating-particle:nth-child(1) {
    left: 10%;
    animation: particle-float 12s linear infinite;
    animation-delay: 0s;
}

.floating-particle:nth-child(2) {
    left: 20%;
    animation: particle-float 14s linear infinite;
    animation-delay: -2s;
}

.floating-particle:nth-child(3) {
    left: 40%;
    animation: particle-float 10s linear infinite;
    animation-delay: -4s;
}

.floating-particle:nth-child(4) {
    left: 60%;
    animation: particle-float 16s linear infinite;
    animation-delay: -6s;
}

.floating-particle:nth-child(5) {
    left: 80%;
    animation: particle-float 13s linear infinite;
    animation-delay: -8s;
}

/* Interactive Elements */
.interactive-element {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.glow-on-hover {
    position: relative;
    overflow: hidden;
}

.glow-on-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;
}

.glow-on-hover:hover::before {
    left: 100%;
}

/* Utility Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
}

.slide-up-on-scroll {
    transform: translateY(50px);
}

.slide-up-on-scroll.animated {
    transform: translateY(0);
}

.slide-left-on-scroll {
    transform: translateX(-50px);
}

.slide-left-on-scroll.animated {
    transform: translateX(0);
}

.slide-right-on-scroll {
    transform: translateX(50px);
}

.slide-right-on-scroll.animated {
    transform: translateX(0);
}

.scale-on-scroll {
    transform: scale(0.9);
}

.scale-on-scroll.animated {
    transform: scale(1);
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--anim-shimmer);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--anim-glow);
    border-color: var(--anim-secondary);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Stagger Animation for Children */
.stagger-children .stagger-item {
    transition-delay: calc(var(--stagger-delay, 0.1s) * var(--stagger-index, 0));
}

.stagger-children .stagger-item:nth-child(1) { --stagger-index: 1; }
.stagger-children .stagger-item:nth-child(2) { --stagger-index: 2; }
.stagger-children .stagger-item:nth-child(3) { --stagger-index: 3; }
.stagger-children .stagger-item:nth-child(4) { --stagger-index: 4; }
.stagger-children .stagger-item:nth-child(5) { --stagger-index: 5; }
.stagger-children .stagger-item:nth-child(6) { --stagger-index: 6; }

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.6) 25%, rgba(30, 41, 59, 0.8) 50%, rgba(15, 23, 42, 0.6) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-on-scroll {
        transition-duration: 0.4s;
    }
    
    @keyframes particles {
        100% {
            transform: translateY(-50vh) translateX(25px) scale(0.8);
            opacity: 0;
        }
    }
}

/* Performance Optimizations */
.animate-on-scroll,
.service-card,
.cta-button {
    will-change: transform;
}

.service-card:hover {
    will-change: auto;
}

/* Reduced Motion Support */
@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;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .typewriter-text {
        border-right: none !important;
        animation: none !important;
    }
    
    .gradient-orb {
        animation: none !important;
    }
}