/**
 * DiveWP Filter Bar Styles
 *
 * Reusable filter bar component with pill-style filter buttons and search field.
 *
 * @package DiveWP
 * @version 1.0.0
 * @author  Oleg Petrov
 */

/* Filter Bar Container */
.divewp-filter-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Filter Buttons Group */
.divewp-filter-bar__filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.divewp-filter-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.divewp-filter-bar__btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.divewp-filter-bar__btn--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.divewp-filter-bar__btn--active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.divewp-filter-bar__btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.divewp-filter-bar__btn--active .divewp-filter-bar__btn-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Warning variant */
.divewp-filter-bar__btn--warning {
    color: #c2410c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.divewp-filter-bar__btn--warning:hover {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

.divewp-filter-bar__btn--warning.divewp-filter-bar__btn--active {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
}

.divewp-filter-bar__btn--warning.divewp-filter-bar__btn--active:hover {
    background: #c2410c;
    border-color: #c2410c;
    color: #fff;
}

/* Search Field */
.divewp-filter-bar__actions {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.divewp-filter-bar__search-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.divewp-filter-bar__search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.divewp-filter-bar__search {
    width: 100%;
    padding: 0 44px 0 48px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    transition: all 0.25s ease;
    outline: none !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 0 !important;
}

.divewp-filter-bar__search::placeholder {
    color: #94a3b8;
    font-weight: 400;
    transition: color 0.2s ease;
}

.divewp-filter-bar__search:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.divewp-filter-bar__search:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.divewp-filter-bar__search:focus + .divewp-filter-bar__search-icon,
.divewp-filter-bar__search-wrapper:focus-within .divewp-filter-bar__search-icon {
    color: #3b82f6;
}

.divewp-filter-bar__search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    z-index: 1;
}

.divewp-filter-bar__search-clear:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.divewp-filter-bar__search-clear .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.divewp-filter-bar__search-wrapper.has-value .divewp-filter-bar__search-clear {
    display: flex;
}

/* Responsive */
@media (max-width: 782px) {
    .divewp-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .divewp-filter-bar__filters {
        flex-wrap: wrap;
        gap: 6px;
    }

    .divewp-filter-bar__btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .divewp-filter-bar__actions {
        flex: 1;
        min-width: 100%;
        justify-content: stretch;
    }

    .divewp-filter-bar__search-wrapper {
        max-width: none;
    }
}
