/* ============================================================
   BOTTOM MENU CSS - Floating Toggle Button (Left Side)
   Complete menu hides, button shifts to left
   ============================================================ */

/* Main Container */
#global-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1a1a2e;
    border-top: 2px solid #16213e;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    display: block !important;
}

/* When menu is visible */
#global-bottom-menu.visible {
    transform: translateY(0);
}

/* When menu is hidden - Complete menu goes down */
#global-bottom-menu.hidden {
    transform: translateY(100%);
}

/* Menu Wrapper */
#global-bottom-menu .menu-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: all 0.3s ease;
}

#global-bottom-menu .menu-wrapper::-webkit-scrollbar {
    display: none;
}

/* Menu Items */
#global-bottom-menu .menu-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    min-width: max-content;
    gap: 5px;
}

/* Individual Menu Item */
#global-bottom-menu .menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
}

#global-bottom-menu .menu-item .menu-icon {
    font-size: 20px;
    margin-bottom: 3px;
    transition: all 0.3s ease;
    color: #e94560;
}

#global-bottom-menu .menu-item .menu-label {
    font-size: 10px;
    opacity: 0.8;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Active State */
#global-bottom-menu .menu-item.active {
    background: #0f3460;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

#global-bottom-menu .menu-item.active .menu-icon {
    transform: scale(1.1);
}

/* Hover State */
#global-bottom-menu .menu-item:hover:not(.active) {
    background: #16213e;
    transform: translateY(-2px);
}

/* Badge */
#global-bottom-menu .menu-item .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================================
   FLOATING TOGGLE BUTTON - Left Side
   ============================================================ */
#menu-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
}

/* Button when menu is visible - Normal position */
#menu-toggle-btn.menu-visible {
    bottom: 85px;
    left: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* Button when menu is hidden - Stays at bottom left */
#menu-toggle-btn.menu-hidden {
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
    animation: pulse-btn 2s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 30px rgba(245, 87, 108, 0.6);
    }
}

/* Button hover */
#menu-toggle-btn:hover {
    transform: scale(1.1);
}

#menu-toggle-btn.menu-hidden:hover {
    transform: scale(1.1);
}

/* Button icon */
#menu-toggle-btn .btn-icon {
    transition: transform 0.4s ease;
    display: inline-block;
}

/* Icon rotation */
#menu-toggle-btn .btn-icon.up {
    transform: rotate(0deg);
}

#menu-toggle-btn .btn-icon.down {
    transform: rotate(180deg);
}

/* Button tooltip */
#menu-toggle-btn .tooltip-text {
    position: absolute;
    left: 65px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

#menu-toggle-btn:hover .tooltip-text {
    opacity: 1;
}

#menu-toggle-btn .tooltip-text::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.8);
}

/* Badge on toggle button */
#menu-toggle-btn .toggle-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    display: none;
}

#menu-toggle-btn .toggle-badge.active {
    display: block;
    animation: pulse-badge 2s infinite;
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
#global-bottom-menu.light-theme {
    background: #ffffff;
    border-top: 2px solid #e0e0e0;
}

#global-bottom-menu.light-theme .menu-item {
    color: #333333;
}

#global-bottom-menu.light-theme .menu-item .menu-icon {
    color: #0f3460;
}

#global-bottom-menu.light-theme .menu-item.active {
    background: #f0f0f0;
}

#global-bottom-menu.light-theme .menu-item:hover:not(.active) {
    background: #e8e8e8;
}

#menu-toggle-btn.light-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
    #global-bottom-menu {
        border-top: 1px solid #16213e;
    }
    
    #global-bottom-menu .menu-wrapper {
        padding: 6px 8px;
    }
    
    #global-bottom-menu .menu-items {
        gap: 2px;
    }
    
    #global-bottom-menu .menu-item {
        min-width: 50px;
        padding: 6px 8px;
    }
    
    #global-bottom-menu .menu-item .menu-icon {
        font-size: 18px;
    }
    
    #global-bottom-menu .menu-item .menu-label {
        font-size: 9px;
    }
    
    #global-bottom-menu .menu-item .badge {
        font-size: 8px;
        padding: 1px 5px;
        min-width: 15px;
    }
    
    #menu-toggle-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
        bottom: 15px;
        left: 15px;
    }
    
    #menu-toggle-btn.menu-visible {
        bottom: 75px;
        left: 15px;
    }
    
    #menu-toggle-btn .tooltip-text {
        display: none;
    }
}

@media (max-width: 480px) {
    #global-bottom-menu .menu-item {
        min-width: 45px;
        padding: 4px 6px;
    }
    
    #global-bottom-menu .menu-item .menu-icon {
        font-size: 16px;
    }
    
    #global-bottom-menu .menu-item .menu-label {
        font-size: 8px;
    }
    
    #global-bottom-menu .menu-wrapper {
        padding: 4px 5px;
    }
    
    #menu-toggle-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
        bottom: 12px;
        left: 12px;
    }
    
    #menu-toggle-btn.menu-visible {
        bottom: 65px;
        left: 12px;
    }
}

/* ============================================================
   SPACER
   ============================================================ */
#bottom-menu-spacer {
    height: 0;
    display: none;
    width: 100%;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#bottom-menu-spacer.active {
    display: block;
    height: 75px;
}

/* When menu is hidden, spacer is 0 */
#bottom-menu-spacer.menu-hidden {
    height: 0 !important;
}

@media (max-width: 768px) {
    #bottom-menu-spacer.active {
        height: 65px;
    }
}

@media (max-width: 480px) {
    #bottom-menu-spacer.active {
        height: 55px;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Accessibility */
#global-bottom-menu .menu-item:focus-visible,
#menu-toggle-btn:focus-visible {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    #global-bottom-menu .menu-item,
    #global-bottom-menu,
    #menu-toggle-btn,
    #menu-toggle-btn .btn-icon,
    #global-bottom-menu .menu-item .badge,
    #menu-toggle-btn {
        animation: none !important;
        transition: none !important;
    }
}