/**
 * Live Brands Marquee - Dynamic Enterprise & University Showcase
 * Replaces static brands with live scrolling clients from database
 */

.live-brands-showcase-section {
    padding: 60px 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

.live-brands-showcase-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 92, 246, 0.2) 50%, 
        transparent 100%
    );
}

.live-brands-row {
    margin-bottom: 40px;
    position: relative;
}

.live-brands-row:last-child {
    margin-bottom: 0;
}

.live-brands-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.live-brands-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}

.live-pulse-small {
    font-size: 8px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Marquee Container */
.live-brands-marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

/* Scrolling Track - Optimized for Performance */
.live-brands-track {
    display: flex;
    gap: 40px;
    animation: marquee-scroll 60s linear infinite;
    width: fit-content;
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.universities-track {
    animation: marquee-scroll-reverse 70s linear infinite;
}

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

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

/* Pause on hover */
.live-brands-marquee:hover .live-brands-track {
    animation-play-state: paused;
}

/* Brand Item - Optimized for Performance */
.live-brand-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    will-change: transform;
    backface-visibility: hidden;
}

.live-brand-item:hover {
    background: #ffffff;
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.live-brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.live-brand-logo-fallback {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.live-brand-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.live-brand-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
}

.live-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.live-brand-verified {
    color: #10b981;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}

.live-brand-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
}

.live-brand-joined {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

.live-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-brand-count {
    font-weight: 600;
    color: #7c3aed;
}

/* Skeleton Loading */
.skeleton-brand {
    background: linear-gradient(
        90deg,
        rgba(226, 232, 240, 0.8) 0%,
        rgba(241, 245, 249, 0.8) 50%,
        rgba(226, 232, 240, 0.8) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    min-width: 220px;
    height: 90px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .live-brands-showcase-section {
        padding: 40px 0;
    }

    .live-brands-row {
        margin-bottom: 30px;
    }

    .live-brands-header h4 {
        font-size: 12px;
    }

    .live-brand-item {
        min-width: 180px;
        padding: 15px 20px;
    }

    .live-brand-logo,
    .live-brand-logo-fallback {
        width: 40px;
        height: 40px;
    }

    .live-brand-name {
        font-size: 13px;
        max-width: 120px;
    }

    .live-brands-track {
        gap: 20px;
    }
}

/* Performance optimization - GPU Acceleration */
@media (prefers-reduced-motion: no-preference) {
    .live-brands-track {
        animation-play-state: running;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-brands-track {
        animation: none;
    }
}

/* Reduce repaints by using transform and opacity only */
.live-brand-item:hover {
    background: #ffffff;
}
