:root {
    /* Glassmorphism Variables */
    --nav-bg: rgba(25, 25, 30, 0.65);
    --nav-border: rgba(255, 255, 255, 0.12);
    --item-active-bg: rgba(255, 255, 255, 0.15);
    --text-color: #a1a1aa;
    --text-active: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* --- PILL NAVIGATION WRAPPER --- */
.nav-wrapper {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    /* Animative touch for appearance/disappearance */
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 95%;
    max-width: 500px;
    -webkit-tap-highlight-color: transparent;
}

/* Visible state when user is logged in */
.nav-wrapper.is-logged-in {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) { 
    .nav-wrapper { display: none !important; } 
}

/* --- PILL CONTAINER (THE GLASS) --- */
#bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(4px) saturate(180%);
    -webkit-backdrop-filter: blur(4px) saturate(180%);
    border: 1px solid var(--nav-border);
    border-radius: 60px;
    padding: 8px;
    box-shadow: 0 12px 36px var(--shadow-color), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

/* --- SLIDING INDICATOR --- */
.nav-indicator {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 0;
    background: var(--item-active-bg);
    border-radius: 50px;
    z-index: 1;
    /* Springy, fluid transition for the sliding effect */
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1.2);
    pointer-events: none;
}

/* --- NAVIGATION ITEMS --- */
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 4px;
    z-index: 2; /* Sit above the sliding indicator */
    border-radius: 40px;
    transition: color 0.3s ease, transform 0.2s ease;
}

/* Animative scale down when touched/clicked */
.nav-item:active {
    transform: scale(0.92);
}

.nav-item.active {
    color: var(--text-active);
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Bounce icon slightly on active */
.nav-item.active i {
    transform: translateY(-2px) scale(1.1);
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 0.9;
    white-space: nowrap;
}

/* Utility class for national intranet hiding */
.national-hidden { display: none !important; }