/* 
 * Bottom Navigation Bar (ULTRA PREMIUM DOCK SYSTEM) 
 * High-performance animations, optical centering, cyber-neon shockwaves & Glassmorphism
 */

:root {
    --nav-height: 72px;
    --brand-neon: #CCFF00;
    --neon-glow: rgba(204, 255, 0, 0.4);
    --bg-glass: rgba(10, 14, 26, 0.98);
}

/* 🌈 CONFIGURACIÓN INDIVIDUAL DE COLORES INSIGNIA DE CADA PESTAÑA */
#nav-dashboard {
    --item-color: #00f0ff;
    --item-color-rgb: 0, 240, 255;
}
#nav-americanas {
    --item-color: #CCFF00;
    --item-color-rgb: 204, 255, 0;
}
#nav-entrenos {
    --item-color: #ff007f;
    --item-color-rgb: 255, 0, 127;
}
#nav-ranking {
    --item-color: #ffd700;
    --item-color-rgb: 255, 215, 0;
}
#nav-community {
    --item-color: #ff5e00;
    --item-color-rgb: 255, 94, 0;
}
#nav-profile {
    --item-color: #00f5d4;
    --item-color-rgb: 0, 245, 212;
}

/* 🛡️ BOTTOM NAVIGATION BAR (ANTI-BLEEDTHROUGH HIGH CONTRAST) */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 14, 26, 0.98) !important;
    backdrop-filter: blur(30px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(190%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10000;
    padding: 8px 6px;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px);
    box-shadow: 0 -8px 30px var(--nav-glow-color, rgba(204, 255, 0, 0.15)), 0 -1px 0 rgba(255, 255, 255, 0.08) inset !important;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
}

.nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
    min-width: 0;
    padding: 0 2px;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
}

.nav-item i {
    width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 4px;
    padding: 0 !important;
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease, color 0.3s ease;
}

.nav-item span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.70rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
    z-index: 2;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.35s ease, color 0.3s ease;
}

/* Micro-píldora neon debajo del texto */
.nav-item span::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 14px;
    height: 2.5px;
    border-radius: 999px;
    background: var(--item-color, #CCFF00);
    box-shadow: 0 0 8px var(--item-color, #CCFF00), 0 0 16px rgba(var(--item-color-rgb, 204, 255, 0), 0.8);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* 🚀 REBOTE FÍSICO ELÁSTICO DEL ICONO (SQUASH & SPRING POP) */
@keyframes navIconSpringPop {
    0% {
        transform: translateY(0) scale(1, 1);
    }
    25% {
        transform: translateY(-8px) scale(0.78, 1.25);
    }
    50% {
        transform: translateY(2px) scale(1.22, 0.85);
    }
    75% {
        transform: translateY(-3px) scale(0.95, 1.05);
    }
    100% {
        transform: translateY(-4px) scale(1.18, 1.18);
    }
}

/* Active State */
.nav-item.active {
    color: var(--item-color, #CCFF00) !important;
}

.nav-item.active i {
    color: var(--item-color, #CCFF00) !important;
    transform: translateY(-4px) scale(1.18);
    filter: drop-shadow(0 0 8px rgba(var(--item-color-rgb, 204, 255, 0), 0.9)) 
            drop-shadow(0 0 18px rgba(var(--item-color-rgb, 204, 255, 0), 0.45));
}

.nav-item.active i,
.nav-item.is-pop i,
.nav-item i.spring-pop {
    animation: navIconSpringPop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.nav-item.active span {
    color: var(--item-color, #CCFF00) !important;
    font-weight: 950;
    text-shadow: 0 0 10px rgba(var(--item-color-rgb, 204, 255, 0), 0.7);
    transform: translateY(-1px);
}

.nav-item.active span::after {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

/* 🌟 AURA ACTIVA MEJORADA (PODIO DE LUZ NEÓN CYBER-PADEL) */
.nav-item::before {
    content: '' !important;
    position: absolute !important;
    top: calc(50% - 9px) !important;
    left: 50% !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(var(--item-color-rgb, 204, 255, 0), 0.35) 0%, rgba(var(--item-color-rgb, 204, 255, 0), 0.12) 55%, transparent 75%) !important;
    border: 1px solid rgba(var(--item-color-rgb, 204, 255, 0), 0.35) !important;
    box-shadow: 0 0 20px rgba(var(--item-color-rgb, 204, 255, 0), 0.4), inset 0 0 10px rgba(var(--item-color-rgb, 204, 255, 0), 0.2) !important;
    transform: translate(-50%, -50%) scale(0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
}

.nav-item.active::before {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
    animation: navAuraPulse 3s infinite ease-in-out !important;
}

@keyframes navAuraPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.95;
        box-shadow: 0 0 20px rgba(var(--item-color-rgb, 204, 255, 0), 0.4), inset 0 0 10px rgba(var(--item-color-rgb, 204, 255, 0), 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.14);
        opacity: 0.65;
        box-shadow: 0 0 28px rgba(var(--item-color-rgb, 204, 255, 0), 0.6), inset 0 0 14px rgba(var(--item-color-rgb, 204, 255, 0), 0.35);
    }
}

/* Tactile feedback al pulsar */
.nav-item:active {
    transform: scale(0.92);
}

/* 💥 1. SHOCKWAVE RING (ONDA EXPANSIVA CIBERNÉTICA NEÓN) */
.nav-click-shockwave {
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor, inset 0 0 10px currentColor;
    animation: navShockwaveExpand 0.5s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
    will-change: transform, opacity;
}

@keyframes navShockwaveExpand {
    0% {
        transform: scale(0.2);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ⚡ 2. CORE FLASH (FOGONAZO ESFÉRICO CENTRAL DE LUZ) */
.nav-click-core-flash {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    border-radius: 50%;
    filter: blur(2px);
    animation: navCoreFlash 0.2s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
    will-change: transform, opacity;
}

@keyframes navCoreFlash {
    0% {
        transform: scale(0.35);
        opacity: 1;
    }
    100% {
        transform: scale(1.75);
        opacity: 0;
    }
}

/* ✨ 3. CHISPAS NEÓN CON ESTELA & MICROPARTÍCULAS */
.nav-click-sparkle {
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    z-index: 99999;
    opacity: 1;
    animation: navSparkleFly var(--fly-duration, 0.55s) cubic-bezier(0.12, 0.9, 0.25, 1) forwards;
    will-change: transform, opacity;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

@keyframes navSparkleFly {
    0% {
        transform: translate(0, 0) rotate(var(--angle, 0deg)) scale(1, 1);
        opacity: 1;
    }
    60% {
        opacity: 0.95;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--angle, 0deg)) scale(0.15, 0.15);
        opacity: 0;
    }
}

.nav-click-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    opacity: 1;
    animation: navParticleFly var(--fly-duration, 0.55s) cubic-bezier(0.12, 0.9, 0.25, 1) forwards;
    will-change: transform, opacity;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

@keyframes navParticleFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    70% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.2);
        opacity: 0;
    }
}

/* Content spacing adjustment */
main#content-area {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 25px);
}

/* Extra small devices */
@media (max-width: 360px) {
    .nav-item span {
        font-size: 0.64rem;
        letter-spacing: 0.2px;
    }
    .nav-item i {
        font-size: 1.15rem;
        width: 24px;
        height: 24px;
    }
}
