/**
 * Mobile Bottom Navigation Bar
 * UpGadget E-commerce
 * 
 * Navigation Items:
 * - Beranda (Home)
 * - Produk (Products)
 * - WhatsApp (Customer Service)
 * - Compare (Product Comparison)
 * - Promo (Flash Sale)
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Primary Color - Brand Blue */
    --primary-color: #0052CC;
    --primary-hover: #0043A8;

    /* WhatsApp Color */
    --whatsapp-color: #25D366;
    --whatsapp-hover: #1EBE57;

    /* Promo/Flash Sale Color */
    --promo-color: #FF6B35;
    --promo-hover: #E55A2B;

    /* Active State */
    --active-color: #0052CC;
    --active-bg: rgba(0, 82, 204, 0.1);

    /* Inactive State */
    --inactive-color: #5f6368;
    --inactive-icon: #5f6368;

    /* Background - Light grey */
    --navbar-bg: #dadce0;
    --navbar-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);

    /* Dimensions */
    --navbar-height: 60px;
    --icon-size: 24px;
    --label-font-size: 11px;
    --badge-size: 18px;
    --badge-font-size: 10px;
}

/* ========================================
   Mobile Bottom Navigation
   ======================================== */
.mobile-bottom-nav {
    display: none;
    /* Hidden by default, shown on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    box-shadow: var(--navbar-shadow);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

/* Container for nav items */
.mobile-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--navbar-height);
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* ========================================
   Navigation Items
   ======================================== */
.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--inactive-color);
    padding: 8px 4px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px;
    /* Minimum touch target */
    -webkit-tap-highlight-color: transparent;
}

/* Icon styling */
.mobile-bottom-nav .nav-item i {
    font-size: var(--icon-size);
    color: var(--inactive-icon);
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

/* Label styling */
.mobile-bottom-nav .nav-label {
    font-family: 'Poppins', sans-serif;
    font-size: var(--label-font-size);
    font-weight: 500;
    color: var(--inactive-color);
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

/* ========================================
   Active State
   ======================================== */
.mobile-bottom-nav .nav-item.active {
    color: var(--active-color);
}

.mobile-bottom-nav .nav-item.active i {
    color: var(--active-color);
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item.active .nav-label {
    color: var(--active-color);
    font-weight: 600;
}

/* Top indicator for active item */
.mobile-bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--active-color);
    border-radius: 0 0 3px 3px;
}

/* ========================================
   Hover Effects (Desktop/Tablet)
   ======================================== */
@media (hover: hover) {
    .mobile-bottom-nav .nav-item:hover {
        background: rgba(0, 0, 0, 0.03);
    }

    .mobile-bottom-nav .nav-item:hover i {
        transform: scale(1.15);
    }
}

/* ========================================
   Tap/Press Effects
   ======================================== */
.mobile-bottom-nav .nav-item:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.05);
}

/* ========================================
   WhatsApp Special Styling
   ======================================== */
.mobile-bottom-nav .nav-item-whatsapp i {
    color: var(--whatsapp-color) !important;
}

.mobile-bottom-nav .nav-item-whatsapp .nav-label {
    color: var(--whatsapp-color);
}

.mobile-bottom-nav .nav-item-whatsapp.active i,
.mobile-bottom-nav .nav-item-whatsapp:hover i {
    color: var(--whatsapp-hover) !important;
}

/* WhatsApp pulse animation */
@keyframes whatsapp-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.mobile-bottom-nav .nav-item-whatsapp i {
    animation: whatsapp-pulse 2s ease-in-out infinite;
}

.mobile-bottom-nav .nav-item-whatsapp:hover i,
.mobile-bottom-nav .nav-item-whatsapp.active i {
    animation: none;
}

/* ========================================
   Promo Special Styling
   ======================================== */
.mobile-bottom-nav .nav-item-promo i {
    color: var(--promo-color) !important;
}

.mobile-bottom-nav .nav-item-promo .nav-label {
    color: var(--promo-color);
}

.mobile-bottom-nav .nav-item-promo.active i,
.mobile-bottom-nav .nav-item-promo:hover i {
    color: var(--promo-hover) !important;
}

/* Promo shine effect */
@keyframes promo-shine {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

.mobile-bottom-nav .nav-item-promo i {
    animation: promo-shine 1.5s ease-in-out infinite;
}

/* ========================================
   Badge Notification
   ======================================== */
.mobile-bottom-nav .nav-icon-wrapper {
    position: relative;
    display: inline-block;
}

.mobile-bottom-nav .nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: var(--badge-size);
    height: var(--badge-size);
    background: var(--primary-color);
    color: white;
    border-radius: calc(var(--badge-size) / 2);
    font-size: var(--badge-font-size);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--navbar-bg);
}

/* Badge animation on update */
@keyframes badge-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.mobile-bottom-nav .nav-badge.updated {
    animation: badge-bounce 0.5s ease;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Show on tablets and mobile */
@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Add padding to main content to prevent overlap */
    main.main {
        padding-bottom: calc(var(--navbar-height) + 10px);
    }

    /* Adjust for page wrapper */
    .page-wrapper {
        padding-bottom: 0;
    }
}

/* Smaller screens (phones) */
@media (max-width: 575px) {
    :root {
        --navbar-height: 56px;
        --icon-size: 22px;
        --label-font-size: 10px;
    }

    .mobile-bottom-nav .nav-item {
        padding: 6px 2px;
    }

    .mobile-bottom-nav .nav-label {
        font-size: 9px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    :root {
        --navbar-height: 52px;
        --icon-size: 20px;
        --label-font-size: 9px;
    }

    .mobile-bottom-nav .nav-item {
        padding: 4px 1px;
    }
}

/* ========================================
   Hide on Scroll (Optional)
   ======================================== */
.mobile-bottom-nav.hidden {
    transform: translateY(100%);
}

/* ========================================
   Safe Area for iOS Notch
   ======================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    @media (max-width: 991px) {
        main.main {
            padding-bottom: calc(var(--navbar-height) + 10px + env(safe-area-inset-bottom));
        }
    }
}

/* ========================================
   Dark Mode Support (Future)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #1a1a1a;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .mobile-bottom-nav .nav-item {
        color: #AAAAAA;
    }

    .mobile-bottom-nav .nav-item i {
        color: #AAAAAA;
    }

    .mobile-bottom-nav .nav-item.active {
        color: #4A9EFF;
    }

    .mobile-bottom-nav .nav-item.active i {
        color: #4A9EFF;
    }

    .mobile-bottom-nav .nav-item.active::before {
        background: #4A9EFF;
    }

    .mobile-bottom-nav .nav-badge {
        border-color: #1a1a1a;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus styles for keyboard navigation */
.mobile-bottom-nav .nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .mobile-bottom-nav .nav-item,
    .mobile-bottom-nav .nav-item i,
    .mobile-bottom-nav .nav-label,
    .mobile-bottom-nav {
        transition: none !important;
        animation: none !important;
    }
}