/* Advanced Animations and Interactive Effects */

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

.hero-section h1 {
    animation: fadeInUp 1s ease-out, float 3s ease-in-out infinite 2s;
}

/* Staggered Animation for Content Sections */
.content-section:nth-child(odd) {
    animation-delay: 0.2s;
}

.content-section:nth-child(even) {
    animation-delay: 0.4s;
}

/* Advanced Image Hover Effects */
.image-container {
    position: relative;
    overflow: hidden;
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
    z-index: 2;
}

.image-container:hover::before {
    left: 100%;
}

.image-container img {
    transition: all 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.1) saturate(1.3) contrast(1.1);
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-container h2 {
    animation: textReveal 0.8s ease-out;
}

.text-container p {
    animation: textReveal 0.8s ease-out 0.2s both;
}

.text-container li {
    animation: textReveal 0.8s ease-out 0.4s both;
}

/* Reason Cards Advanced Animations */
.reason-card {
    position: relative;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

.reason-card:nth-child(1) { animation-delay: 0.1s; }
.reason-card:nth-child(2) { animation-delay: 0.2s; }
.reason-card:nth-child(3) { animation-delay: 0.3s; }
.reason-card:nth-child(4) { animation-delay: 0.4s; }
.reason-card:nth-child(5) { animation-delay: 0.5s; }
.reason-card:nth-child(6) { animation-delay: 0.6s; }
.reason-card:nth-child(7) { animation-delay: 0.7s; }

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

.reason-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.reason-card:hover::before {
    left: 100%;
}

/* Button Pulse Animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.btn-cta {
    animation: pulse 2s infinite;
}

.btn-cta:hover {
    animation: none;
}

/* Progress Bar Animation */
.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Scroll-triggered Animations */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

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

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

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

/* Highlight Box Animations */
.highlight-box {
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Table of Contents Hover Effects */
.table-of-contents li {
    position: relative;
    padding-left: 20px;
    transition: all 0.3s ease;
}

.table-of-contents li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #667eea;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.table-of-contents li:hover::before {
    transform: scale(1);
}

.table-of-contents li:hover {
    padding-left: 25px;
    color: #764ba2;
}

/* Loading Animation for Images */
.image-loading {
    position: relative;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Parallax Effect for Background Elements */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    z-index: -1;
    transform: translateZ(0);
}

/* Micro-interactions */
.text-container h2::after {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.content-section.visible .text-container h2::after {
    transform: scaleX(1);
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .content-section {
        animation: mobileSlideIn 0.8s ease-out;
    }
    
    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .reason-card {
        animation: mobileCardSlide 0.6s ease-out forwards;
    }
    
    @keyframes mobileCardSlide {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #764ba2, #667eea);
}
