:root {
    --main-blue: #809EFF;
    --text-primary: #2E2E2E;
    --bg-gray: #F5F5F5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    justify-content: center;
    height: 100dvh;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
}

.container {
    width: 100%;
    /*max-width: 390px;*/
    /*padding: 0px 16px;*/
    display: flex;
    flex-direction: column;
}

/* Основной контейнер (обычно это body или div#app) */
.main-layout {
    display: flex;
    flex-direction: column;

    /* 100dvh - это 100% высоты ВИДИМОЙ части экрана.
       Учитывает адресную строку на мобилках, чтобы навбар не перекрывался. */
    height: 100dvh;

    /* Запрещаем скролл самого контейнера, чтобы не уезжала шапка */
    overflow: hidden;
}

/* Шапка */
.header {
    /* Запрещаем шапке сжиматься */
    flex: 0 0 auto;
    /* Твои стили (паддинги, цвета) остаются здесь */
}

/* Контент (середина) */
.content {
    /* Заставляем контент занять ВСЁ доступное место между шапкой и навбаром */
    flex: 1 1 auto;

    /* Если контента много, скроллится ТОЛЬКО этот блок, а не вся страница */
    overflow-y: auto;

    /* Для плавной прокрутки на iOS */
    -webkit-overflow-scrolling: touch;

    /* Твои стили (паддинги) остаются здесь */
}

/* Навбар (низ) */
.navbar {
    /* Запрещаем навбару сжиматься */
    flex: 0 0 auto;
    /* Твои стили остаются здесь */
}

.app-layout {
    background-color: #fff;
    width: 100%;
    max-width: 390px;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- Шапка --- */
.main-header {
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background-color: #fff;
    z-index: 100;
    flex-shrink: 0;
}

/* Блок-распорка слева, равен по ширине блоку справа, чтобы лого было по центру */
.header-left-spacer {
    width: 24px;
}

.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--main-blue);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-filter {
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Нижняя навигация --- */
.bottom-nav {
    height: 80px; /* Высокий футер как в iOS */
    background-color: #fff;
    display: flex;
    justify-content: space-between; /* Распределяем по ширине */
    align-items: flex-start;
    padding: 16px 40px 0 40px; /* Большие отступы по бокам для иконок */
    z-index: 100;
    width: 100%;
    border-radius: 24px 24px 0 0; /* Скругление самого бара сверху */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1); /* Легкая тень */
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: transform 0.1s;
}

.nav-item:active {
    transform: scale(0.95);
}

/* --- iOS Modal Styles --- */
.ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none; /* Скрыто */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ios-modal-overlay.visible {
    opacity: 1;
}

.ios-modal {
    width: 270px; /* Стандартная ширина iOS алерта */
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    overflow: hidden;
    transform: scale(1.1);
    transition: transform 0.2s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.ios-modal-overlay.visible .ios-modal {
    transform: scale(1);
}

.ios-modal-body {
    padding: 20px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(60, 60, 67, 0.2);
}

.ios-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
}

.ios-modal-footer {
    display: flex;
    height: 44px;
}

.ios-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #007AFF; /* iOS Blue */
    cursor: pointer;
    font-weight: 400;
}

.ios-modal-btn:first-child {
    border-right: 1px solid rgba(60, 60, 67, 0.2);
    font-weight: 400; /* Regular для отмены */
}

/* Кнопка "Да" (удалить) - Красная */
.ios-modal-btn.destructive {
    color: var(--error);
    font-weight: 600; /* Bold для важного действия */
}

.ios-modal-btn:active {
    background-color: rgba(0,0,0,0.05);
}

.chat-icon-navbar {
    position: relative;
}

.chat-icon-navbar__unread-message {
    width: 10px;
    height: 10px;
    background: #809EFF;
    border-radius: 50%;
    border: 1px solid #fff;
    position: absolute;
    right: 0;
    bottom: 18px;
}
