/* 
 * LOS - Logistics One Source
 * Animations Stylesheet
 */

/* ===== Fade In Animation ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* ===== Slide In Animations ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

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

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

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

.slide-in-up {
    animation: slideInUp 0.8s ease forwards;
}

/* ===== Scale Animations ===== */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.8s ease forwards;
}

/* ===== Bounce Animation ===== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* ===== Pulse Animation ===== */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== Rotate Animation ===== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* ===== Shake Animation ===== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.8s ease;
}

/* ===== Typing Animation ===== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

.typing-cursor {
    position: relative;
}

.typing-cursor::after {
    content: '|';
    position: absolute;
    right: -8px;
    color: var(--accent-color);
    animation: blink-caret 0.75s step-end infinite;
}

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

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: var(--box-shadow-hover);
}

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

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

/* ===== Button Animations ===== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

.btn-ripple:hover::after {
    width: 300%;
    height: 300%;
}

/* ===== Scroll Animations ===== */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.scroll-fade-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Staggered Animations ===== */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.visible {
    animation: staggerFadeIn 0.5s ease forwards;
}

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

/* Apply different delays to staggered items */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* ===== Loading Animations ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

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

/* ===== Animated Underline ===== */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 100%;
}

/* ===== Gradient Animation ===== */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animation {
    background: linear-gradient(270deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 600% 600%;
    animation: gradientFlow 10s ease infinite;
}

/* ===== Floating Animation ===== */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ===== 3D Flip Animation ===== */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(180deg);
    }
}

.flip {
    animation: flip 1s ease forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* ===== Reveal Text Animation ===== */
.reveal-text {
    position: relative;
    color: transparent;
}

.reveal-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    animation: revealText 1.5s ease forwards;
}

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

/* ===== Glitch Effect ===== */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-5px, 5px);
    }
    40% {
        transform: translate(-5px, -5px);
    }
    60% {
        transform: translate(5px, 5px);
    }
    80% {
        transform: translate(5px, -5px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.5s ease forwards;
}

/* ===== Spotlight Hover Effect ===== */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.spotlight:hover::before {
    opacity: 1;
}

/* ===== Scroll Down Indicator ===== */
.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--light-text);
    border-radius: 15px;
}

.scroll-down-indicator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    background-color: var(--light-text);
    border-radius: 50%;
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* ===== Blur In Animation ===== */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-in {
    animation: blurIn 1s ease forwards;
}

/* ===== Skew Animation ===== */
@keyframes skewIn {
    from {
        opacity: 0;
        transform: skewX(20deg) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: skewX(0) translateX(0);
    }
}

.skew-in {
    animation: skewIn 0.8s ease forwards;
}

/* ===== Zoom Animations ===== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.8s ease forwards;
}

@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-out {
    animation: zoomOut 0.8s ease forwards;
}

/* ===== Swing Animation ===== */
@keyframes swing {
    20% {
        transform: rotate3d(0, 0, 1, 15deg);
    }
    40% {
        transform: rotate3d(0, 0, 1, -10deg);
    }
    60% {
        transform: rotate3d(0, 0, 1, 5deg);
    }
    80% {
        transform: rotate3d(0, 0, 1, -5deg);
    }
    to {
        transform: rotate3d(0, 0, 1, 0deg);
    }
}

.swing {
    transform-origin: top center;
    animation: swing 1s ease;
}

/* ===== Heartbeat Animation ===== */
@keyframes heartbeat {
    from {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

/* ===== Wobble Animation ===== */
@keyframes wobble {
    from {
        transform: translate3d(0, 0, 0);
    }
    15% {
        transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }
    30% {
        transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
    }
    45% {
        transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
    }
    60% {
        transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
    }
    75% {
        transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

.wobble {
    animation: wobble 1s ease;
}

/* Update animation colors */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(242, 68, 59, 0.2),
                    0 0 10px rgba(242, 68, 59, 0.2),
                    0 0 15px rgba(242, 68, 59, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(242, 68, 59, 0.5),
                    0 0 20px rgba(242, 68, 59, 0.3),
                    0 0 30px rgba(242, 68, 59, 0.2);
    }
    100% {
        box-shadow: 0 0 5px rgba(242, 68, 59, 0.2),
                    0 0 10px rgba(242, 68, 59, 0.2),
                    0 0 15px rgba(242, 68, 59, 0.2);
    }
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(242, 68, 59, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(242, 68, 59, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(242, 68, 59, 0);
    }
}

@keyframes shine {
    0% {
        background-position: -100px;
    }
    20% {
        background-position: 200px;
    }
    100% {
        background-position: 200px;
    }
}

/* Hover animations */
.btn-shine {
    background: linear-gradient(to right, var(--accent-color) 0%, var(--accent-hover) 50%, var(--accent-color) 100%);
}

.btn-glow:hover {
    animation: glow 1.5s ease-in-out infinite;
}

.btn-pulse:hover {
    animation: buttonPulse 1.5s infinite;
}

/* Loading animations */
.loading-ring {
    border-top-color: var(--accent-color);
}

.loading-dots div {
    background: var(--accent-color);
}

/* Progress bar animation */
.progress-bar {
    background: linear-gradient(45deg, 
        var(--accent-color) 25%, 
        var(--accent-hover) 50%, 
        var(--accent-color) 75%
    );
    background-size: 200% 100%;
    animation: shine 3s infinite linear;
}

/* Ripple animation */
.ripple-effect {
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 100%);
} 