/* 
  Bottom Navigation Bar - Telegram App Experience
  Floating, Glassmorphic Tab Bar
*/

.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 500px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    display: none; /* Hide on desktop */
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 100px;
    }
}

/* More Menu Popover */
.more-menu {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(100px); /* Precisely centers above the More button in the 500px container */
    width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    transform-origin: bottom center;
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 500px) {
    .more-menu {
        left: auto;
        right: 15px;
        transform: none;
    }
}

.more-menu.show {
    display: flex;
}

.more-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.more-item:active {
    background: var(--surface-hover);
}

.more-item i {
    font-size: 1.1rem;
    color: var(--primary);
    width: 20px;
}

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

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 100px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    gap: 2px;
    flex: 1;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
    text-align: center;
}

.nav-item i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

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

.nav-item.active i {
    transform: translateY(-2px);
    text-shadow: 0 2px 5px rgba(141, 21, 58, 0.1);
}

@media (max-width: 380px) {
    .nav-item span {
        display: none;
    }
    .nav-item i {
        font-size: 1.3rem;
    }
    .bottom-nav {
        height: 55px;
    }
}
