/* ================================
   Animations & Transitions
   ================================ */

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

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Slide In Up Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ================================
   Animation Classes
   ================================ */

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

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

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

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

/* ================================
   Scroll-triggered Animations
   ================================ */

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Stagger delays for sequential animations */
.scroll-animate:nth-child(1) { transition-delay: 0s; }
.scroll-animate:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate:nth-child(3) { transition-delay: 0.2s; }
.scroll-animate:nth-child(4) { transition-delay: 0.3s; }
.scroll-animate:nth-child(5) { transition-delay: 0.4s; }
.scroll-animate:nth-child(6) { transition-delay: 0.5s; }
.scroll-animate:nth-child(7) { transition-delay: 0.6s; }

/* ================================
   Hover Effects
   ================================ */

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

.hover-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.2), rgba(16, 185, 129, 0.2));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hover-glow:hover::after {
    opacity: 1;
}

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

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

/* ================================
   Loading & Skeleton
   ================================ */

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ================================
   Page Transitions
   ================================ */

.page-transition {
    animation: fadeIn 0.4s ease-out;
}

/* ================================
   Hero Specific Animations
   ================================ */

.hero__title {
    animation: fadeInUp 0.8s ease-out;
}

.hero__subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero__cta {
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero__visual {
    animation: fadeInRight 1s ease-out 0.3s backwards;
}

.hero__dashboard-preview {
    animation: float 6s ease-in-out infinite;
}

/* ================================
   Mobile Menu Animations
   ================================ */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.nav__menu.mobile-open {
    animation: slideInRight 0.3s ease-out;
}

/* ================================
   Modal Animations
   ================================ */

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal {
    animation: modalFadeIn 0.3s ease-out;
}

.modal__content {
    animation: modalSlideIn 0.4s ease-out;
}

/* ================================
   Card Animations
   ================================ */

.benefit-card,
.solution-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.benefit-card:hover,
.solution-card:hover {
    transform: translateY(-8px);
}

/* ================================
   Button Animations
   ================================ */

.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* ================================
   Scroll Indicators
   ================================ */

.hero__scroll-indicator {
    animation: bounce 2s ease-in-out infinite;
}

/* ================================
   Form Animations
   ================================ */

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    animation: pulse 0.3s ease-out;
}

@keyframes inputPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(30, 64, 175, 0);
    }
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    animation: inputPulse 0.6s ease-out;
}

/* ================================
   Success/Error Animations
   ================================ */

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form__message--success,
.form__message--error {
    animation: successSlideIn 0.4s ease-out;
}

/* ================================
   Progress Indicators
   ================================ */

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

.progress-bar {
    position: relative;
    overflow: hidden;
    background: #e0e0e0;
    border-radius: 9999px;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 25%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: progress 1.5s infinite;
}

/* ================================
   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-animate {
        opacity: 1;
        transform: none;
    }
}
