/* bot_app/web_app/css/layout.css */

/* Хедер */
#top-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 60px;
    background-color: var(--bg-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; z-index: 1200; /* Увеличено */
}
#top-bar-avatar { width: 44px; height: 44px; border-radius: 8px; cursor: pointer; }

#top-bar-balance-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 5px 8px;
}
.balance-item { display: flex; align-items: center; gap: 5px; padding: 0 5px; font-weight: bold; }
.balance-icon { display: inline-block; width: 18px; height: 18px; vertical-align: middle; margin-left: 2px; margin-right: 2px; }
.balance-icon svg { width: 100%; height: 100%; }

/* Основной контейнер */
#app { display: flex; flex-direction: column; height: 100vh; }
#main-content { flex-grow: 1; overflow-y: auto; padding: 60px 15px 80px; }

/* Стили страниц */
.page {
    display: none;
}
.page.active {
    display: block;
}
#friends-page {
    padding-top: 20px;
}

.page-header {
    display: flex;
    justify-content: center; /* Center the content (the h1) */
    align-items: center;
    position: relative; /* New: for absolute positioning of the button */
    margin-bottom: 25px;
    padding-top: 10px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    text-align: center;
}

/* Кнопка "Назад" */
.back-btn {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: absolute; /* New */
    left: 0; /* New: Aligns to the left of the page-header container */
}


/* Нижняя навигация */
#bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    display: flex; 
    justify-content: space-around; /* Равномерное распределение по всей ширине */
    align-items: center;
    gap: 8px;
    background-color: var(--bg-color); 
    padding: 12px 15px;
    z-index: 1200; 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    height: 90px; /* Еще больше увеличиваем высоту */
}
.nav-btn { 
    background: transparent; 
    border: none; 
    color: #8e8e93; 
    font-size: 13px;
    cursor: pointer; 
    padding: 10px 12px;
    border-radius: 8px; 
    transition: color 0.2s;
    flex: 1; /* Кнопки занимают равное пространство */
    max-width: 95px;
    min-width: 70px;
}
.nav-btn svg { fill: currentColor; transition: fill 0.2s; }
.nav-btn.active { color: #28a745; font-weight: bold; }
.nav-btn:not(.active):hover { color: #fff; }
.nav-btn-with-icon { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px;
    line-height: 1.3;
}
.nav-btn-with-icon svg { 
    width: 36px; /* Максимально увеличиваем иконки */
    height: 36px; 
}

/* Адаптация для 5 кнопок */
#bottom-nav {
    /* Теперь у нас 5 основных кнопок + 1 скрытая партнёрская */
    justify-content: space-between;
}

.nav-btn {
    flex: 1;
    max-width: 75px; /* Уменьшаем для размещения 5 кнопок */
    min-width: 60px;
    font-size: 12px; /* Немного уменьшаем шрифт */
}

.nav-btn-with-icon svg {
    width: 32px; /* Уменьшаем иконки для лучшего размещения */
    height: 32px;
}

@media screen and (max-width: 400px) {
    .nav-btn {
        font-size: 10px;
        min-width: 55px;
        max-width: 70px;
        padding: 6px 8px;
    }
    .nav-btn-with-icon svg {
        width: 26px;
        height: 26px;
    }
    #bottom-nav {
        padding: 8px 10px;
        height: 80px;
    }
}

@media screen and (max-width: 360px) {
    .nav-btn {
        font-size: 9px;
        min-width: 50px;
        max-width: 65px;
        padding: 5px 6px;
    }
    .nav-btn-with-icon svg {
        width: 24px;
        height: 24px;
    }
    .nav-btn-with-icon {
        gap: 4px;
    }
}