/* Mobile Bottom Navigation - Modern App-like Design */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, rgba(20, 20, 22, 0.98) 0%, rgba(10, 10, 12, 0.99) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 68, 0, 0.3);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Show only on mobile - matches old nav breakpoint at 1190px */
@media (max-width: 1190px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Add padding to body/content so it doesn't get hidden behind nav */
    body.has-mobile-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)) !important;
    }
    
    body.has-mobile-nav footer {
        margin-bottom: calc(64px + env(safe-area-inset-bottom, 0));
    }
}

.mobile-bottom-nav__items {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    margin: 0;
    list-style: none;
}

.mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    max-width: 80px;
}

.mobile-bottom-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    text-decoration: none;
    color: #888;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    width: 100%;
    position: relative;
}

.mobile-bottom-nav__link:hover,
.mobile-bottom-nav__link:focus,
.mobile-bottom-nav__link:active {
    color: #fff;
    text-decoration: none;
}

.mobile-bottom-nav__link.active {
    color: #FF4400;
}

.mobile-bottom-nav__link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #FF4400;
    border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav__link:active .mobile-bottom-nav__icon {
    transform: scale(0.9);
}

.mobile-bottom-nav__icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.mobile-bottom-nav__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
}

/* More Menu Button */
.mobile-bottom-nav__link--more {
    position: relative;
}

/* More Menu Panel */
.mobile-more-menu {
    display: none;
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom, 0));
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(25, 25, 28, 0.98) 0%, rgba(15, 15, 18, 0.99) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 68, 0, 0.2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 9998;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.mobile-more-menu.open {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-more-menu__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 64px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-more-menu__overlay.open {
    display: block;
    opacity: 1;
}

.mobile-more-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-more-menu__title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.mobile-more-menu__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-more-menu__close:hover {
    background: rgba(255, 68, 0, 0.2);
    color: #FF4400;
}

.mobile-more-menu__section {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-more-menu__section:last-child {
    border-bottom: none;
}

.mobile-more-menu__section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-more-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-more-menu__item {
    margin: 0;
}

.mobile-more-menu__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.mobile-more-menu__link:hover,
.mobile-more-menu__link:active {
    background: rgba(255, 68, 0, 0.1);
    color: #FF4400;
    text-decoration: none;
}

.mobile-more-menu__link--vip {
    color: #FFD700 !important;
}

.mobile-more-menu__link--logout {
    color: #ff6b6b !important;
}

.mobile-more-menu__link-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.mobile-more-menu__link-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* User info in more menu */
a.mobile-more-menu__user,
.mobile-more-menu__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 68, 0, 0.05);
    border-bottom: 1px solid rgba(255, 68, 0, 0.1);
    text-decoration: none;
    transition: background 0.2s ease;
}

a.mobile-more-menu__user:hover,
a.mobile-more-menu__user:focus,
a.mobile-more-menu__user:active {
    background: rgba(255, 68, 0, 0.12);
    text-decoration: none !important;
}

.mobile-more-menu__user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF4400, #FF6B00);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.mobile-more-menu__user-info {
    flex: 1;
}

.mobile-more-menu__user-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.mobile-more-menu__user-status {
    font-size: 11px;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation for menu items */
.mobile-more-menu.open .mobile-more-menu__item {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.mobile-more-menu.open .mobile-more-menu__item:nth-child(1) { animation-delay: 0.02s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(2) { animation-delay: 0.04s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(3) { animation-delay: 0.06s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(4) { animation-delay: 0.08s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(5) { animation-delay: 0.1s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(6) { animation-delay: 0.12s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(7) { animation-delay: 0.14s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(8) { animation-delay: 0.16s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(9) { animation-delay: 0.18s; }
.mobile-more-menu.open .mobile-more-menu__item:nth-child(10) { animation-delay: 0.2s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide old slideout toggle on mobile when bottom nav is active */
@media (max-width: 1190px) {
    .has-mobile-nav header nav a.toggleMenu,
    .has-mobile-nav header nav ul.navigation-links li:last-child {
        display: none !important;
    }
    
    /* Also hide old slideout menu for mobile-nav users */
    .has-mobile-nav .slideout-menu {
        display: none !important;
    }
}

/* Ripple effect on tap */
.mobile-bottom-nav__link {
    overflow: hidden;
}

.mobile-bottom-nav__link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 68, 0, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.mobile-bottom-nav__link:active::after {
    width: 120px;
    height: 120px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}
