/* Advanced Animations & Premium Effects */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #3b82f6;

}

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

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

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

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

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

/* Logo Styling */
nav img[alt="Commbridge Logo"] {
    border-radius: 12px;
    filter: brightness(1.3) contrast(1.1);
    transition: all 0.3s ease;
}

nav img[alt="Commbridge Logo"]:hover {
    filter: brightness(1.5) contrast(1.2);
}

/* Glassmorphism */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-nav {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Navbar Transparent Black */
#navbar {
    background: rgba(0, 0, 0, 0.4);
    /* Increased transparency */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Text Gradients */
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Card Hover Effects */
.service-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 20px 40px -15px rgba(59, 130, 246, 0.3);
}

/* Hero Video Overlay */
.video-overlay {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.8) 80%, #0f172a 100%);
}

/* Button Glow */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-glow:hover::after {
    left: 100%;
}

/* Floating Shapes Background */
.floating-shape {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    animation: float 10s infinite ease-in-out alternate;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(30px, 50px) rotate(10deg);
    }
}

/* Flip Card Animation */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 320px;
    /* Fixed height for flip effect */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.flip-card-front {
    background-color: #0f172a;
    border: 1px solid #1e293b;
}

.flip-card-back {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    transform: rotateY(180deg);
    border: 1px solid #3b82f6;
}

/* 3D Tilt Effect for other cards */
.tilt-card {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale(1.02);
}

/* Premium Animated Gradient Background */
.premium-gradient {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #1e3a5f, #2d1b4e);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    opacity: 0.6;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Luxury Card with Shine Effect */
.luxury-card {
    position: relative;
    overflow: hidden;
}

.luxury-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

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

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Glowing Border Animation */
.glow-border {
    position: relative;
    background: linear-gradient(#0f172a, #0f172a) padding-box,
        linear-gradient(145deg, transparent 35%, #3b82f6, #8b5cf6, transparent 65%) border-box;
    border: 2px solid transparent;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

/* Particle Effect Background */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    animation: float-particle 20s infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Luxury Text Shadow */
.luxury-text {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5),
        0 0 20px rgba(59, 130, 246, 0.3),
        0 0 30px rgba(59, 130, 246, 0.2);
}

/* Premium Hover Scale */
.premium-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-hover:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3),
        0 0 60px rgba(139, 92, 246, 0.2);
}

/* Animated Underline */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.4s ease-out;
}

.animated-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Glass Morphism Enhanced */
.glass-premium {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Neon Glow Effect */
.neon-glow {
    animation: neonPulse 3s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from {
        text-shadow: 0 0 5px rgba(59, 130, 246, 0.3),
            0 0 10px rgba(59, 130, 246, 0.2),
            0 0 15px rgba(59, 130, 246, 0.1);
    }

    to {
        text-shadow: 0 0 3px rgba(59, 130, 246, 0.2),
            0 0 6px rgba(59, 130, 246, 0.15),
            0 0 10px rgba(59, 130, 246, 0.1);
    }
}

/* Parallax Layers */
.parallax-layer {
    transition: transform 0.3s ease-out;
}

/* Premium Button */
.btn-premium {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-premium::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;
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Footer Link Hover */
.footer-link {
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.footer-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Client Logos Infinite Scroll */
.logos-scroll {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
}

.logos-track {
    display: flex;
    gap: 40px;
    animation: scroll-logos 40s linear infinite;
    width: max-content;
    will-change: transform;
}

.logos-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-logos {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.logo-item {
    flex-shrink: 0;
    width: 240px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo-container:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.15);
}

.logo-container img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-container img.logo-large {
    height: 100px;
}

.logo-container:hover img {
    transform: scale(1.1);
}

.logo-name {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-item {
        width: 180px;
        height: 140px;
    }

    .logo-container {
        padding: 15px;
        gap: 8px;
    }

    .logo-container img {
        height: 60px;
    }

    .logo-name {
        font-size: 10px;
    }

    .logos-track {
        gap: 30px;
    }

    @keyframes scroll-logos {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }
    }
}

/* Static Client Cards for Services Page */
.client-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 180px;
}

.client-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.15);
}

.client-logo-wrapper {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.client-logo-wrapper img.logo-large {
    height: 100px;
}

.client-card:hover .client-logo-wrapper img {
    transform: scale(1.1);
}

.client-name {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .client-card {
        height: 140px;
        padding: 15px;
        gap: 8px;
    }

    .client-logo-wrapper {
        height: 60px;
    }

    .client-logo-wrapper img.logo-large {
        height: 80px;
    }

    .client-name {
        font-size: 10px;
    }
}