/* Enhanced Animations - Images, Content, and Logo Motion */

/* ===== HEADER ANIMATIONS ===== */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    /*background: rgba(45, 45, 45, 0.95);*/
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ===== ENHANCED LOGO ANIMATIONS ===== */
.navbar-brand {
    position: relative;
    transition: all 0.4s ease;
    animation: logoEntrance 1s ease-out;
}

.navbar-brand img,
.navbar-brand .logo-text {
    transition: all 0.4s ease;
}

/* Logo hover effects with motion */
.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand:hover img,
.navbar-brand:hover .logo-text {
    transform: scale(1.1);
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(250, 67, 41, 0.3));
}

/* Logo floating animation */
.navbar-brand {
    animation: logoFloat 3s ease-in-out infinite;
}

/* Logo scroll effect */
.navbar.scrolled .navbar-brand {
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand img,
.navbar.scrolled .navbar-brand .logo-text {
    transform: scale(0.9);
    transition: all 0.3s ease;
}

/* Logo pulse effect on page load */
.navbar-brand.loaded {
    animation: logoPulse 2s ease-in-out;
}

/* Logo glow effect */
.navbar-brand::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(250, 67, 41, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.navbar-brand:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== IMAGE ANIMATIONS ===== */
/* Fade in images on scroll */
.animate-image {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.animate-image.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.animate-image.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Image hover effects */
.image-hover {
    transition: all 0.4s ease;
    overflow: hidden;
}

.image-hover img {
    transition: all 0.4s ease;
}

.image-hover:hover img {
    transform: scale(1.1);
    filter: brightness(1.1) contrast(1.1);
}

.image-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* White logo visibility fixes */
.marquee-item img,
.client-card img,
.partners-section img {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.marquee-item img:hover,
.client-card img:hover,
.partners-section img:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Image parallax effect */
.parallax-image {
    transition: transform 0.1s ease-out;
}

/* Image loading animation */
.image-loading {
    position: relative;
    overflow: hidden;
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: imageShimmer 1.5s infinite;
}

@keyframes imageShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== CONTENT ANIMATIONS ===== */
/* Section entrance animations */
.section-title {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.section-title.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.section-title.animated {
    opacity: 1;
    transform: translateY(0);
}

.section-title .brief {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s ease 0.2s;
}

.section-title.animate-on-scroll .brief {
    opacity: 0;
    transform: translateX(-30px);
}

.section-title.animated .brief {
    opacity: 1;
    transform: translateX(0);
}

.section-title .title {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s ease 0.4s;
}

.section-title.animate-on-scroll .title {
    opacity: 0;
    transform: translateX(30px);
}

.section-title.animated .title {
    opacity: 1;
    transform: translateX(0);
}

/* Card animations */
.animate-card {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

.animate-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
}

.animate-card.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered card animations */
.animate-card:nth-child(1) { transition-delay: 0.1s; }
.animate-card:nth-child(2) { transition-delay: 0.2s; }
.animate-card:nth-child(3) { transition-delay: 0.3s; }
.animate-card:nth-child(4) { transition-delay: 0.4s; }
.animate-card:nth-child(5) { transition-delay: 0.5s; }
.animate-card:nth-child(6) { transition-delay: 0.6s; }

/* Text animations */
.animate-text {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

.animate-text.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
}

.animate-text.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Button animations */
.animate-button {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s ease;
}

.animate-button.animate-on-scroll {
    opacity: 0;
    transform: scale(0.8);
}

.animate-button.animated {
    opacity: 1;
    transform: scale(1);
}

/* ===== SPECIFIC SECTION ANIMATIONS ===== */
/* Hero section animations */
.hero-content {
    opacity: 0;
    transform: translateY(50px);
    animation: heroEntrance 1.2s ease-out 0.8s forwards;
    max-width: 800px;
    margin: 0 auto;
}

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

/* Team card animations */
.team-card {
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
    transition: all 0.6s ease;
}

.team-card.animated {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.team-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Portfolio item animations */
.portfolio-item {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.portfolio-item.animated {
    opacity: 1;
    transform: scale(1);
}

.portfolio-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Service card animations */
.service-card {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.service-card.animated {
    opacity: 1;
    transform: translateX(0);
}

.service-card:nth-child(even) {
    transform: translateX(30px);
}

.service-card:nth-child(even).animated {
    transform: translateX(0);
}

/* Blog card animations */
.blog-card {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s ease;
}

.blog-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

/* ===== MARQUEE ANIMATIONS ===== */
.marquee-inner {
    animation: marquee 20s linear infinite;
}

.marquee-inner:hover {
    animation-play-state: paused;
}

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

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2E2E2E 0%, #FA4329 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader-content {
    text-align: center;
    color: white;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.preloader-text {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}

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

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #FA4329, #ff6b6b);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #FA4329;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #e63946;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(250, 67, 41, 0.4);
}

.back-to-top i {
    font-size: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .preloader-content {
        position: absolute;
        bottom: 45%;
    }

    .preloader-spinner {
        width: 50px;
        height: 50px;
    }

    .preloader-text {
        font-size: 16px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .navbar-brand:hover {
        transform: scale(1.02);
    }

    .image-hover:hover {
        transform: translateY(-3px);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .navbar-brand {
        animation: none;
    }

    .marquee-inner {
        animation: none;
    }
}

/* ===== FALLBACK FOR NO JAVASCRIPT ===== */
/* Ensure content is visible even without JavaScript */
.no-js .animate-image,
.no-js .animate-text,
.no-js .animate-card,
.no-js .animate-button,
.no-js .section-title {
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure white logos are visible */
.marquee-item img,
.client-card img,
.partners-section img {
    min-height: 60px;
    min-width: 120px;
    object-fit: contain;
}


.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader-content {
    text-align: center;
}

.gif-fallback-loader {
    width: 250px;
    border-radius: 50%;
    background: transparent; /* Ensures no white background */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    padding: 20px;
}
