/* filters.css - Complete Filter System Styles */

/* Filter Toggle Button */
.cat_filter_toggle_btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background-color: #B0000B;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(176, 0, 11, 0.3);
}

.cat_filter_toggle_btn:hover {
    background-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.cat_filter_icon {
    flex-shrink: 0;
}

.cat_filter_btn_text {
    flex-grow: 1;
    text-align: left;
}

.cat_filter_chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.cat_filter_toggle_btn.active .cat_filter_chevron {
    transform: rotate(180deg);
}

/* Collapsible Container */
.cat_filter_container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.cat_filter_container.cat_filter_collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    border: none;
}

.cat_filter_container:not(.cat_filter_collapsed) {
    max-height: 2000px;
    opacity: 1;
}

/* Filter Header */
.cat_filter_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 20px 10px 20px;
    border-bottom: 2px solid #d4d4d4;
}

.cat_filter_title {
    margin: 0;
    font-size: 24px;
    color: #222;
}

.cat_filter_reset_btn {
    background-color: #666;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.cat_filter_reset_btn:hover {
    background-color: #555;
}

/* Filter Form */
.cat_filter_form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 0 20px 20px 20px;
}

.cat_filter_group {
    display: flex;
    flex-direction: column;
}

.cat_filter_label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 15px;
}

/* Checkbox Filters */
.cat_filter_checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat_filter_checkbox_label {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.cat_filter_checkbox_label:hover {
    background: #e8e8e8;
    border-color: #999;
}

.cat_filter_checkbox {
    margin-right: 6px;
    cursor: pointer;
}

.cat_filter_checkbox:checked + span {
    font-weight: bold;
}

.cat_filter_checkbox_label:has(.cat_filter_checkbox:checked) {
    background: #B0000B;
    color: #fff;
    border-color: #B0000B;
}

/* "All" option styling for checkboxes */
.cat_filter_checkbox_label.cat_filter_all_option {
    border: 2px solid #666;
    font-weight: bold;
}

.cat_filter_checkbox_label:has(.cat_filter_age_all:checked) {
    background: #666;
    color: #fff;
    border-color: #666;
}

/* Select Dropdowns */
.cat_filter_select {
    width: 100%;
    padding: 8px;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    max-height: 150px;
}

.cat_filter_select:focus {
    outline: none;
    border-color: #B0000B;
}

.cat_filter_select[multiple] {
    height: auto;
    min-height: 80px;
}

/* "All" option styling for selects */
.cat_filter_select option.cat_filter_all_option {
    background-color: #f0f0f0;
    font-weight: bold;
    border-bottom: 2px solid #d4d4d4;
    margin-bottom: 4px;
}

.cat_filter_help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Action Buttons */
.cat_filter_actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.cat_filter_apply_btn {
    background-color: #B0000B;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cat_filter_apply_btn:hover {
    background-color: #8b0009;
}

.cat_filter_apply_btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Loading Indicator */
.cat_filter_loading {
    display: inline-block;
    color: #666;
    font-style: italic;
}

.cat_filter_spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #666;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cat_filter_spin 0.8s linear infinite;
}

@keyframes cat_filter_spin {
    to { transform: rotate(360deg); }
}

/* Results Container */
.cat_filter_results {
    width: 100%;
    margin-top: 20px;
}

/* Active Filter Badge */
.cat_filter_active_filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
}

.cat_filter_badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: #B0000B;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
}

.cat_filter_badge_remove {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
}

.cat_filter_badge_remove:hover {
    opacity: 0.8;
}

.cat_filter_clear_all {
    padding: 5px 10px;
    background: #666;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
}

.cat_filter_clear_all:hover {
    background: #555;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .cat_filter_container {
        padding: 0;
    }

    .cat_filter_header {
        padding: 15px;
    }

    .cat_filter_form {
        grid-template-columns: 1fr;
        padding: 0 15px 15px 15px;
    }

    .cat_filter_title {
        font-size: 20px;
    }

    .cat_filter_checkboxes {
        gap: 8px;
    }

    .cat_filter_checkbox_label {
        padding: 5px 10px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .cat_filter_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cat_filter_apply_btn {
        width: 100%;
        padding: 10px;
    }
}