/* ========================================
   FAB Navigation System
   Floating Action Button with Radial Menu
   ======================================== */

/* FAB Main Button */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 
        0 8px 16px rgba(79, 172, 254, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 24px rgba(79, 172, 254, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.fab-main.active {
    transform: rotate(135deg) scale(1.1);
    background: linear-gradient(135deg, #ff6b7a 0%, #c44569 100%);
    box-shadow: 
        0 12px 24px rgba(255, 107, 122, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Breathing Animation */
.fab-main::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    z-index: -1;
    animation: breathe 3s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.1; }
}

/* Vertical Menu */
.fab-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 450px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-menu.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.fab-menu-item {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.fab-menu-item:hover {
    transform: scale(1.2);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 
        0 8px 16px rgba(79, 172, 254, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.fab-menu-item.active {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 
        0 8px 16px rgba(67, 233, 123, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Menu Item Positions (Vertical Layout - Straight Up) */
.fab-menu-item:nth-child(1) {
    bottom: 380px;
    right: 5px;
    animation-delay: 0.1s;
}

.fab-menu-item:nth-child(2) {
    bottom: 320px;
    right: 5px;
    animation-delay: 0.15s;
}

.fab-menu-item:nth-child(3) {
    bottom: 260px;
    right: 5px;
    animation-delay: 0.2s;
}

.fab-menu-item:nth-child(4) {
    bottom: 200px;
    right: 5px;
    animation-delay: 0.25s;
}

.fab-menu-item:nth-child(5) {
    bottom: 140px;
    right: 5px;
    animation-delay: 0.3s;
}

.fab-menu-item:nth-child(6) {
    bottom: 80px;
    right: 5px;
    animation-delay: 0.35s;
}

/* Menu Item Labels */
.fab-menu-item::after {
    content: attr(data-label);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.fab-menu-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(-8px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }
    
    .fab-main {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    
    .fab-menu {
        width: 70px;
        height: 400px;
    }
    
    .fab-menu-item {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .fab-menu-item::after {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* Adjust positions for mobile - Vertical Layout */
    .fab-menu-item:nth-child(1) { bottom: 340px; right: 5px; }
    .fab-menu-item:nth-child(2) { bottom: 290px; right: 5px; }
    .fab-menu-item:nth-child(3) { bottom: 240px; right: 5px; }
    .fab-menu-item:nth-child(4) { bottom: 190px; right: 5px; }
    .fab-menu-item:nth-child(5) { bottom: 140px; right: 5px; }
    .fab-menu-item:nth-child(6) { bottom: 90px; right: 5px; }
}

/* Animation for menu items when menu opens */
@keyframes fabItemIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.fab-menu.active .fab-menu-item {
    animation: fabItemIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Backdrop blur when menu is open */
.fab-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fab-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* Scroll progress indicator */
.fab-progress {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #43e97b 0%, #43e97b var(--progress, 0%), transparent var(--progress, 0%), transparent 100%);
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fab-main:hover .fab-progress {
    opacity: 0.8;
}