/**
 * IMLCA Taxonomy Filter Widget Styles
 *
 * Modern, clean design with collapsible hierarchical structure.
 * All styles are overrideable via Elementor widget style controls.
 *
 * @since 1.0.0
 */

/* Widget Container */
.imlca-taxonomy-filter-widget {
    /* Spacing handled via Elementor Advanced tab */
}

/* Title */
.imlca-taxonomy-filter-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Search Box Container */
.imlca-filter-search-wrapper {
    margin-bottom: 1.5rem;
}

.imlca-filter-search-box {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

.imlca-filter-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.95rem;
    outline: none;
    color: #333;
}

.imlca-filter-search-input::placeholder {
    color: #999;
}

.imlca-filter-search-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.imlca-filter-search-btn:hover {
    color: #333;
}

.imlca-filter-search-btn i {
    font-size: 1rem;
}

/* Form */
.imlca-taxonomy-filter-form {
    display: flex;
    flex-direction: column;
}

/* Hierarchical Layout - Main Container */
.imlca-filter-options.hierarchical {
    display: flex;
    flex-direction: column;
    /* Gap controlled via Elementor "Space Between Parent Sections" control */
}

/* Parent Section (Collapsible) */
.imlca-filter-parent {
    /* Border applied to header below */
}

.imlca-filter-parent-header {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid;
    /* Border color controlled via Elementor (inherits parent label color) */
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.imlca-filter-parent-label {
    display: flex;
    align-items: center;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    flex: 1;
}

/* Chevron Arrow */
.imlca-filter-parent-header::after {
    content: '▼';
    display: inline-block;
    margin-left: auto;
    margin-right: 0.25rem;
    font-size: 0.75rem;
    color: #666;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.imlca-filter-parent.collapsed .imlca-filter-parent-header::after {
    transform: rotate(-90deg);
}

/* Child Items Container */
.imlca-filter-children {
    display: none;
    flex-direction: column;
    gap: 0;
    padding-bottom: 1rem;
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.imlca-filter-parent:not(.collapsed) .imlca-filter-children {
    display: flex;
}

/* Individual Filter Items */
.imlca-filter-item {
    display: flex;
    align-items: center;
    padding: 0;
}

/* Checkbox Label Container */
.imlca-filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    user-select: none;
    flex: 1;
}

/* Checkbox Input */
.imlca-filter-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #007cba;
    border-radius: 2px;
}

.imlca-filter-checkbox:hover {
    accent-color: #0073a1;
}

.imlca-filter-checkbox:focus {
    outline: none;
}

/* Checkbox Label Text */
.imlca-filter-label {
    color: #333;
    font-size: 0.95rem;
    margin: 0;
    flex: 1;
}

/* Term Count Badge */
.imlca-filter-count {
    color: #999;
    font-size: 0.85rem;
    margin-left: auto;
    padding-left: 0.5rem;
}

/* Filter Actions */
.imlca-filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Reset Button */
.imlca-reset-filters {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.imlca-reset-filters:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

.imlca-reset-filters:active {
    transform: translateY(1px);
}

/* Responsive */
@media (max-width: 768px) {
    .imlca-taxonomy-filter-widget {
        margin-bottom: 1.5rem;
    }

    .imlca-taxonomy-filter-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .imlca-filter-parent-header {
        padding: 0.75rem 0;
    }

    .imlca-filter-item {
        padding: 0.4rem 0;
    }

    .imlca-filter-parent:not(.collapsed) .imlca-filter-item {
        padding-left: 1rem;
    }

    .imlca-filter-label {
        font-size: 0.9rem;
    }

    .imlca-reset-filters {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Print Styles */
@media print {
    .imlca-taxonomy-filter-widget {
        display: none;
    }
}
