/* MOBILE NAVIGATION REINVENTED - SMART & FLUID */

.mobile-nav-wrapper {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    width: auto;
    max-width: 95vw;
}

.mobile-nav-wrapper.auto-minimized,
.mobile-nav-wrapper.minimized-mode {
    bottom: -80px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.8);
}

/* THE FLOATING ISLAND BAR */
.mobile-bottom-nav {
    background: rgba(var(--bg-secondary-rgb), 0.85);
    /* Use dynamic RGBA if possible, fallback to dark/white */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUpNav 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .mobile-bottom-nav {
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-list {
    display: flex;
    gap: 10px;
}

.mobile-nav-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
}

.mobile-nav-link.active {
    background: var(--accent-primary);
    color: #fff !important;
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 20px rgba(var(--accent-primary-rgb), 0.4);
}

.mobile-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

/* THE TRIGGER CIRCLE (Visible when minimized) */
.nav-circle-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
    border: 3px solid #fff;
    pointer-events: auto;
}

.nav-circle-trigger:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes slideUpNav {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Spacing Fixes for View Overlap */
.mood-logger-card,
.view-container {
    padding-bottom: 110px !important;
}

.fullscreen-editor-controls {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 901px) {
    .mobile-nav-wrapper {
        display: none !important;
    }

    .nav-circle-trigger {
        display: none !important;
    }
}