/* 
* Cube Web Technologies - Animations Stylesheet
* Contains advanced animations, transitions, and hover effects 
*/

/* Fade and Slide Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Zoom Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Attention Grabbing Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Rotate Animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.3);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Slide Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Special Effect Animations */
@keyframes floatX {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(15px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes floatY {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

@keyframes scaleDown {
    from {
        transform: scale(1.2);
    }
    to {
        transform: scale(1);
    }
}

/* Button Effect Animations */
@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Ripple Animation for Buttons */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Header Animation */
.animate-header {
    animation: headerScale 0.3s ease-out;
}

@keyframes headerScale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* AOS-style Animation Classes */
.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

.fade-up {
    animation-name: fadeInUp;
}

.fade-right {
    animation-name: fadeInRight;
}

.fade-left {
    animation-name: fadeInLeft;
}

.fade-down {
    animation-name: fadeInDown;
}

.zoom-in {
    animation-name: zoomIn;
}

/* Utility Animation Classes */
.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-float-x {
    animation: floatX 3s ease-in-out infinite;
}

.animate-float-y {
    animation: floatY 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 8s linear infinite;
}

/* Button Animation State */
.btn-pulse {
    animation: btnPulse 0.8s;
}

/* Hover Animation Utilities */
.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
}

/* Image Hover Effects */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

.img-hover-color {
    overflow: hidden;
}

.img-hover-color img {
    transition: filter 0.5s ease;
    filter: grayscale(100%);
}

.img-hover-color:hover img {
    filter: grayscale(0%);
}

/* Text Animation Utilities */
.text-gradient {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-shadow-glow {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Loading Animations */
@keyframes loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: loader-spin 1s linear infinite;
}

/* Page Transition Animations */
.page-transition-enter {
    opacity: 0;
}

.page-transition-enter-active {
    opacity: 1;
    transition: opacity 300ms;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 300ms;
}

/* Media Queries for Animations */
@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;
    }
    
    .animated, 
    .animate-pulse, 
    .animate-bounce, 
    .animate-float-x, 
    .animate-float-y, 
    .animate-rotate {
        animation: none !important;
    }
    
    .hover-grow:hover,
    .hover-lift:hover,
    .hover-glow:hover,
    .img-hover-zoom:hover img,
    .img-hover-color:hover img {
        transform: none !important;
        box-shadow: none !important;
        filter: none !important;
    }
}

/* Animation styles for the website */

/* Scroll reveal animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Text animations for page banners */
.animated-text {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeSlideUp 0.8s ease-out forwards;
}

.animated-text-delay {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeSlideUp 0.8s ease-out 0.3s forwards;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover animation */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    left: 0;
}

/* Animated underline for links */
.animated-link {
    position: relative;
}

.animated-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.animated-link:hover::after {
    width: 100%;
} 