/* ===== Bottom Tab Navigation (Super Fluid Style) ===== */

.bottom-tab {
    position: fixed;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 72px;

    background: transparent !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 999px;
    display: flex;
    align-items: center;
    z-index: 50;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05) !important;
    overflow: hidden;

    margin-bottom: calc(-8px + env(safe-area-inset-bottom, 0px));

    transform: none !important;
    animation: none !important;
}

@media (min-width: 768px) {
    .bottom-tab { display: none !important; }
}

body.has-bottom-tab {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

/* ===== БЕГУНОК (ЖИДКОСТЬ) ===== */
.bottom-tab-indicator {
    position: absolute;
    top: 3px;
    height: calc(100% - 6px);
    left: 0;
    width: 20%;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.2);

    /* Плавный полет с отскоком */
    transition:
        left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease;
}

/* В полете пузырь вытягивается */
.bottom-tab-indicator.is-moving {
    transform: scaleX(1.25) scaleY(0.9);
    background: rgba(255, 255, 255, 0.2);
}

/* ===== КНОПКА ===== */
.bottom-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #71717a;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    height: 100%;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s ease;
}

.bottom-tab-item.active {
    color: var(--accent-light, #818cf8);
    font-weight: 600;
}

/* ===== ИКОНКА (ЖИВАЯ) ===== */
.bottom-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    /* Упругая пружинка для иконки */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Когда кнопка активна, иконка подпрыгивает */
.bottom-tab-item.active .bottom-tab-icon {
    transform: translateY(-3px) scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.bottom-tab-label {
    line-height: 1.1;
    letter-spacing: 0.1px;
    white-space: nowrap;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-tab-item.active .bottom-tab-label {
    transform: translateY(-1px);
}

/* Клик по кнопке */
.bottom-tab-item:active .bottom-tab-icon {
    transform: scale(0.8) translateY(0);
}

/* Анимация "отскока" иконки */
.bottom-tab-icon.icon-anim {
    animation: tabIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tabIconPop {
    0%   { transform: scale(1) translateY(-3px); }
    40%  { transform: scale(0.8) translateY(0); }
    70%  { transform: scale(1.25) translateY(-4px); }
    100% { transform: scale(1.15) translateY(-3px); }
}

/* Адаптация под темы */
[data-theme="dark"] .bottom-tab-item.active { color: #818cf8; }

[data-theme="ocean"] .bottom-tab { border-color: rgba(6, 182, 212, 0.3) !important; }
[data-theme="ocean"] .bottom-tab-indicator { background: rgba(6, 182, 212, 0.15); }
[data-theme="ocean"] .bottom-tab-indicator.is-moving { background: rgba(6, 182, 212, 0.28); }
[data-theme="ocean"] .bottom-tab-item.active { color: #22d3ee; }

[data-theme="mars"] .bottom-tab { border-color: rgba(245, 158, 11, 0.3) !important; }
[data-theme="mars"] .bottom-tab-indicator { background: rgba(245, 158, 11, 0.15); }
[data-theme="mars"] .bottom-tab-indicator.is-moving { background: rgba(245, 158, 11, 0.28); }
[data-theme="mars"] .bottom-tab-item.active { color: #fbbf24; }

[data-theme="nebula"] .bottom-tab { border-color: rgba(139, 92, 246, 0.3) !important; }
[data-theme="nebula"] .bottom-tab-indicator { background: rgba(139, 92, 246, 0.15); }
[data-theme="nebula"] .bottom-tab-indicator.is-moving { background: rgba(139, 92, 246, 0.28); }
[data-theme="nebula"] .bottom-tab-item.active { color: #A78BFA; }