/* Mobile Tabbar Styles */
.mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 8px 0;
    border-top: 1px solid #eee;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Auto-hide on scroll down */
.mobile-tabbar.tabbar-hidden {
    transform: translateY(100%);
}

.mobile-tabbar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.mobile-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    padding: 4px 0;
    position: relative;
}

.mobile-tabbar-item:hover,
.mobile-tabbar-item.active {
    color: #ff6600;
    text-decoration: none;
}

.mobile-tabbar-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

.mobile-tabbar-item:hover i,
.mobile-tabbar-item.active i {
    transform: scale(1.1);
}

.mobile-tabbar-item span {
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
}

/* Badge for notifications */
.mobile-tabbar-item .badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(12px);
    background: #ff0000;
    color: #fff;
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 9px;
    min-width: 16px;
    text-align: center;
}

/* Show only on mobile devices */
@media (max-width: 768px) {
    .mobile-tabbar {
        display: block;
    }

    /* Add padding to prevent content from being hidden behind the tabbar */
    body {
        padding-bottom: 0 !important;
    }

    /* Adjust site wrapper to add space at bottom */
    .site {
        padding-bottom: 65px !important;
    }


    /* Ensure site content has proper spacing */
    .site-content {
        margin-bottom: 20px;
    }

    /* Add extra space to the last elements in footer */
    .site-footer .site-info,
    .site-footer .footer-links {
        margin-bottom: 20px;
    }

    .site-footer .container {
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .mobile-tabbar-item i {
        font-size: 20px;
    }

    .mobile-tabbar-item span {
        font-size: 10px;
    }
}

/* Dark mode support (if your theme has it) */
@media (prefers-color-scheme: dark) {
    .mobile-tabbar {
        background: #1a1a1a;
        border-top: 1px solid #333;
    }

    .mobile-tabbar-item {
        color: #999;
    }

    .mobile-tabbar-item:hover,
    .mobile-tabbar-item.active {
        color: #ff6600;
    }
}

/* Touch feedback */
.mobile-tabbar-item.touch-active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

/* Animation for tab switching */
@keyframes tabPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.mobile-tabbar-item.active i {
    animation: tabPulse 0.3s ease;
}

/* Ripple effect on tap */
.mobile-tabbar-item {
    overflow: hidden;
    position: relative;
}

.mobile-tabbar-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mobile-tabbar-item:active::after {
    width: 100px;
    height: 100px;
}

/* Slide up animation on page load */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-tabbar {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .mobile-tabbar {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Prevent text selection on touch */
.mobile-tabbar-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Active state with glow effect */
.mobile-tabbar-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: currentColor;
    border-radius: 0 0 3px 3px;
    opacity: 0.8;
}
