/**
 * Animation styles for UnBlockedU theme
 */

/* Scroll reveal animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

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

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

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

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

.fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.animate {
    opacity: 1;
}

/* Service card hover animations */
.service-card {
    transform-origin: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    animation: serviceCardFloat 0.6s ease-out forwards;
}

@keyframes serviceCardFloat {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 8px 32px rgba(30, 58, 138, 0.1);
    }
    50% {
        transform: translateY(-8px) scale(1.01);
    }
    100% {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 25px 50px rgba(30, 58, 138, 0.25), 0 0 30px rgba(255, 107, 53, 0.2);
    }
}

/* Button animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* Header animations */
.site-header {
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.hidden {
    transform: translateY(-100%);
}

.site-header.scrolled {
    animation: headerSlideIn 0.3s ease-out;
}

@keyframes headerSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile menu animations */
.main-nav {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle .hamburger-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Dropdown menu animations */
.sub-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-menu.show,
.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Loading animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Particle animations */
@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

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

/* Text animations */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--unblockedu-orange);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--unblockedu-orange);
    }
}

/* Stagger animations */
.stagger-animation > * {
    animation-delay: calc(var(--stagger-delay, 0.1s) * var(--stagger-index, 0));
}

/* 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;
    }
    
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* Focus animations for accessibility */
.btn:focus,
.nav-menu a:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--unblockedu-cyan);
    outline-offset: 2px;
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 191, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 191, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 191, 255, 0);
    }
}

/* Mobile specific animations */
@media (max-width: 767px) {
    .fade-in-up,
    .fade-in-left,
    .fade-in-right {
        transform: translateY(20px);
    }
    
    .fade-in-left {
        transform: translateY(20px);
    }
    
    .fade-in-right {
        transform: translateY(20px);
    }
    
    .service-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
}