/* Mobile Navigation (Floating Bottom Bar) */

/* Hide mobile nav by default on desktop */
.mobile-nav {
    display: none;
}

@media (max-width: 768px) {

    /* MODERN FLOATING NAVIGATION */
    .mobile-nav {
        position: fixed;
        bottom: max(20px, env(safe-area-inset-bottom, 10px) + 10px);
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 30px;
        padding: 16px 24px;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.05),
            0 2px 8px rgba(0, 0, 0, 0.03),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            inset 0 -1px 0 rgba(0, 0, 0, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        gap: 24px;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* COLLAPSED STATE - THREE DOTS */
    .mobile-nav.collapsed {
        width: 60px !important;
        height: 60px !important;
        border-radius: 30px !important;
        padding: 0 !important;
        gap: 0 !important;
        cursor: pointer;
        background: rgba(255, 255, 255, 0.06) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        box-shadow:
            0 12px 36px rgba(0, 0, 0, 0.08),
            0 4px 12px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            inset 0 -1px 0 rgba(0, 0, 0, 0.03) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    }

    .mobile-nav.collapsed:hover {
        transform: translateX(-50%) scale(1.05);
        background: rgba(255, 255, 255, 0.08);
        box-shadow:
            0 16px 40px rgba(0, 0, 0, 0.12),
            0 6px 16px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    }

    /* Hide navigation buttons when collapsed */
    .mobile-nav.collapsed .mobile-nav-btn {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: scale(0.5);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Three dots indicator when collapsed */
    .mobile-nav.collapsed::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #007AFF;
        box-shadow:
            -12px 0 0 #007AFF,
            12px 0 0 #007AFF,
            0 0 0 rgba(0, 122, 255, 0.3),
            -12px 0 0 rgba(0, 122, 255, 0.3),
            12px 0 0 rgba(0, 122, 255, 0.3);
        opacity: 1;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        animation: dots-pulse 2s ease-in-out infinite;
    }

    /* Animate the dots */
    @keyframes dots-pulse {

        0%,
        100% {
            opacity: 0.7;
            transform: translate(-50%, -50%) scale(1);
        }

        50% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1.1);
        }
    }

    /* Hide dots when expanded */
    .mobile-nav:not(.collapsed)::before {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Ensure buttons are visible when expanded */
    .mobile-nav:not(.collapsed) .mobile-nav-btn {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: scale(1);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* DARK MODE NAV */
    body.dark .mobile-nav.collapsed {
        background: rgba(0, 0, 0, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow:
            0 12px 36px rgba(0, 0, 0, 0.25),
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }

    body.dark .mobile-nav.collapsed:hover {
        background: rgba(0, 0, 0, 0.16);
        box-shadow:
            0 16px 40px rgba(0, 0, 0, 0.35),
            0 6px 16px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            inset 0 -1px 0 rgba(0, 0, 0, 0.25);
    }

    body.dark .mobile-nav.collapsed::before {
        background: #0A84FF;
        box-shadow:
            -12px 0 0 #0A84FF,
            12px 0 0 #0A84FF,
            0 0 0 rgba(10, 132, 255, 0.4),
            -12px 0 0 rgba(10, 132, 255, 0.4),
            12px 0 0 rgba(10, 132, 255, 0.4);
    }

    body.dark .mobile-nav {
        background: rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.15),
            0 2px 8px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    }

    .mobile-nav-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #007AFF;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
        font-size: 20px;
    }

    .mobile-nav-btn:active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.35);
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }

    .mobile-nav-btn.active,
    .mobile-nav-btn.home-btn {
        background: rgba(0, 122, 255, 0.3);
        color: #fff;
        border-color: rgba(0, 122, 255, 0.5);
        box-shadow:
            0 4px 16px rgba(0, 122, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }

    body.dark .mobile-nav-btn {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #0A84FF;
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

    body.dark .mobile-nav-btn:active {
        background: rgba(255, 255, 255, 0.2);
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }

    body.dark .mobile-nav-btn.active,
    body.dark .mobile-nav-btn.home-btn {
        background: rgba(10, 132, 255, 0.4);
        color: #fff;
        border-color: rgba(10, 132, 255, 0.6);
        box-shadow:
            0 4px 16px rgba(10, 132, 255, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}