/* ===================================
   Floating Navigation Ball (Mobile/Tablet)
   =================================== */

.floating-nav-ball {
    display: none;
    /* Hidden by default on large screens */
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Placing at Bottom Left as requested substitution for sidebar */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #0051D5);
    box-shadow: 0 8px 32px rgba(0, 81, 213, 0.4);
    color: white;
    font-size: 1.5rem;
    z-index: 1002;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-nav-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(0, 81, 213, 0.5);
}

.floating-nav-ball:active {
    transform: scale(0.95);
}

.floating-nav-menu {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 30px;
    /* Aligned with ball */
    width: 220px;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 8px;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    /* Ensure it handles overflow if too tall */
    max-height: 70vh;
    overflow-y: auto;
}

.floating-nav-menu::-webkit-scrollbar {
    width: 4px;
}

.floating-nav-menu::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 2px;
}

.floating-nav-menu.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    display: flex;
}

.floating-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
    text-decoration: none;
}

.floating-nav-item:hover {
    background: var(--control-bg-hover);
}

.floating-nav-item.active {
    background: var(--accent-blue);
    color: white;
}

.floating-nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.floating-nav-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

.floating-nav-divider {
    height: 1px;
    background: var(--divider-soft);
    margin: 4px 6px;
}

.floating-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: none;
}

.floating-nav-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Media Query Logic */
@media screen and (max-width: 1200px) {
    .floating-nav-ball {
        display: flex;
    }

    /* Strict override for old toggle btn */
    .sidebar-toggle-btn {
        display: none !important;
    }
}