/* ==========================================================================
   ROERICH PEAK ARCHITECTURE - UNIFIED TOOLBAR COMPONENT
   File: static/css/components/toolbar.css
   ========================================================================== */

/* 1. БАЗОВЫЙ КОНТЕЙНЕР ПАНЕЛИ */
.roerich-toolbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(243, 240, 223, 0.7));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--elevation-layer-2);
    padding: 0.85rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* 2. БЛОК ПОИСКА */
.roerich-toolbar .roerich-search-box {
    position: relative;
    flex: 1;
    max-width: 450px;
    min-width: 200px;
}

.roerich-toolbar .search-input {
    width: 100%;
    height: 48px;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    font-family: var(--font-utility);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-abyss-ink);
    background: rgba(0, 80, 136, 0.04);
    border: 1px solid rgba(0, 80, 136, 0.12);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.roerich-toolbar .search-input:focus {
    background: var(--color-snow-summit);
    border-color: var(--color-fiery-orange);
    box-shadow: var(--elevation-layer-1);
}

.roerich-toolbar .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-roerich-ultramarine);
    opacity: 0.5;
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* 3. ЭЛЕМЕНТЫ УПРАВЛЕНИЯ СПРАВА */
.roerich-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Счетчик участников / элементов */
.roerich-counter-badge {
    font-family: var(--font-utility);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-roerich-ultramarine);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(0, 80, 136, 0.06);
    border: 1px solid rgba(0, 80, 136, 0.08);
    padding: 0.5rem 0.85rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 48px;
    box-sizing: border-box;
    white-space: nowrap;
}

.roerich-counter-badge .count-active {
    color: var(--color-fiery-orange);
}

.roerich-counter-badge .count-divider {
    opacity: 0.35;
}

/* 4. ПОДДЕРЖКА ROERICH_SELECT (TomSelect) ВНУТРИ ТУЛБАРА */
.roerich-toolbar .roerich-form-group {
    margin-bottom: 0 !important;
    min-width: 170px;
    flex: 1;
}

/* Скрываем метку (label) селекта внутри тулбара для ровного центрирования */
.roerich-toolbar .roerich-form-group .roerich-utility-label {
    display: none !important;
}

.roerich-toolbar .ts-wrapper.roerich-select-ts .ts-control {
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 2.2rem 0 1rem !important;
    background: rgba(0, 80, 136, 0.04) !important;
    border: 1px solid rgba(0, 80, 136, 0.12) !important;
    border-radius: var(--radius-md) !important;
    border-bottom: 1px solid rgba(0, 80, 136, 0.12) !important;
}

.roerich-toolbar .ts-wrapper.roerich-select-ts.focus .ts-control {
    background: var(--color-snow-summit) !important;
    border-color: var(--color-fiery-orange) !important;
}


/* ==========================================================================
   5. АДАПТАЦИЯ ДЛЯ МОБИЛОК (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .roerich-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .roerich-toolbar .roerich-search-box {
        max-width: 100%;
    }

    .roerich-toolbar-actions {
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
    }

    .roerich-counter-badge {
        font-size: 0.78rem;
        padding: 0.4rem 0.65rem;
        height: 40px;
    }

    .roerich-toolbar .ts-wrapper.roerich-select-ts .ts-control {
        min-height: 40px !important;
        height: 40px !important;
        font-size: 0.82rem !important;
    }

    .roerich-toolbar-actions .btn {
        height: 40px !important;
        font-size: 0.78rem !important;
        padding: 0 0.85rem !important;
    }
}
.roerich-toolbar .roerich-form-group {
    margin-bottom: 0 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex: 0 0 250px !important; /* Жесткий размер, без растяжения */
}