/* ─── iOS 26 Liquid Glass / iOS 15+ chrome color anchors ─── */
/* Safari сэмплирует фон этих элементов для окраски адресной строки (сверху)
   и панели вкладок / индикатора Home (снизу).
   Высота = 15px gap над/под нашими баром/меню + safe-area-inset. */
.ios-chrome-anchor {
    display: none; /* только для веб-браузера, не мини-апп */
    position: fixed;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 9999;
    transition: none;
}

body.has-web-top-bar .ios-chrome-anchor {
    display: block;
}

body.web-desktop .ios-chrome-anchor {
    display: none;
}

.ios-chrome-anchor--top {
    top: 0;
    height: 12px;
    z-index: 99999;
    background-color: #1f3153;
}

.main-container {
    padding: 0px 15px 0px 15px;
    /* height: calc(100vh - var(--tg-safe-area-inset-top) ); */
    height: 100%;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding-bottom: 15px;
    padding-top: 15px;
    /* position: absolute; */
    
    /* left: 0;
    right: 0; */
    /* bottom: 0px; */
    /* padding-top: calc(var(--tg-safe-area-inset-top) + var(--tg-content-safe-area-inset-top)); */
    /* padding-bottom: calc(var(--tg-safe-area-inset-bottom)); */
    /* padding-bottom: 15px; */
}

/* Прозрачный контейнер при градиентном фоне body */
.main-container.projects-transparent {
    background-color: #ffffff00;
}

/* Режим "Главная": нижняя компенсация под меню не нужна */
.main-container.projects-no-bottom-padding {
    padding-bottom: 0;
    padding-top: 0;
}

/* В режиме mainpage не используем platform-specific calc высоты */
.main-container.projects-transparent.projects-no-top-padding {
    height: 100% !important;
}

