/* Filter Bar Component - Used in cardlist, characterlist, tierlist pages */

.employees-filter-bar.lost {
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-bar-element {
    display: flex;
    align-items: center;
}

/* Search Field */
.filter-bar-element.search {
    position: relative;
    margin-right: 4px;
}

.filter-bar-element.search input.form-control {
    background-color: #0e0e11;
    border: 1px solid #32323e;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0 30px 0 10px;
    font-size: 0.9rem;
    height: 38px;
    width: 200px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    line-height: 38px;
}

.filter-bar-element.search input.form-control:focus {
    outline: none;
    border-color: #7a5af8a1;
}

.filter-bar-element.search .clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: none;
    user-select: none;
}

.filter-bar-element.search input:not(:placeholder-shown) + .clear {
    display: block;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #32323e;
}

#filterSystem .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #212126;
    color: #a0a0a0;
    border: none;
    border-right: 1px solid #32323e;
    padding: 0 16px;
    height: 38px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    margin: 0;
    min-width: auto;
    border-radius: 0;
}

/* Allow targeting old class names within new container with high specificity */
#filterSystem .rarity-filter-btn,
#filterSystem .category-filter-btn,
#filterSystem .region-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #212126 !important;
    color: #a0a0a0 !important;
    border: none !important;
    border-right: 1px solid #32323e !important;
    padding: 0 16px !important;
    height: 38px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    margin: 0 !important;
    min-width: auto !important;
    border-radius: 0 !important;
}

#filterSystem .btn:first-child,
#filterSystem .rarity-filter-btn:first-child,
#filterSystem .category-filter-btn:first-child,
#filterSystem .region-btn:first-child {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

#filterSystem .btn:last-child,
#filterSystem .rarity-filter-btn:last-child,
#filterSystem .category-filter-btn:last-child,
#filterSystem .region-btn:last-child {
    border-right: none !important;
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

#filterSystem .btn:hover,
#filterSystem .rarity-filter-btn:hover,
#filterSystem .category-filter-btn:hover,
#filterSystem .region-btn:hover {
    background-color: #2a2a30 !important;
    color: #fff !important;
}

#filterSystem .btn.active,
#filterSystem .rarity-filter-btn.active,
#filterSystem .category-filter-btn.active,
#filterSystem .region-btn.active {
    background-color: #7a5af8a1 !important;
    color: #fff !important;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) !important;
    border-color: #7a5af8a1 !important;
}

#filterSystem .btn svg {
    fill: currentColor;
}

/* Reset Button */
#filterSystem .reset-button,
#filterSystem .reset-all-btn {
    background-color: #2a2a30 !important;
    border: 1px solid #32323e !important;
    border-radius: 4px !important;
    color: #a0a0a0 !important;
    padding: 0 16px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    font-size: 0.9rem !important;
    margin-left: 0 !important; /* Override potential margin-left: auto */
}

#filterSystem .reset-button:not([disabled]):hover,
#filterSystem .reset-all-btn:not([disabled]):hover {
    background-color: #7a5af8a1 !important;
    border-color: #7a5af8a1 !important;
    color: white !important;
}

#filterSystem .reset-button[disabled],
#filterSystem .reset-all-btn[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Images inside buttons */
#filterSystem .btn img,
#filterSystem .category-filter-btn img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain !important;
    transition: filter 0.2s !important;
    display: block !important;
    margin: 0 !important;
}

/* School Dropdown Styling */
select.form-control,
#filterSystem .school-dropdown {
    background-color: #212126 !important;
    color: #a0a0a0 !important;
    border: 1px solid #32323e !important;
    height: 38px !important;
    border-radius: 4px !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    min-width: 120px !important;
}

select.form-control:focus,
#filterSystem .school-dropdown:focus {
    outline: none !important;
    border-color: #7a5af8a1 !important;
}

/* Mobile responsiveness for Filter Bar */
@media (max-width: 1080px) {
    .employees-filter-bar.lost {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        background-color: rgba(0,0,0,0.2);
    }

    .filter-bar-element {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }

    .filter-bar-element:last-child {
        margin-bottom: 0;
    }

    .filter-bar-element.search input.form-control {
        width: 100%;
    }

    .btn-group {
        width: 100%;
        display: flex;
    }

    #filterSystem .btn,
    #filterSystem .rarity-filter-btn,
    #filterSystem .category-filter-btn,
    #filterSystem .region-btn {
        flex: 1;
        padding: 0 4px !important;
        font-size: 0.85rem !important;
    }

    #filterSystem .reset-button,
    #filterSystem .reset-all-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Specific adjustments for Haikyuu elements */
    .filter-bar-element.search {
        margin-right: 0;
    }
}

