/* Apple-style bottom navigation for mobile devices */
.apple-bottom-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #022728; /* As requested */
    box-shadow: 0 -5px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    padding: 3px 0 3px 0; /* Further reduced height */
    padding-bottom: calc(3px + env(safe-area-inset-bottom)); /* Safe area support */
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.apple-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #fff;
    padding: 2px 0; /* even tighter vertical padding */
    transition: all 0.25s ease;
    width: 20%;
    text-align: center;
    position: relative;
}

.apple-bottom-nav .nav-item:active {
    transform: scale(0.9);
}

.apple-bottom-nav .nav-item i {
    font-size: 16px; /* smaller icon size */
    margin-bottom: 2px;
    display: block;
}

.apple-bottom-nav .nav-item span {
    font-size: 8.5px; /* slightly smaller label */
    font-weight: 600;
    letter-spacing: 0.2px;
    display: block;
    white-space: nowrap;
}

.apple-bottom-nav .nav-item.active {
    color: #00d4ac;
}

/* subtle active indicator dot */
.apple-bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

/* Special styling for Vote button */
.apple-bottom-nav .nav-item.vote-btn {
    color: #fff;
    transform: translateY(-8px); /* lower lift to compress background area */
}

.apple-bottom-nav .nav-item.vote-btn i {
    font-size: 18px; /* smaller central icon */
    background-color: #00d4ac;
    color: #022728;
    width: 38px; /* smaller fab */
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.26);
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.apple-bottom-nav .nav-item.vote-btn span {
    font-weight: 700;
    color: #00d4ac;
    margin-top: 5px;
}

/* Pulse animation for Vote button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 172, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 212, 172, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 172, 0);
    }
}

.apple-bottom-nav .nav-item.vote-btn i {
    animation: pulse 2s infinite;
}

/* Home indicator line like iOS */
.apple-bottom-nav:after {
    content: '';
    display: block;
    width: 90px; /* slimmer indicator */
    height: 3px;
    background-color: rgba(255, 255, 255, 0.28);
    border-radius: 3px;
    margin: 4px auto 0;
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .apple-bottom-nav {
        display: block;
    }
    
    /* Add padding to the bottom of the body to prevent content from being hidden behind the nav */
    body {
        padding-bottom: 50px !important; /* reduced again to match smaller nav */
        padding-bottom: calc(50px + env(safe-area-inset-bottom)) !important;
    }
    
    /* Hide the footer on mobile */
    #footer, 
    .desktop-only {
        display: none !important;
    }
    
    /* Hide the scroll-top button on mobile */
    #scroll-top {
        display: none !important;
    }
    
    /* Adjust Tawk.to chat widget on mobile */
    .tawk-min-container {
        bottom: 50px !important;
    }
    
    .tawk-card {
        bottom: 50px !important;
    }
    
    #tawk-bubble-container {
        bottom: 50px !important;
    }
    
    iframe[title="chat widget"] {
        margin-bottom: 46px !important;
    }
    
    /* Generic selectors for other chat widgets */
    .chat-widget-container,
    .livechat-container,
    div[id^="tawk-"],
    div[class^="tawk-"] {
        bottom: 50px !important;
    }
}