/**
 * Navigation Component Styles
 * Categorized dropdown navigation for SPX AI Prediction
 */

/* Main Navigation Container */
.nav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    align-items: center;
    position: relative;
    z-index: 100;
}

/* Navigation Links */
.nav-link {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Home Link */
.nav-link.nav-home {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.nav-link.nav-home:hover {
    background: rgba(102, 126, 234, 0.2);
}

.nav-link.nav-home.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dropdown Wrapper */
.nav-dropdown-wrapper {
    position: relative;
    z-index: 200;
}

.nav-dropdown-wrapper.active .nav-dropdown-trigger {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
}

/* Dropdown Trigger */
.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-dropdown-wrapper.open .nav-dropdown-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
}

/* Chevron Icon */
.nav-chevron {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nav-dropdown-wrapper.open .nav-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: -1px;
    min-width: 280px;
    max-height: 600px !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 300;
    backdrop-filter: blur(20px);
}

.nav-dropdown-wrapper.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Dropdown Items - Force visibility with maximum specificity */
.nav-dropdown-menu .nav-dropdown-item,
.nav-dropdown-wrapper .nav-dropdown-menu .nav-dropdown-item,
a.nav-dropdown-item {
    display: block !important;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.nav-dropdown-item:last-child {
    margin-bottom: 0;
}

.nav-dropdown-item:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
    transform: translateX(4px);
}

.nav-dropdown-item.active {
    background: rgba(102, 126, 234, 0.2);
    border-left: 3px solid #667eea;
    color: #fff;
}

/* Dropdown Item Content */
.nav-dropdown-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dropdown-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.nav-dropdown-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-dropdown-item-label {
    flex: 1;
}

.nav-dropdown-item-description {
    font-size: 12px;
    color: #94a3b8;
    padding-left: 16px;
    line-height: 1.4;
}

/* Badge */
.nav-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .nav-dropdown-wrapper {
        width: 100%;
    }

    .nav-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 6px;
        transform: none;
    }

    .nav-dropdown-wrapper.open .nav-dropdown-menu {
        transform: none;
    }

    .nav-dropdown-item:hover {
        transform: translateX(0);
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-container {
        gap: 6px;
        padding: 12px 15px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-dropdown-menu {
        min-width: 240px;
    }
}

/* Animation for new items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown-item {
    animation: slideIn 0.2s ease-out forwards !important;
}

.nav-dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.nav-dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.nav-dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.nav-dropdown-item:nth-child(4) { animation-delay: 0.2s; }
.nav-dropdown-item:nth-child(5) { animation-delay: 0.25s; }
.nav-dropdown-item:nth-child(6) { animation-delay: 0.3s; }
.nav-dropdown-item:nth-child(7) { animation-delay: 0.35s; }
.nav-dropdown-item:nth-child(8) { animation-delay: 0.4s; }
.nav-dropdown-item:nth-child(9) { animation-delay: 0.45s; }
.nav-dropdown-item:nth-child(10) { animation-delay: 0.5s; }

/* Accessibility */
.nav-link:focus,
.nav-dropdown-trigger:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .nav-container {
        background: rgba(10, 15, 25, 0.98);
    }

    .nav-dropdown-menu {
        background: linear-gradient(135deg, #0f0f1e 0%, #0d1525 100%);
    }
}
