/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(15, 23, 42, 0.95); /* var(--primary-color) with opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    z-index: 1000;
    height: 80px; /* Increased height to accommodate the floating button */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: all 0.3s ease;
    width: 60px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav-item.active {
    color: #3b82f6; /* Blue color like in the screenshot */
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

/* Center Floating Button */
.mobile-nav-center {
    position: relative;
    top: -25px; /* Float above the bar */
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-fab {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    border: 4px solid var(--primary-color); /* Match background to create "cutout" effect */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.mobile-nav-fab:active {
    transform: scale(0.95);
}

/* Popover Menu for Tabs */
.mobile-nav-item-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.mobile-nav-popover {
    position: absolute;
    bottom: 70px; /* Above the nav bar */
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b; /* Secondary color */
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 0.25rem;
    z-index: 1001;
}

.mobile-nav-popover.show {
    display: flex;
    animation: slideUp 0.2s ease-out;
}

.mobile-nav-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background-color: #1e293b;
    border-right: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #f8fafc;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.popover-item:hover {
    background-color: #334155;
}

.popover-item i {
    width: 20px;
    text-align: center;
    color: #3b82f6;
}

/* FAB Menu (Central) */
.mobile-fab-menu {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    z-index: 1001;
    pointer-events: none; /* Let clicks pass through when hidden */
}

.mobile-fab-menu.show {
    pointer-events: auto;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1e293b;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #334155;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    white-space: nowrap;
}

.mobile-fab-menu.show .fab-menu-item {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for FAB items */
.mobile-fab-menu.show .fab-menu-item:nth-child(3) { transition-delay: 0.05s; }
.mobile-fab-menu.show .fab-menu-item:nth-child(2) { transition-delay: 0.1s; }
.mobile-fab-menu.show .fab-menu-item:nth-child(1) { transition-delay: 0.15s; }

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Profile Image in Bottom Nav */
.mobile-nav-profile-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.mobile-nav-item.active .mobile-nav-profile-img {
    border-color: #3b82f6;
}

/* Media Query to show only on mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    /* Add padding to body to prevent content from being hidden behind nav */
    body {
        padding-bottom: 90px;
    }

    /* Hide original FAB on mobile */
    .fab-main {
        display: none !important;
    }

    /* Hide User Menu on Mobile */
    .user-menu {
        display: none !important;
    }

    /* Hide Desktop Navigation Links in Dreams Page */
    .desktop-nav-link {
        display: none !important;
    }

    /* Hide Tabs in Community Page */
    .tabs-container {
        display: none !important;
    }
}
