/* Bottom Navigation (ZBS Capital Style - Optimized for Performance) */

/* Navigation Container - Optimized */
.nav-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: auto;
    transition: all 0.3s ease;
    will-change: transform;
}

.nav-container.collapsed {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 70px;
}

/* Bottom Navigation - Optimized */
.bottom-nav {
    background: linear-gradient(145deg, #111827 0%, #1F2937 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 16px 12px;
    box-shadow: 
        0 10px 40px rgba(168, 85, 247, 0.3),
        0 0 60px rgba(6, 182, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    will-change: transform, box-shadow;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(168, 85, 247, 0.8), 
        rgba(6, 182, 212, 0.8),
        transparent
    );
    animation: borderFlow 3s linear infinite;
    pointer-events: none;
}

@keyframes borderFlow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.bottom-nav::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 1px;
    background: linear-gradient(135deg, #A855F7, #06B6D4, #A855F7);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    animation: rotateBorder 4s linear infinite;
    pointer-events: none;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.nav-container.collapsed .bottom-nav {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 15px 50px rgba(168, 85, 247, 0.5),
        0 0 80px rgba(6, 182, 212, 0.3),
        inset 0 2px 10px rgba(168, 85, 247, 0.2);
    background: linear-gradient(145deg, #1F2937 0%, #111827 100%);
    border: 2px solid rgba(168, 85, 247, 0.5);
}

.nav-container.collapsed .bottom-nav::before {
    opacity: 0;
}

/* Collapse Button - Optimized */
.collapse-btn {
    position: absolute;
    top: -12px;
    right: 15px;
    background: linear-gradient(135deg, #A855F7 0%, #06B6D4 100%);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 20px rgba(168, 85, 247, 0.6),
        0 0 30px rgba(6, 182, 212, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 10001;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    pointer-events: auto;
    will-change: transform;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-container.collapsed .collapse-btn {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

.collapse-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.collapse-btn:hover::before {
    opacity: 1;
}

.collapse-btn:active {
    transform: scale(0.9);
}

.nav-container.collapsed .collapse-btn:active {
    transform: translate(-50%, -50%) scale(0.9);
}

/* Navigation Items */
.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #9CA3AF;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 10px 16px;
    border-radius: 18px;
    min-width: 70px;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 10;
}

.nav-container.collapsed .nav-item {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.2), 
        rgba(6, 182, 212, 0.2)
    );
    border-radius: 18px;
    transform: scale(0);
    transition: transform 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, #A855F7, #06B6D4);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nav-item:hover::before {
    transform: scale(1);
}

.nav-item:hover::after {
    opacity: 0.6;
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.nav-item span {
    color: #9CA3AF;
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.7;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.nav-item:hover {
    color: #A855F7;
    transform: translateY(-4px);
}

.nav-item:hover i {
    transform: scale(1.2) rotate(-5deg);
    color: #A855F7;
    filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.6));
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1.2) rotate(-5deg);
    }
    50% {
        transform: scale(1.3) rotate(-5deg) translateY(-2px);
    }
}

.nav-item:hover span {
    opacity: 1;
    color: #06B6D4;
    transform: translateY(-1px);
}

/* Active State */
.nav-item.active {
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.25), 
        rgba(6, 182, 212, 0.2)
    );
    color: #A855F7;
    box-shadow: 
        0 4px 15px rgba(168, 85, 247, 0.4),
        0 0 30px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    pointer-events: auto;
}

.nav-item.active::before {
    transform: scale(1);
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.3), 
        rgba(6, 182, 212, 0.25)
    );
}

.nav-item.active::after {
    opacity: 0.8;
}

.nav-item.active i {
    color: #06B6D4;
    transform: scale(1.1);
    animation: activePulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8));
}

@keyframes activePulse {
    0%, 100% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8));
    }
}

.nav-item.active span {
    opacity: 1;
    font-weight: 700;
    color: #A855F7;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Ripple Effect */
.nav-item:active {
    transform: scale(0.95);
}

.nav-item:active::before {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Magnetic Effect */
.nav-item {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        left: 10px;
        right: 10px;
        bottom: 15px;
    }

    .bottom-nav {
        padding: 12px 6px;
    }

    .nav-item {
        min-width: 60px;
        padding: 8px 12px;
    }

    .nav-item span {
        font-size: 0.65rem;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }

    .collapse-btn {
        width: 28px;
        height: 28px;
        top: -14px;
    }

    .nav-container.collapsed .collapse-btn {
        width: 40px;
        height: 40px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

/* Loading Animation */
@keyframes slideUpNav {
    from {
        transform: translateY(150%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    animation: slideUpNav 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Glow Effect on Hover */
.bottom-nav:hover {
    box-shadow: 
        0 10px 50px rgba(168, 85, 247, 0.4),
        0 0 80px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Floating Animation for Navigation */
@keyframes floatNav {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.bottom-nav {
    animation: floatNav 6s ease-in-out infinite;
}

.nav-container.collapsed .bottom-nav {
    animation: floatNav 6s ease-in-out infinite, spin 20s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}