/* Enhanced Bottom Navigation Bar - Global Styles */
/* Uses CSS variables from theme-system.css for Dark/Light mode support */

/* Navbar Glass Container */
.nav-glass {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 540px;
    background: var(--nav-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--nav-border);
    border-radius: 28px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--nav-shadow);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Navigation Item - Default State */
.nav-item {
    color: var(--nav-text);
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 14px;
    border-radius: 14px;
    flex: 1;
    max-width: 80px;
    position: relative;
    cursor: pointer;
    font-weight: 700;
}

.nav-item i {
    font-size: 1.7rem;
    transition: all 0.3s ease;
    color: var(--nav-icon);
}

.nav-item span {
    font-weight: 700;
    letter-spacing: 0.4px;
    font-family: var(--font-fa, 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active Navigation Item */
.nav-item.active,
.nav-item:active {
    color: var(--nav-text-active);
    background: var(--nav-active-bg);
    border: 1px solid var(--nav-active-border);
    box-shadow: 0 0 20px rgba(var(--accent-secondary-rgb), 0.4), 
                inset 0 1px 10px rgba(var(--accent-secondary-rgb), 0.2);
    text-shadow: none;
}

.nav-item.active i,
.nav-item:active i {
    color: var(--nav-text-active);
    transform: scale(1.2) rotate(0deg);
    text-shadow: none;
    animation: navIconPulse 0.6s ease-out;
}

.nav-item.active span,
.nav-item:active span {
    color: var(--nav-text-active);
    text-shadow: none;
}

@keyframes navIconPulse {
    0% {
        transform: scale(0.8) rotate(-10deg);
    }
    50% {
        transform: scale(1.25) rotate(5deg);
    }
    100% {
        transform: scale(1.2) rotate(0deg);
    }
}

/* Hover State */
.nav-item:hover {
    color: var(--text-primary);
    background: var(--nav-hover-bg);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(var(--accent-primary-rgb), 0.3);
    text-decoration: none;
}

.nav-item:hover i {
    color: var(--accent-primary);
    transform: scale(1.15) rotate(-5deg);
    text-shadow: none;
}

.nav-item:hover span {
    color: var(--text-primary);
    text-decoration: none;
}

/* Focus State (for accessibility) */
.nav-item:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    text-decoration: none;
}

/* Mobile / WebApp */
@media (max-width: 480px) {
    .nav-glass {
        bottom: 10px;
        width: 92%;
        max-width: 100%;
        padding: 8px 12px;
        border-radius: 20px;
    }
    
    .nav-item {
        padding: 6px 8px;
        max-width: 60px;
        font-size: 0.6rem;
        gap: 4px;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }
    
    .nav-item.active i {
        transform: scale(1.1) rotate(0deg);
    }
    
    .nav-item:hover {
        transform: translateY(-2px);
    }
}

/* WebApp/Touch context */
@media (max-height: 700px) and (max-width: 768px) {
    .nav-glass {
        padding: 6px 10px;
        bottom: 8px;
    }
    .nav-item i { font-size: 1.2rem; }
    .nav-item span { font-size: 0.55rem; }
}

/* Tablet Optimization */
@media (min-width: 481px) and (max-width: 768px) {
    .nav-glass {
        max-width: 500px;
    }
    
    .nav-item {
        padding: 10px 12px;
        max-width: 75px;
    }
}

/* Large Screens */
@media (min-width: 769px) {
    .nav-glass {
        max-width: 600px;
    }
    
    .nav-item {
        padding: 12px 16px;
        max-width: 90px;
    }
}

/* Disabled State */
.nav-item:disabled,
.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .nav-glass {
        animation: none;
    }
    
    .nav-item,
    .nav-item i,
    .nav-item span {
        transition: background-color 0.2s ease;
    }
    
    .nav-item.active i {
        animation: none;
        transform: scale(1.1) !important;
    }
}
