/* Floating Bottom Navigation Bar */
.bottom-nav-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 520px;
    height: 68px;
    z-index: 2000;
    /* High z-index to stay on top */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;

    /* Visual Style */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.02);

    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus Mode - Hide Bottom Nav */
body.chat-focus-mode .bottom-nav-container {
    transform: translateX(-50%) translateY(150%);
    pointer-events: none;
    opacity: 0;
}

/* Focus Mode - Hide Action Menu Overlay if open */
body.chat-focus-mode .action-menu-overlay {
    opacity: 0;
    pointer-events: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9CA3AF;
    /* Neutral Gray */
    transition: all 0.2s ease;
    position: relative;
}

.bottom-nav-item:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
    margin-bottom: 4px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Center "+" Button */
.bottom-nav-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(-24px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0 8px;
}

.bottom-nav-fab:hover {
    transform: translateY(-28px) scale(1.05);
    box-shadow: 0 12px 24px rgba(var(--color-primary-rgb), 0.5);
    background: var(--color-primary-hover);
}

.bottom-nav-fab svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5px;
}

/* Ensure content doesn't hide behind nav */
.main-content-centered {
    padding-bottom: 120px !important;
}

/* Hide on very small screens if needed, or adjust */
@media (max-width: 360px) {
    .bottom-nav-container {
        width: 96%;
        padding: 0 8px;
    }

    .bottom-nav-item {
        width: 50px;
    }
}

/* --- Universal Action Launcher Menu --- */
.action-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1900;
    /* Below nav bar (2000) but above everything else */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.action-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.action-menu-container {
    position: fixed;
    bottom: 100px;
    /* Above the FAB */
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: auto;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-menu-overlay.active .action-menu-container {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    bottom: 110px;
}

.action-menu-grid {
    display: flex;
    gap: 24px;
    padding: 20px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 20px 40px -8px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.action-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.action-menu-item:hover {
    transform: translateY(-4px);
}

.action-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.action-menu-item:hover .action-icon-wrapper {
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.15);
}

.action-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.action-label {
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
}

/* Colors */
.task-color {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.note-color {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.voice-color {
    background: linear-gradient(135deg, #EC4899, #DB2777);
}

.sync-color {
    background: linear-gradient(135deg, #10B981, #059669);
}

/* FAB Rotation when active */
.bottom-nav-fab.active {
    transform: translateY(-24px) rotate(45deg);
    background: #4B5563;
    /* Darker grey when active/close */
}