/* =====================================================
   iOS-style Bottom Navigation
   ===================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: rgba(28, 28, 30, 0.85);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* Telegram WebApp dark theme support */
body.tg-dark-theme .bottom-nav {
    background: rgba(29, 39, 51, 0.85);
    border-top-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.2);
}

body.tg-dark-theme .nav-item {
    color: #98989d;
}

body.tg-dark-theme .nav-item:hover,
body.tg-dark-theme .nav-item.active {
    color: #0a84ff;
}

body.tg-dark-theme .nav-item:hover {
    background: rgba(10, 132, 255, 0.1);
}

body.tg-dark-theme .nav-item.active::before {
    background: #0a84ff;
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #8e8e93;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 60px;
    position: relative;
}

.nav-item:hover {
    text-decoration: none;
    color: #007aff;
    background: rgba(0, 122, 255, 0.1);
}

.nav-item.active {
    color: #007aff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: #007aff;
    border-radius: 1px;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    line-height: 1;
    margin-top: 2px;
}

/* Badge для уведомлений */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #ff3b30;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Адаптация контента под навигацию */
.main-content {
    padding-bottom: 120px;
    min-height: calc(100vh - 120px);
}

/* Дополнительный отступ для всех контейнеров контента */
.container {
    padding-bottom: 30px;
}

/* Специальные отступы для страниц с формами и деталями */
.bot-detail-page,
.payments-page,
.profile-page {
    padding-bottom: 40px;
}

/* Telegram WebApp интеграция */
.tg-viewport .bottom-nav {
    background: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.85));
}

.tg-viewport .nav-item {
    color: var(--tg-theme-hint-color, #8e8e93);
}

.tg-viewport .nav-item.active,
.tg-viewport .nav-item:hover {
    color: var(--tg-theme-button-color, #007aff);
}

/* Анимации */
@keyframes navPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.nav-item:active {
    animation: navPulse 0.2s ease;
}

/* Респонсивность */
@media (max-width: 320px) {
    .nav-container {
        padding: 0 8px;
    }

    .nav-item {
        min-width: 50px;
        padding: 6px 8px;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-label {
        font-size: 9px;
    }
}
