/**
 * @file: tabbar.css
 * @description: Стили для TabBar - плавающие круглые кнопки навигации
 * @created: 2025-12-15
 */

/* ========== TABBAR КОНТЕЙНЕР ========== */
.tabbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    
    /* Без фона - только кнопки */
    background: transparent;
    border: none;
    
    padding: 0;
    margin: 0;
    z-index: 1000;
    
    /* Безопасная зона для системной навигации */
    padding-bottom: env(safe-area-inset-bottom, 0);
    
    /* Высота TabBar для расчета отступов контента */
    /* Кнопки: 56px (стандарт), 64px (планшеты), 48px (маленькие) */
    /* bottom: 20px + высота кнопки + запас = минимум 96px, оптимально 120-140px */
}

/* ========== TABBAR КНОПКА ========== */
.tabbar-button {
    position: relative; /* Для позиционирования badge */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Убираем стандартные стили */
    -webkit-tap-highlight-color: transparent;
    outline: none;
    padding: 0;
    margin: 0;
}

/* Иконка внутри кнопки */
.tabbar-icon {
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

/* SVG иконка */
.tabbar-icon-svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
    transition: fill 0.2s ease;
}

/* Badge для счетчика (в стиле Material-UI) */
.tabbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: #f44336; /* Красный цвет для уведомлений */
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    
    border-radius: 9px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    
    z-index: 10;
}

/* Badge для больших чисел */
.tabbar-badge:not(:empty) {
    min-width: 18px;
}

/* Скрываем badge если значение 0 или пустое */
.tabbar-badge:empty,
.tabbar-badge[data-count="0"] {
    display: none;
}

/* ========== СОСТОЯНИЯ КНОПКИ ========== */

/* Hover эффект */
.tabbar-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Active (нажатие) */
.tabbar-button:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Активная кнопка (выбранный раздел) */
.tabbar-button.active {
    background: #2481cc;
    border-color: #2481cc;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(36, 129, 204, 0.4);
}

.tabbar-button.active .tabbar-icon {
    transform: scale(1.1);
}

/* Hover для активной кнопки */
.tabbar-button.active:hover {
    background: #1e6ba8;
    border-color: #1e6ba8;
    transform: scale(1.15) translateY(-2px);
}

/* ========== СТИЛЬ MATERIAL-UI ДЛЯ КНОПКИ СООБЩЕНИЙ ========== */

/* Активная кнопка сообщений в стиле MUI */
.tabbar-button-messages.active {
    background-color: rgba(25, 118, 210, 0.1) !important; /* Светло-синий фон как в MUI */
    border-color: rgba(25, 118, 210, 0.2) !important;
    color: #1976d2 !important; /* Синий цвет иконки */
    transform: scale(1) !important;
    box-shadow: none !important;
    border-radius: 50% !important; /* Оставляем круглую форму */
}

.tabbar-button-messages.active .tabbar-icon-svg {
    fill: #1976d2 !important; /* Синий цвет для SVG иконки */
}

.tabbar-button-messages.active:hover {
    background-color: rgba(25, 118, 210, 0.15) !important;
    transform: scale(1) !important;
}

/* Неактивная кнопка сообщений - светлая */
.tabbar-button-messages:not(.active) {
    background-color: white; /* Белый фон */
    color: rgba(0, 0, 0, 0.54); /* Светло-серый цвет для неактивной иконки */
}

.tabbar-button-messages:not(.active) .tabbar-icon-svg {
    fill: rgba(0, 0, 0, 0.54); /* Светло-серый для SVG */
}

.tabbar-button-messages:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.04); /* Легкий серый при hover */
}

/* ========== СТИЛЬ MATERIAL-UI ДЛЯ КНОПКИ ПОДДЕРЖКИ ========== */

/* Активная кнопка поддержки в стиле MUI */
.tabbar-button-support.active {
    background-color: rgba(25, 118, 210, 0.1) !important; /* Светло-синий фон как в MUI */
    border-color: rgba(25, 118, 210, 0.2) !important;
    color: #1976d2 !important; /* Синий цвет иконки */
    transform: scale(1) !important;
    box-shadow: none !important;
    border-radius: 50% !important; /* Оставляем круглую форму */
}

.tabbar-button-support.active .tabbar-icon-svg {
    fill: #1976d2 !important; /* Синий цвет для SVG иконки */
}

.tabbar-button-support.active:hover {
    background-color: rgba(25, 118, 210, 0.15) !important;
    transform: scale(1) !important;
}

/* Неактивная кнопка поддержки - светлая */
.tabbar-button-support:not(.active) {
    background-color: white; /* Белый фон */
    color: rgba(0, 0, 0, 0.54); /* Светло-серый цвет для неактивной иконки */
}

.tabbar-button-support:not(.active) .tabbar-icon-svg {
    fill: rgba(0, 0, 0, 0.54); /* Светло-серый для SVG */
}

.tabbar-button-support:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.04); /* Легкий серый при hover */
}

/* ========== СТИЛЬ MATERIAL-UI ДЛЯ КНОПКИ КАТЕГОРИЙ ========== */

/* Активная кнопка категорий в стиле MUI */
.tabbar-button-categories.active {
    background-color: rgba(25, 118, 210, 0.1) !important; /* Светло-синий фон как в MUI */
    border-color: rgba(25, 118, 210, 0.2) !important;
    color: #1976d2 !important; /* Синий цвет иконки */
    transform: scale(1) !important;
    box-shadow: none !important;
    border-radius: 50% !important; /* Оставляем круглую форму */
}