.content-area {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
    position: relative;
    border-radius: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Скрываем скролл-бар для Chrome, Safari и Opera */
.content-area::-webkit-scrollbar {
    display: none;
}

.page {
    display: none !important;
    width: 100%;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 20px 20px 25px 25px;
    padding-bottom: 0px;
    transition: opacity 0.15s ease-in-out;
    opacity: 1;
}

.page.active {
    display: block !important;
    opacity: 1;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 20px 20px 25px 25px;
}

.page.active::-webkit-scrollbar {
    display: none;
}



/* .page-container.fade-out {
    opacity: 0;
}

.page-container.fade-in {
    opacity: 1;
} */

/* Плавные переходы между страницами (новая система) */
:root {
    --page-transition-duration: 0.2s;
    --page-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

.content-area {
    transition: opacity var(--page-transition-duration) var(--page-transition-easing);
}

.content-area.page-transition-out {
    opacity: 0;
} 

.bottom-padding-container{
    padding-bottom: 75px;
}

.mainpage-profile-fab {
    position: fixed;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    width: auto;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity var(--page-transition-duration, 0.2s) var(--page-transition-easing, ease);
}

.mainpage-profile-fab.is-hidden {
    display: none;
}

.mainpage-profile-fab.is-fading {
    opacity: 0;
}

body.tg-mobile-platform .mainpage-profile-fab {
    position: fixed;
    margin-top: 6px;
    margin-bottom: 0px;
    height: var(--tg-content-safe-area-inset-top, 0px);
    top: var(--tg-safe-area-inset-top, 0px);
    left: calc(50% + var(--mainpage-profile-shift, 0px));
    transform: translateX(-50%);
    transition: left 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity var(--page-transition-duration, 0.2s) var(--page-transition-easing, ease);
    margin: 0;
    width: auto;
    will-change: left;
}

body.tg-mobile-platform .mainpage-profile-fab.is-offset-active {
    --mainpage-profile-shift: calc(0.387 * max(0px, 406px - 100vw));
}

.mainpage-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
    padding-right: 10px;
    border-radius: 999px;
    background-color: rgb(137 137 137 / 5%);
    /* border: 1px solid rgba(255, 255, 255, 0.12); */
    /* backdrop-filter: blur(6px); */
    /* -webkit-backdrop-filter: blur(6px); */
    backdrop-filter: brightness(1.5);
    transition: gap 0.22s ease, padding-right 0.22s ease, background-color 0.26s ease;
}
.mainpage-profile-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body.tg-desktop-platform .mainpage-profile-fab.is-scrolled .mainpage-profile-btn {
    background: rgb(0 0 0 / 79%);
}

.mainpage-profile-avatar {
    width: 22px;
    height: 22px;
    border-radius: 100%;
    transition: width 0.25s ease, height 0.25s ease;
}

body.tg-mobile-platform .mainpage-profile-fab.is-label-hidden .mainpage-profile-avatar {
    width: 18px;
    height: 18px;
}

.mainpage-profile-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    max-width: 60px;
    transform: translateX(0);
    opacity: 1;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.mainpage-profile-fab.is-label-hidden .mainpage-profile-btn {
    gap: 0;
    padding: 5.5px 6px;
    background-color: rgb(137 137 137 / 0%);
    transition: gap 0.3s cubic-bezier(0.32, 0.72, 0, 1), padding 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.mainpage-profile-fab.is-label-hidden .mainpage-profile-label {
    transform: none;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

/* ─── Веб-топ-панель (браузер без Telegram) ─── */
.web-top-bar {
    position: fixed;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 46px;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-bottom: none;
    visibility: hidden;
    pointer-events: none;
}

body.has-web-top-bar .web-top-bar {
    visibility: visible;
    pointer-events: auto;
}

/* Внутренний контейнер — ширина как у .page */
.web-top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 0;
}

/* Плавное появление «Назад» → «Профиль» → «Выйти» */
.web-top-bar__inner > .web-top-bar__zone {
    opacity: 0;
    transform: translateY(-7px);
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0s;
}

body.has-web-top-bar .web-top-bar__inner > .web-top-bar__zone {
    opacity: 1;
    transform: translateY(0);
}

body.has-web-top-bar .web-top-bar__inner > .web-top-bar__zone:nth-child(1) {
    transition-delay: 0.04s;
}

body.has-web-top-bar .web-top-bar__inner > .web-top-bar__zone:nth-child(2) {
    transition-delay: 0.11s;
}

body.has-web-top-bar .web-top-bar__inner > .web-top-bar__zone:nth-child(3) {
    transition-delay: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
    .web-top-bar__inner > .web-top-bar__zone {
        transition-duration: 0.01ms;
        transition-delay: 0s !important;
    }
}

/* Основной контент опускается ниже топ-панели (15px top + 46px height + 8px gap) */
body.has-web-top-bar .main-container {
    padding-top: calc(15px + 46px + 8px);
    padding-bottom: 10px;
}

/* Отступ снизу для контента на мобильном вебе */
body.has-web-top-bar:not(.web-desktop) .content-area {
    padding-bottom: 15px;
}

/* На iOS mobile web нижний отступ не нужен */
body.has-web-top-bar.ios-mobile-web:not(.web-desktop) .content-area {
    padding-bottom: 0;
}

/* Убираем базовый нижний 15px у контейнера на iOS mobile web */
body.has-web-top-bar.ios-mobile-web:not(.web-desktop) .main-container {
    padding-bottom: 0;
}

.web-top-bar__zone {
    display: flex;
    align-items: center;
}

.web-top-bar__left   { flex: 1; justify-content: flex-start; }
.web-top-bar__center { flex: 0 0 auto; }
.web-top-bar__right  { flex: 1; justify-content: flex-end; }

/* Кнопки в топ-панели */
.web-top-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgb(137 137 137 / 5%);
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: brightness(1.5);
    -webkit-backdrop-filter: brightness(1.5);
    transition:
        background-color 0.22s ease,
        opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.22s ease,
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
}
.web-top-bar__btn i {
    font-size: 14px;
}
.web-top-bar__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.web-top-bar__btn.is-inactive {
    opacity: 0;
    pointer-events: none;
}

.web-top-bar__btn--back {
    opacity: 0.88;
    padding-right: 12px;
}

.web-top-bar__btn--logout {
    padding-left: 12px;
}

/* Сайдбар начинается ниже топ-панели (top задан в bottom-menu.css) */

/* Скрываем Telegram FAB профиля в веб-режиме */
/* Скрываем Telegram FAB только в веб-режиме (не в мини-апе) */
body.has-web-top-bar #mainpage-profile-fab {
    display: none !important;
}



