/**
 * BOTTOM NAVIGATION - Нижняя навигация для Mini App
 * Удобна для одноручного использования
 */

.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05), 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin: 0;
}

.bottom-navigation-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    padding: 0 8px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: hsl(var(--primary) / 0.6);
    position: relative;
    min-height: 64px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item:hover {
    color: hsl(var(--primary) / 0.8);
    background-color: hsl(var(--accent) / 0.5);
}

/* Активное состояние */
.bottom-nav-item.active {
    color: hsl(var(--primary));
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
}

/* Иконка */
.bottom-nav-icon {
    font-size: 24px;
    line-height: 1;
    transition: transform 0.2s, color 0.2s;
    display: block;
    color: inherit;
}

/* Убеждаемся, что SVG иконки наследуют цвет */
.bottom-nav-icon svg {
    stroke: currentColor;
    fill: none;
}

/* Метка */
.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Индикатор активного состояния */
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: hsl(var(--primary));
    border-radius: 0 0 3px 3px;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 360px) {
    .bottom-nav-label {
        font-size: 10px;
    }
    
    .bottom-nav-icon {
        font-size: 20px;
    }
    
    .bottom-navigation-container {
        padding: 0 4px;
    }
    
    .bottom-nav-item {
        padding: 8px 2px;
    }
}

/* Безопасная зона для iPhone с вырезом */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-navigation {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .bottom-navigation-container {
        height: calc(64px + env(safe-area-inset-bottom));
    }
}

/* Тёмная тема */
[data-theme="dark"] .bottom-navigation {
    background-color: hsl(var(--background));
    border-top-color: hsl(var(--border));
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2), 0 -4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Анимация появления */
@keyframes slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.bottom-navigation {
    animation: slide-up 0.3s ease-out;
}

/* Выпадающее меню для добавления */
.add-menu {
    animation: slide-up 0.2s ease-out;
}

.add-menu-item:hover {
    background-color: hsl(var(--accent)) !important;
}

.add-menu-item:active {
    transform: scale(0.98);
    background-color: hsl(var(--accent) / 0.8) !important;
}
