/* AB House Projects Floating Menu Styles */
/* Stylish floating navigation menu with accessibility and responsive design */

/* ===== CSS VARIABLES ===== */
:root {
    --menu-primary: #df691a;
    --menu-secondary: #fd7e14;
    --menu-dark: #495057;
    --menu-light: #f8f9fa;
    --menu-shadow: rgba(0, 0, 0, 0.15);
    --menu-shadow-hover: rgba(0, 0, 0, 0.25);
    --menu-backdrop: rgba(255, 255, 255, 0.1);
}

/* ===== FLOATING MENU CONTAINER ===== */
.floating-menu {
    position: fixed !important;
    left: 1.5rem !important;
    top: 1.5rem !important;
    z-index: 99999 !important;
    background: linear-gradient(135deg, var(--menu-primary), var(--menu-secondary)) !important;
    border-radius: 2rem !important;
    padding: 0.8rem 0.6rem !important;
    box-shadow: 
        0 8px 25px var(--menu-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.8) !important;
    animation: menuFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.floating-menu:hover {
    box-shadow: 
        0 12px 35px var(--menu-shadow-hover),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: scale(0.85);
}

/* ===== MENU ITEMS ===== */
.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.menu-item {
    position: relative;
    text-decoration: none !important;
    color: white !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* Initial state for staggered animation */
    opacity: 0;
    transform: translateX(-2rem) scale(0.8);
    /* Ensure visibility and interaction */
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Staggered animation for menu items */
.menu-item:nth-child(1) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.menu-item:nth-child(2) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

.menu-item:nth-child(3) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

.menu-item:nth-child(4) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.4s forwards;
}

.menu-item:nth-child(5) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.6s forwards;
}

.menu-item:nth-child(6) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.8s forwards;
}

.menu-item:nth-child(7) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2s forwards;
}

.menu-item:nth-child(8) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.2s forwards;
}

.menu-item:nth-child(9) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.4s forwards;
}

.menu-item:nth-child(10) {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.6s forwards;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(0.2rem) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.menu-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ===== MENU ITEM ICON ===== */
.menu-item i {
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    display: block;
    line-height: 1;
}

.menu-item:hover i {
    transform: scale(1.1);
}

/* ===== TOOLTIP ===== */
.menu-tooltip {
    position: absolute;
    left: 3.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--menu-dark);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    pointer-events: none;
}

.menu-tooltip::before {
    content: '';
    position: absolute;
    left: -0.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 0.2rem solid transparent;
    border-bottom: 0.2rem solid transparent;
    border-right: 0.2rem solid var(--menu-dark);
}

.menu-item:hover .menu-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0.4rem);
}

/* ===== ACCESSIBILITY ===== */
.menu-item:focus .menu-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0.5rem);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .floating-menu {
        left: 1rem;
        top: 1rem;
        padding: 0.6rem 0.4rem;
        border-radius: 1.2rem;
        /* Update animation for mobile */
        animation: menuFadeInMobile 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
    }
    
    .floating-menu:hover {
        transform: scale(0.8);
    }
    
    .menu-item {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
        border-radius: 0.6rem;
    }
    
    .menu-tooltip {
        left: 3rem;
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .floating-menu {
        left: 0.75rem;
        top: 0.75rem;
        padding: 0.5rem 0.3rem;
        border-radius: 1rem;
        /* Update animation for small mobile */
        animation: menuFadeInSmall 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
    }
    
    .floating-menu:hover {
        transform: scale(0.75);
    }
    
    .menu-item {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.8rem;
        gap: 0.4rem;
        border-radius: 0.5rem;
    }
    
    .menu-tooltip {
        display: none; /* Hide tooltips on very small screens */
    }
}

/* Mobile-specific animations */
@keyframes menuFadeInMobile {
    0% {
        opacity: 0.01;
        transform: scale(0.5) translateY(-1.5rem);
    }
    100% {
        opacity: 1;
        transform: scale(0.75) translateY(0);
    }
}

@keyframes menuFadeInSmall {
    0% {
        opacity: 0.01;
        transform: scale(0.4) translateY(-1rem);
    }
    100% {
        opacity: 1;
        transform: scale(0.7) translateY(0);
    }
}

/* ===== HIGH CONTRAST MODE ===== */
.high-contrast .floating-menu {
    background: linear-gradient(135deg, #b8530d, #e6630f);
    border: 2px solid #fff;
    box-shadow: 
        0 0 0 2px #fff,
        0 10px 30px rgba(0, 0, 0, 0.4);
}

.high-contrast .menu-item {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid #fff;
    color: #fff;
    font-weight: 600;
}

.high-contrast .menu-item:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.high-contrast .menu-tooltip {
    background: #2c1810;
    border: 2px solid #fff;
    color: #fff;
    font-weight: 600;
}

/* ===== ANIMATION EFFECTS ===== */
@keyframes menuFadeIn {
    0% {
        opacity: 0.01;
        transform: scale(0.6) translateY(-2rem);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9) translateY(-0.5rem);
    }
    100% {
        opacity: 1;
        transform: scale(0.8) translateY(0);
    }
}

@keyframes menuItemSlideIn {
    0% {
        opacity: 0.01;
        transform: translateX(-2rem) scale(0.8);
    }
    60% {
        opacity: 0.8;
        transform: translateX(0.2rem) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes menuItemPulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
        opacity: 1;
    }
    100% { 
        transform: scale(1.08);
        opacity: 1;
    }
}

/* Hover bounce animation */
@keyframes menuItemBounce {
    0%, 100% {
        transform: translateX(0.2rem) scale(1.08);
    }
    50% {
        transform: translateX(0.3rem) scale(1.15);
    }
}

/* ===== FLOATING MENU COLLAPSED STATE (FUTURE ENHANCEMENT) ===== */
.floating-menu.collapsed {
    padding: 0.5rem;
}

.floating-menu.collapsed .menu-items {
    gap: 0.5rem;
}

.floating-menu.collapsed .menu-item {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

/* ===== SMOOTH TRANSITIONS ===== */
.floating-menu,
.menu-item,
.menu-tooltip {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PRINT STYLES ===== */
@media print {
    .floating-menu {
        display: none;
    }
}
