/* 
==============================================
ANIMATIONS STYLESHEET
Author: David Lupau
==============================================
*/

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Slide in from left animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

/* Slide in from right animation */
@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

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

.bounce {
    animation: bounce 1s;
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Color change animation */
@keyframes colorChange {
    0% {
        color: var(--primary);
    }
    50% {
        color: var(--secondary);
    }
    100% {
        color: var(--primary);
    }
}

.color-change {
    animation: colorChange 3s infinite;
}

/* Background color pulse */
@keyframes bgPulse {
    0% {
        background-color: rgba(242, 133, 0, 0.7);
    }
    50% {
        background-color: rgba(242, 133, 0, 0.9);
    }
    100% {
        background-color: rgba(242, 133, 0, 0.7);
    }
}

.bg-pulse {
    animation: bgPulse 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.5s;
}

/* Staggered animation for list items */
.stagger-item {
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

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

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Apply animations to specific elements */
.hero h1 {
    animation: fadeIn 1s ease-out;
    color: inherit; /* This ensures it inherits color from parent */
}

.hero h2 {
    animation: fadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
    color: inherit; /* This ensures it inherits color from parent */
}

.hero-buttons {
    animation: fadeIn 1s ease-out 0.6s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.section-title {
    animation: slideInLeft 0.5s ease-out;
}

.section-subtitle {
    animation: slideInRight 0.5s ease-out;
}

/* Disable animations for users who prefer reduced motion */
@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;
    }
}

/* Ensure animations work with dark mode */
[data-theme="dark"] .hero h1 {
    color: #ffffff !important; /* Force white text in dark mode */
}

[data-theme="dark"] .hero h2 {
    color: rgba(255, 255, 255, 0.8) !important; /* Force light text in dark mode */
}