/**
 * Liquid Glass Navigation v10
 * Старый glass + исправлена центровка + меньше желейности
 */

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + var(--safe-area-bottom, 0px));
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    max-width: 380px;
    height: 64px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    
    /* Старый glass */
    background: rgba(16, 16, 19, 0.568);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    
    border-radius: 999px;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.06);
    
    z-index: 100;
}

/* ===== INDICATOR (КРУГ) ===== */
.nav-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translateY(-50%);
    
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.05);
    
    transition: 
        left 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
        transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
        border-radius 0.2s ease;
    
    will-change: left, transform;
}

/* Меньше желейности */
.nav-indicator.moving {
    transform: translateY(-50%) scaleX(1.08) scaleY(0.96);
    border-radius: 46%;
}

/* Лёгкий bounce */
.nav-indicator.bounce {
    animation: jelly-bounce 0.25s ease-out;
}

@keyframes jelly-bounce {
    0% { transform: translateY(-50%) scaleX(1.04) scaleY(0.97); }
    60% { transform: translateY(-50%) scaleX(0.98) scaleY(1.02); }
    100% { transform: translateY(-50%) scaleX(1) scaleY(1); }
}

/* ===== NAV ITEMS ===== */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    position: relative;
    z-index: 2;
    
    color: rgb(255, 255, 255);
    
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    
    transition: color 0.2s ease, transform 0.15s ease;
}

.nav-item svg,
.nav-item .custom-icon {
    width: 26px;
    height: 26px;
}

/* ===== ACTIVE STATE ===== */
.nav-item.active {
    color: #0A84FF;
}

.nav-item:active {
    transform: scale(0.9);
}

/* ===== NAV AVATAR ===== */
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-avatar svg {
    width: 18px;
    height: 18px;
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-item.active .nav-avatar {
    border-color: #0A84FF;
}

/* ===== NAV BADGE ===== */
.nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    background: #FF3B30;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: #fff;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.4);
}

/* ===== LIGHT THEME ===== */
.theme-light .bottom-nav {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.6);
}

.theme-light .nav-indicator {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-light .nav-item {
    color: rgb(0, 0, 0);
}

.theme-light .nav-item.active {
    color: #007AFF;
}

.theme-light .nav-avatar {
    background: rgba(0, 0, 0, 0.05);
}

.theme-light .nav-item.active .nav-avatar {
    border-color: #007AFF;
}


/* ===== ВФКЛ THEME ===== */
.theme-dark .bottom-nav {
    background: rgba(42, 42, 42, 0.4);
}


/* ===== SEPIA THEME ===== */

.theme-sepia .bottom-nav {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.6);
}

.theme-sepia .nav-indicator {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-sepia .nav-item {
    color: #5b4636
}

.theme-sepia .nav-item.active {
    color: #6b8e23;
}

.theme-sepia .nav-avatar {
    background: rgba(0, 0, 0, 0.05);
}

.theme-sepia .nav-item.active .nav-avatar {
    border-color: #007AFF;
}

/* ===== SAFE AREA ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ===== HIDDEN ===== */
.bottom-nav.hidden {
    transform: translateX(-50%) translateY(150%);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.bottom-nav:not(.hidden) {
    transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}