/* ==========================================================================
   Animations & Preloader
   ========================================================================== */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.star-icon {
    width: 50px;
    height: 50px;
    color: var(--color-text-light);
    animation: rotate 4s linear infinite;
}

.loading-text {
    color: var(--color-text-light);
    font-family: var(--font-heading);
    letter-spacing: 0.2em;
    font-size: 0.875rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Marquee Animation */
@keyframes marqueeLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.marquee-left .marquee-content {
    animation: marqueeLeft 30s linear infinite;
    /* Ensure content is duplicated enough to seamlessly loop */
    width: max-content;
}

.marquee-right .marquee-content {
    animation: marqueeRight 30s linear infinite;
    width: max-content;
}

/* Initial States for GSAP Animations */
.hero-title .line-inner {
    transform: translateY(100%);
}

.hero-subtitle p {
    opacity: 0;
    transform: translateY(20px);
}

.about-text p {
    opacity: 0;
    transform: translateY(30px);
}

.stat-row {
    opacity: 0;
    transform: translateX(-30px);
}

.partner-card {
    opacity: 0;
    transform: translateY(30px);
}

/* Reduces motion if requested by user */
@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;
    }
    
    .preloader {
        display: none !important;
    }
    
    .hero-title .line-inner,
    .hero-subtitle p,
    .about-text p,
    .stat-row,
    .partner-card {
        opacity: 1 !important;
        transform: none !important;
    }
}