.tabbar-button-categories.active .tabbar-icon-svg {
    fill: #1976d2 !important; /* Синий цвет для SVG иконки */
}

.tabbar-button-categories.active:hover {
    background-color: rgba(25, 118, 210, 0.15) !important;
    transform: scale(1) !important;
}

/* Неактивная кнопка категорий - светлая */
.tabbar-button-categories:not(.active) {
    background-color: white; /* Белый фон */
    color: rgba(0, 0, 0, 0.54); /* Светло-серый цвет для неактивной иконки */
}

.tabbar-button-categories:not(.active) .tabbar-icon-svg {
    fill: rgba(0, 0, 0, 0.54); /* Светло-серый для SVG */
}

.tabbar-button-categories:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.04); /* Легкий серый при hover */
}

/* ========== СТИЛЬ MATERIAL-UI ДЛЯ КНОПКИ УВЕДОМЛЕНИЙ ========== */

/* Активная кнопка уведомлений в стиле MUI */
.tabbar-button-notifications.active {
    background-color: rgba(25, 118, 210, 0.1) !important; /* Светло-синий фон как в MUI */
    border-color: rgba(25, 118, 210, 0.2) !important;
    color: #1976d2 !important; /* Синий цвет иконки */
    transform: scale(1) !important;
    box-shadow: none !important;
    border-radius: 50% !important; /* Оставляем круглую форму */
}

.tabbar-button-notifications.active .tabbar-icon-svg {
    fill: #1976d2 !important; /* Синий цвет для SVG иконки */
}

.tabbar-button-notifications.active:hover {
    background-color: rgba(25, 118, 210, 0.15) !important;
    transform: scale(1) !important;
}

/* Неактивная кнопка уведомлений - светлая */
.tabbar-button-notifications:not(.active) {
    background-color: white; /* Белый фон */
    color: rgba(0, 0, 0, 0.54); /* Светло-серый цвет для неактивной иконки */
}

.tabbar-button-notifications:not(.active) .tabbar-icon-svg {
    fill: rgba(0, 0, 0, 0.54); /* Светло-серый для SVG */
}

.tabbar-button-notifications:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.04); /* Легкий серый при hover */
}

/* ========== СТИЛЬ ДЛЯ КНОПКИ ДОБАВИТЬ ЗАЯВКУ ========== */

/* Кнопка добавления заявки - всегда синяя */
.tabbar-button-add {
    background-color: #1976d2 !important; /* Синий цвет кнопки */
    border-color: #1976d2 !important;
    color: white !important;
    transform: scale(1) !important;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3) !important;
    border-radius: 50% !important;
}

.tabbar-button-add .tabbar-icon-svg {
    fill: white !important; /* Белый цвет для SVG иконки */
}

.tabbar-button-add:hover {
    background-color: #1565c0 !important; /* Более темный синий при hover */
    border-color: #1565c0 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4) !important;
}

.tabbar-button-add:active {
    background-color: #0d47a1 !important;
    transform: scale(0.95) !important;
}

/* Активное состояние (если нужно) */
.tabbar-button-add.active {
    background-color: #1976d2 !important;
    border-color: #1976d2 !important;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты и большие экраны */
@media (min-width: 768px) {
    .tabbar {
        gap: 16px;
    }
    
    .tabbar-button {
        width: 64px;
        height: 64px;
    }
    
    .tabbar-icon {
        font-size: 28px;
    }
}

/* Маленькие экраны (меньше 360px) */
@media (max-width: 360px) {
    .tabbar {
        gap: 8px;
        bottom: 16px;
    }
    
    .tabbar-button {
        width: 48px;
        height: 48px;
    }
    
    .tabbar-icon {
        font-size: 20px;
    }
    
    .tabbar-badge {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        padding: 0 4px;
        border-radius: 8px;
        top: -3px;
        right: -3px;
    }
}

/* Очень маленькие экраны (меньше 320px) */
@media (max-width: 320px) {
    .tabbar {
        gap: 6px;
        bottom: 12px;
    }
    
    .tabbar-button {
        width: 44px;
        height: 44px;
    }
    
    .tabbar-icon {
        font-size: 18px;
    }
}

/* ========== АНИМАЦИИ ========== */

/* Анимация появления кнопок */
@keyframes tabbarButtonAppear {
    from {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tabbar-button {
    animation: tabbarButtonAppear 0.3s ease backwards;
}

.tabbar-button:nth-child(1) { animation-delay: 0.05s; }
.tabbar-button:nth-child(2) { animation-delay: 0.1s; }
.tabbar-button:nth-child(3) { animation-delay: 0.15s; }
.tabbar-button:nth-child(4) { animation-delay: 0.2s; }
.tabbar-button:nth-child(5) { animation-delay: 0.25s; }

/* ========== ДОСТУПНОСТЬ ========== */

/* Фокус для клавиатурной навигации */
.tabbar-button:focus-visible {
    outline: 3px solid #2481cc;
    outline-offset: 2px;
}

/* ========== ТЕМНАЯ ТЕМА (на будущее, если понадобится) ========== */
@media (prefers-color-scheme: dark) {
    .tabbar-button {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .tabbar-button.active {
        background: #2481cc;
        border-color: #2481cc;
    }
}

