/* ========================================
   LUMAVINE.AI SIDEBAR NAVIGATION
   Version: 5.0 - Production Build
   ======================================== */

/* ========== NAV CONTAINER ========== */
.lumavine-nav { position: relative; }

.nav-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width, 280px);
    height: 100vh;
    background: rgba(12, 12, 24, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid var(--lv-border, rgba(138, 79, 255, 0.15));
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.15) 0%, rgba(138, 79, 255, 0.08) 50%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.nav-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(138, 79, 255, 0.5) 0%, rgba(92, 225, 230, 0.3) 50%, rgba(138, 79, 255, 0.5) 100%);
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.4);
    pointer-events: none;
}

/* ========== BRAND / LOGO ========== */
.nav-brand {
    padding: 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-logo:hover { transform: translateY(-2px); }

.nav-logo-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #8a4fff 0%, #5ce1e6 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(138, 79, 255, 0.5);
    flex-shrink: 0;
}

.nav-logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8a4fff, #5ce1e6);
    z-index: -1;
    opacity: 0.6;
    filter: blur(12px);
    animation: pulseGlow 3s ease-in-out infinite;
}

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

.nav-logo-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.nav-logo-text { display: flex; flex-direction: column; }

.nav-logo-name {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #fff 0%, #d4c5ff 40%, #5ce1e6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    line-height: 1;
}

.nav-logo-tagline {
    font-size: 9px;
    color: rgba(92, 225, 230, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* ========== SEARCH ========== */
.nav-search {
    padding: 0 16px 16px;
    position: relative;
    z-index: 1;
}

.nav-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.nav-search-input {
    width: 100%;
    padding: 10px 40px 10px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.nav-search-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.nav-search-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(138, 79, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(138, 79, 255, 0.08);
}

.nav-search-kbd {
    position: absolute;
    right: 10px;
    font-size: 11px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    pointer-events: none;
}

/* ========== MENU ========== */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px 24px;
    position: relative;
    z-index: 1;
}

.nav-menu::-webkit-scrollbar { width: 5px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.3); border-radius: 10px; }
.nav-menu::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.5); }

/* ========== SECTIONS ========== */
.nav-section { margin-bottom: 24px; }
.nav-section:last-child { margin-bottom: 0; }

.nav-section-label {
    font-size: 11px;
    color: rgba(124, 58, 237, 0.7);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    padding: 0 14px 10px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

/* ========== NAV ITEMS ========== */
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

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

.nav-item:hover {
    color: white;
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.15);
    transform: translateX(4px);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(138, 79, 255, 0.12) 50%, rgba(92, 225, 230, 0.08) 100%);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 0 24px rgba(138, 79, 255, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #8a4fff 0%, #5ce1e6 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 16px rgba(138, 79, 255, 0.8);
}

.nav-item.hidden { display: none; }

.nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nav-item:hover svg, .nav-item.active svg { opacity: 1; }

/* ========== BADGES ========== */
.nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #8a4fff, #5ce1e6);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(138, 79, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-badge-success { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
.nav-badge-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1f2937; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.nav-badge-danger { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }

/* ========== USER FOOTER ========== */
.nav-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(7, 7, 20, 0.4) 0%, rgba(12, 12, 24, 0.8) 100%);
    position: relative;
    z-index: 1;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(92, 225, 230, 0.04) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-user:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 8px 32px rgba(138, 79, 255, 0.15);
    transform: translateY(-2px);
}

.nav-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8a4fff 0%, #5ce1e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    position: relative;
    box-shadow: 0 4px 16px rgba(138, 79, 255, 0.4);
    font-family: 'Orbitron', sans-serif;
    flex-shrink: 0;
}

.nav-user-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    border-radius: 50%;
    border: 2px solid rgba(12, 12, 24, 0.95);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.nav-user-info { flex: 1; min-width: 0; }

.nav-user-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.nav-user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.nav-user-menu {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-user-menu:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.3);
}

.nav-user-menu svg { width: 16px; height: 16px; fill: rgba(255, 255, 255, 0.6); }

/* ========== USER DROPDOWN ========== */
.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    margin-bottom: 10px;
    background: rgba(18, 18, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.user-dropdown-item:hover { background: rgba(124, 58, 237, 0.15); color: white; }
.user-dropdown-item svg { width: 18px; height: 18px; opacity: 0.8; }
.user-dropdown-divider { height: 1px; background: rgba(255, 255, 255, 0.06); margin: 6px 0; }

/* ========== MOBILE TOGGLE ========== */
.nav-mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    background: rgba(12, 12, 24, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-mobile-toggle:hover { border-color: rgba(124, 58, 237, 0.5); box-shadow: 0 8px 32px rgba(138, 79, 255, 0.2); }

.nav-mobile-toggle span {
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-mobile-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-mobile-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-mobile-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ========== OVERLAY ========== */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active { opacity: 1; }

/* ========== CONTENT OFFSET ========== */
.has-sidebar { margin-left: var(--nav-width, 280px); transition: margin-left 0.3s ease; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-mobile-toggle { display: flex; }
    .nav-sidebar { transform: translateX(-100%); box-shadow: none; }
    .nav-sidebar.active { transform: translateX(0); box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5); }
    .nav-overlay { display: block; }
    .has-sidebar { margin-left: 0; }
}

@media (max-width: 1024px) and (min-width: 769px) {
    :root { --nav-width: 260px; }
    .nav-logo-name { font-size: 22px; }
    .nav-item { padding: 11px 12px; }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    .nav-sidebar, .nav-item, .nav-user, .nav-mobile-toggle,
    .nav-overlay, .user-dropdown { transition: none; }
    .nav-logo-icon::before { animation: none; }
}

.nav-item:focus-visible,
.nav-user-menu:focus-visible,
.nav-mobile-toggle:focus-visible,
.nav-search-input:focus-visible {
    outline: 2px solid var(--lv-accent, #5ce1e6);
    outline-offset: 2px;
}
