.bottom-menu {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg); /* Solid background to ensure opacity */
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--card-hover) 100%); /* Gradient overlay */
    border-top: 1px solid var(--border-color);
    padding: 10px 8px;
    position: fixed;
    bottom: 0;
    width: 100%; /* Full viewport width */
    max-height: 14vh; /* Constrain height to 10-18% of viewport */
    z-index: 1000; /* Ensure menu stays above content */
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.5s ease-out forwards;
    overflow-x: auto;
    white-space: nowrap;
    transition: transform 0.3s ease-in-out;
}

.bottom-menu.mobile-menu-open {
    transform: translateY(0); /* Slide in for mobile */
}

.menu-item {
    flex: 0 1 auto;
    text-align: center;
    padding: clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 14px);
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    position: relative;
    min-width: clamp(60px, 15vw, 70px);
    max-width: clamp(100px, 20vw, 110px);
    cursor: pointer;
    font-size: clamp(10px, 2vw, 12px);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 clamp(3px, 0.8vw, 4px);
}

.menu-item:hover {
    color: var(--primary-color);
    background: var(--card-hover);
    transform: translateY(-3px) scale(1.05);
    border-radius: 8px;
}

.menu-item.active {
    color: var(--primary-dark);
    font-weight: 600;
    background: linear-gradient(0deg, rgba(0, 136, 204, 0.6) 0%, rgba(248, 249, 250, 0.8) 100%); /* More transparent gradient */
    transform: translateY(-1px); /* Lower transform for less pronounced effect */
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.menu-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
}

.menu-icon {
    font-size: clamp(14px, 3vw, 18px);
    margin-bottom: clamp(3px, 0.8vw, 4px);
    transition: transform 0.3s ease;
}

.menu-item:hover .menu-icon {
    transform: scale(1.1) rotate(5deg);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -1px;
    background-color: var(--overdue-color);
    color: white;
    border-radius: 50%;
    width: clamp(16px, 2vw, 18px);
    height: clamp(16px, 2vw, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(8px, 1.5vw, 9px);
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s infinite ease-in-out;
}

.menu-item:hover .notification-badge {
    animation: bounce 0.3s ease;
}

/* Tooltip for desktop */
.menu-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: clamp(10px, 1.5vw, 11px);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.menu-item:hover::after {
    opacity: 1;
}