/* Ecosystem Navigation Styles */

/* Dropdown animation */
#ecosystemNavDropdown {
    animation: slideDownFade 0.2s ease-out;
    transform-origin: top right;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chevron rotation when dropdown is open */
#ecosystemNavBtn.active #ecosystemNavChevron {
    transform: rotate(180deg);
}

/* Platform item hover effects */
.ecosystem-nav-item {
    position: relative;
    display: block;
    text-decoration: none;
    overflow: hidden;
}

.ecosystem-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #8b5cf6, #06b6d4);
    transform: scaleY(0);
    transition: transform 0.2s ease-out;
}

.ecosystem-nav-item:hover::before {
    transform: scaleY(1);
}

/* Current platform indicator pulse animation */
.ecosystem-nav-item [id^="currentPlatform"]:not(.hidden) {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Platform icon hover animation */
.ecosystem-nav-item .flex-shrink-0 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ecosystem-nav-item:hover .flex-shrink-0 {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Line clamp for descriptions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #ecosystemNavDropdown {
        width: 95vw;
        max-width: 360px;
        right: -10px;
    }

    .ecosystem-nav-item .flex-shrink-0 {
        width: 40px;
        height: 40px;
    }

    .ecosystem-nav-item .flex-shrink-0 svg {
        width: 20px;
        height: 20px;
    }

    .ecosystem-nav-item > div {
        padding: 12px 16px;
    }

    #ecosystemNavDropdown .px-6 {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Smooth hover transitions */
.ecosystem-nav-item h4,
.ecosystem-nav-item svg {
    transition: all 0.2s ease-out;
}

/* Backdrop blur enhancement */
#ecosystemNavDropdown {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Better shadow for dropdown */
#ecosystemNavDropdown {
    box-shadow:
        0 10px 40px -10px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(139, 92, 246, 0.3),
        0 0 20px rgba(139, 92, 246, 0.2);
}

/* Platform color accents on hover */
.ecosystem-nav-item:nth-child(1):hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
}

.ecosystem-nav-item:nth-child(2):hover {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
}

.ecosystem-nav-item:nth-child(3):hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

.ecosystem-nav-item:nth-child(4):hover {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.1) 0%, transparent 100%);
}

/* Responsive button text */
@media (max-width: 640px) {
    #ecosystemNavBtn {
        padding: 8px 12px;
    }

    #ecosystemNavBtn svg:first-child {
        width: 20px;
        height: 20px;
    }
}

/* Accessibility improvements */
.ecosystem-nav-item:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: -2px;
}

#ecosystemNavBtn:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Dark mode optimization (already dark but ensuring consistency) */
@media (prefers-color-scheme: dark) {
    #ecosystemNavDropdown {
        background: rgba(15, 23, 42, 0.98);
    }
}

/* Smooth transitions for all interactive elements */
.ecosystem-nav-item *,
#ecosystemNavBtn * {
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
}

/* Loading state (if needed) */
.ecosystem-nav-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Active state for button */
#ecosystemNavBtn:active {
    transform: scale(0.98);
}

/* Gradient text animation for header */
#ecosystemNavDropdown h3 {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

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

/* Platform badge styles */
[id^="currentPlatform"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

[id^="currentPlatform"]::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Z-index hierarchy - lowered to avoid blocking swap interface */
#ecosystemNav {
    z-index: 40;
}

#ecosystemNavDropdown {
    z-index: 41;
}

/* Prevent text selection on button */
#ecosystemNavBtn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Enhanced visual feedback */
.ecosystem-nav-item:active {
    transform: scale(0.99);
}

/* Print styles (hide in print) */
@media print {
    #ecosystemNav {
        display: none !important;
    }
}
