/* Mobile Footer Bar - Bottom Navigation */
.mobile-footer-bar {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 54px; /* Slightly reduced height for a sleeker look */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* Premium glassmorphism effect */
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px dashed var(--border-main); /* Restored visible dashed border to match platform theme */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04); /* Softer, broader shadow */
    z-index: 10000; /* Above everything */
    padding: 0; /* Let flex handle spacing */
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area support */
}

@media (max-width: 1024px) {
    /* Hide the standard main footer and its container on mobile/tablet */
    .main-footer,
    #footer-placeholder {
        display: none !important;
    }

    /* Show the mobile footer bar */
    .mobile-footer-bar {
        display: block;
    }

    /* Add padding to body to prevent content from being hidden behind the bar */
    body {
        padding-bottom: 70px;
    }
}

.mobile-nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.mobile-nav-item {
    flex: 1 1 0px !important; /* Guarantee absolute equal width distribution */
    display: block !important;
    text-align: center !important;
    height: 100% !important;
    min-width: 0 !important; /* Crucial for text ellipsis inside Flexbox */
}

.mobile-nav-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 100% !important;
    gap: 4px !important;
    text-decoration: none !important;
    color: var(--color-gray-500);
    transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0 2px !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent; /* Remove default blue tap highlight on mobile */
}

.mobile-nav-link i {
    font-size: 19px; /* Slightly reduced for compact height */
    width: 44px;
    height: 28px;
    border-radius: 14px; /* Perfect pill shape */
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.3s ease;
}

.mobile-nav-link span {
    display: block !important;
    font-size: 9.5px !important; /* Slightly smaller for elegance */
    font-weight: 600 !important; /* Bolder to remain readable */
    line-height: 1.2 !important;
    text-transform: capitalize !important;
    letter-spacing: -0.1px !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 1px !important;
    color: inherit;
}

/* Active State & Hover */
.mobile-nav-item.active .mobile-nav-link,
.mobile-nav-link:hover {
    color: var(--color-primary) !important;
}

.mobile-nav-item.active .mobile-nav-link i {
    transform: translateY(-2px) scale(1.05); /* Reduced scale slightly to account for the background bubble */
    background-color: rgba(37, 99, 235, 0.12); /* Subtle primary color background pill */
}

.mobile-nav-link:active i {
    transform: scale(0.9); /* Subtle click/tap feedback */
}

/* Extra Responsiveness for very small screens (e.g. iPhone SE) */
@media (max-width: 380px) {
    .mobile-nav-link span {
        font-size: 8px !important; /* Shrink text safely */
        letter-spacing: -0.2px !important;
    }
    
    .mobile-nav-link i {
        font-size: 16px; /* Shrink icon */
    }
}

/* Dark Mode Support */
body.dark-mode .mobile-footer-bar {
    background: rgba(30, 41, 59, 0.95); /* Semi-transparent dark bg */
    border-top-color: var(--border-main);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-mode .mobile-nav-link {
    color: var(--color-gray-400);
}

body.dark-mode .mobile-nav-item.active .mobile-nav-link {
    color: var(--color-primary);
}

body.dark-mode .mobile-nav-item.active .mobile-nav-link i {
    background-color: rgba(37, 99, 235, 0.25); /* Stand out more in dark mode */
}
