/* ============================================================================
   BOTTOM NAVIGATION STYLES
   ============================================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-inset-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    padding: 0.5rem 0.25rem;
    padding-bottom: calc(0.5rem + var(--safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Navigation Items */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 0.25rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-item:active {
    transform: scale(0.95);
}

/* Active State */
.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 0 0 2px 2px;
}

/* Navigation Icon */
.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    filter: grayscale(100%);
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    filter: grayscale(0%);
    opacity: 1;
    transform: translateY(-2px);
}

/* Navigation Label */
.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Navigation Badge */
.nav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(80%);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: translateX(80%) scale(0);
    }
    70% {
        transform: translateX(80%) scale(1.2);
    }
    100% {
        transform: translateX(80%) scale(1);
    }
}

/* Special PIP Badge (pulsing) */
.nav-badge.pip-badge {
    background: var(--warning-color);
    animation: pipPulse 2s ease-in-out infinite;
}

@keyframes pipPulse {
    0%, 100% {
        opacity: 1;
        transform: translateX(80%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateX(80%) scale(1.1);
    }
}

/* Responsive Adjustments */
@media (max-width: 374px) {
    .nav-label {
        font-size: 0.625rem;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .nav-item {
        padding: 0.5rem;
    }
    
    .nav-label {
        font-size: 0.875rem;
    }
    
    .nav-icon {
        width: 28px;
        height: 28px;
    }
}

/* Accessibility - Focus Styles */
.nav-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-radius: 4px;
}

/* Hover Effects (for devices with hover) */
@media (hover: hover) {
    .nav-item:hover {
        color: var(--primary-color);
        background: var(--primary-light);
        border-radius: var(--border-radius);
    }
    
    .nav-item:hover .nav-icon {
        transform: translateY(-2px);
        filter: grayscale(0%) opacity(0.9);
    }
}

/* Additional states for better visual feedback */
.nav-item:active .nav-icon {
    transform: scale(0.95);
}

/* Safe Area Support for iPhone X and newer */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
    }
}
