/**
 * Final Website Optimization & Performance Enhancement
 * Vigthoria Operator - Complete Agent Showcase Integration
 * Date: June 5, 2025
 */

/* =================================================================
   FINAL AGENT SHOWCASE OPTIMIZATIONS
   ================================================================= */

/* Enhanced Agent Showcase Performance */
.agent-showcase-section {
    /* Ensure smooth scrolling and rendering */
    will-change: transform, opacity;
    contain: layout style paint;
    transform: translateZ(0); /* Force hardware acceleration */
}

.agent-showcase-card {
    /* Optimize for performance */
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Enhanced hover animations with better performance */
.agent-showcase-card:hover {
    transform: translateY(-8px) scale(1.02) translateZ(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================================================
   ICON LOADING & FALLBACK SYSTEM ENHANCEMENT
   ================================================================= */

/* Comprehensive icon fallback system */
.icon-fallback {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fa-fallback .icon-fallback {
    opacity: 1 !important;
}

/* Enhanced rotating circles for better visibility */
@keyframes enhance-rotate {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: rotate(180deg) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.6;
    }
}

.rotating-circle {
    animation: enhance-rotate 4s linear infinite;
}

/* =================================================================
   MOBILE RESPONSIVE FINAL ADJUSTMENTS
   ================================================================= */

/* Ultra-smooth mobile experience */
@media (max-width: 768px) {
    .agent-showcase-section {
        padding: 2rem 1rem !important;
        scroll-behavior: smooth;
    }
    
    .agent-showcase-grid {
        gap: 1.25rem !important;
    }
    
    .agent-showcase-card {
        transition: transform 0.2s ease !important;
    }
    
    .agent-showcase-card:hover {
        transform: translateY(-4px) !important;
    }
}

/* =================================================================
   THEME COMPATIBILITY FINAL FIXES
   ================================================================= */

/* Dark theme enhancements */
body:not(.light-theme) .agent-showcase-section {
    background: linear-gradient(135deg, 
        rgba(13, 17, 23, 0.98) 0%, 
        rgba(18, 26, 41, 0.95) 50%,
        rgba(10, 15, 28, 0.98) 100%);
}

/* Light theme full compatibility */
body.light-theme .agent-showcase-section {
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.98) 0%, 
        rgba(241, 245, 249, 0.95) 50%,
        rgba(236, 241, 247, 0.98) 100%);
}

body.light-theme .agent-showcase-card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.9) 100%);
    border: 2px solid rgba(0, 230, 118, 0.3);
    color: #1a1a1a;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 230, 118, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .agent-card-icon {
    background: linear-gradient(135deg, 
        rgba(0, 230, 118, 0.15) 0%,
        rgba(0, 153, 77, 0.08) 100%);
    border: 3px solid rgba(0, 230, 118, 0.4);
    color: #00a152;
}

body.light-theme .agent-capability-title {
    color: #1a1a1a;
}

body.light-theme .agent-capability-description {
    color: #4a5568;
}

body.light-theme .agent-capability-feature {
    color: #2d3748;
}

/* =================================================================
   NAVIGATION HIGHLIGHTING FINAL FIXES
   ================================================================= */

/* Enhanced agent navigation highlighting */
.main-nav .agent-link,
.footer-nav .agent-link {
    position: relative;
    transition: all 0.3s ease;
}

.main-nav .agent-link:hover,
.main-nav .agent-link.active,
.footer-nav .agent-link:hover,
.footer-nav .agent-link.active {
    color: #00e676 !important;
    text-shadow: 0 0 15px rgba(0, 230, 118, 0.8) !important;
    background: rgba(0, 230, 118, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    transform: translateY(-1px);
}

/* Agent link glow effect */
.main-nav .agent-link:hover::before,
.main-nav .agent-link.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(0, 230, 118, 0.3), transparent);
    border-radius: 10px;
    z-index: -1;
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* =================================================================
   CSS CONFLICTS FINAL RESOLUTION
   ================================================================= */

/* Override any conflicting showcase styles */
.showcase-item.agent-showcase-item {
    display: flex !important;
    gap: 2rem !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 2rem !important;
    background: rgba(16, 23, 41, 0.5) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 230, 118, 0.2) !important;
}

.showcase-image.agent-card-icon {
    position: relative !important;
    width: 150px !important;
    height: 150px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, 
        rgba(0, 230, 118, 0.2) 0%,
        rgba(0, 153, 77, 0.1) 100%) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border: 3px solid rgba(0, 230, 118, 0.4) !important;
    font-size: 3.5rem !important;
}

/* Feature tags enhancement */
.feature-tag {
    background: rgba(0, 230, 118, 0.1) !important;
    border: 1px solid rgba(0, 230, 118, 0.3) !important;
    color: #e6f0ff !important;
    transition: all 0.3s ease !important;
}

.feature-tag:hover {
    background: rgba(0, 230, 118, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* =================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================= */

/* Reduce layout shifts */
.agent-showcase-grid {
    min-height: 600px;
}

.agent-showcase-card {
    min-height: 350px;
}

/* Improve font loading */
.agent-capability-title,
.agent-capability-description {
    font-display: swap;
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    .rotating-circle {
        animation-duration: 6s;
    }
    
    .agent-showcase-card {
        transition-duration: 0.2s;
    }
}

/* =================================================================
   LOADING STATES & FALLBACKS
   ================================================================= */

/* Enhanced loading states */
.agent-showcase-section.loading .agent-showcase-card {
    opacity: 0.7;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.agent-showcase-section.loaded .agent-showcase-card {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-showcase-card {
    animation: fadeInUp 0.6s ease forwards;
}

.agent-showcase-card:nth-child(1) { animation-delay: 0.1s; }
.agent-showcase-card:nth-child(2) { animation-delay: 0.2s; }
.agent-showcase-card:nth-child(3) { animation-delay: 0.3s; }
.agent-showcase-card:nth-child(4) { animation-delay: 0.4s; }
.agent-showcase-card:nth-child(5) { animation-delay: 0.5s; }
.agent-showcase-card:nth-child(6) { animation-delay: 0.6s; }

/* =================================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================================= */

/* Focus states for keyboard navigation */
.agent-showcase-card:focus-within {
    outline: 3px solid rgba(0, 230, 118, 0.6);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .rotating-circle {
        animation: none;
    }
    
    .agent-showcase-card {
        transition: none;
    }
    
    .agent-showcase-card:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .agent-showcase-card {
        border-width: 3px;
        border-color: #00e676;
    }
    
    .agent-card-icon {
        border-width: 4px;
    }
}
