/* 
 * Supplier Filters Styles
 * Filter column, search, and filter interactions
 */

/* ========================================
   FILTER COLUMN
   ======================================== */

.supplier-filter-column {
    flex: 0 0 280px;
    background-color: var(--bg-primary);
    padding: 20px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

/* Filter Results Counter */
.filter-results-count {
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bg-light);
}

.filter-results-count div {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.filter-results-count strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Filter Title */
.filter-main-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-main-title::before {
    content: '▼';
    color: var(--primary-color);
    font-size: 12px;
}

@media (max-width: 768px) {
    /* Filter toggle button - mooi gestyled */
    .filter-toggle-btn {
        display: block;
        width: 100%;
        margin: 0 0 15px 0;
        padding: 14px 20px;
        background: white;
        border: 2px solid var(--primary-color, #d2691e);
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        color: var(--primary-color, #d2691e);
        transition: all 0.3s ease;
        text-align: center;
    }
    
    .filter-toggle-btn:hover {
        background: var(--primary-color, #d2691e);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(210, 105, 30, 0.2);
    }
    
    .filter-toggle-btn:active {
        transform: translateY(0);
    }
    
    /* Wanneer filters open zijn */
    .filter-toggle-btn.filters-open {
        background: #f8f8f8;
        border-color: #ddd;
        color: #666;
    }
    
    .filter-toggle-btn.filters-open:hover {
        background: #e8e8e8;
        border-color: #ccc;
        color: #333;
    }
    
    /* Filter column animatie */
    .supplier-filter-column {
        transition: all 0.3s ease;
    }
}


/* ========================================
   SEARCH BOX
   ======================================== */

.filter-search-container {
    margin-bottom: 15px;
    padding: 0;
    border: none;
    background: transparent;
}

.supplier-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.supplier-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
}

.supplier-search-input::placeholder {
    color: var(--text-muted);
}

/* ========================================
   HELP CHOOSE BUTTON
   ======================================== */

.help-choose-btn-trigger {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(210, 105, 30, 0.2);
}

.help-choose-btn-trigger:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(210, 105, 30, 0.3);
}

.help-choose-btn-trigger svg {
    margin-right: 8px;
}

/* ========================================
   RESET FILTERS BUTTON
   ======================================== */

.reset-filters-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
    font-family: inherit;
}

.reset-filters-btn:hover {
    background-color: var(--bg-light);
    border-color: #d0d0d0;
}

/* ========================================
   FILTER GROUPS
   ======================================== */

.filter-group {
    margin-bottom: 16px;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
}

/* Filter Group Headers */
.filter-group-header {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-radius: 4px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--bg-light);
}

.filter-group-header:hover {
    color: var(--primary-color);
    background-color: rgba(210, 105, 30, 0.05);
}

.filter-group-header:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Arrow styling */
.filter-group-header .arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--text-muted);
    font-weight: bold;
    margin-left: 8px;
}

.filter-group-header:hover .arrow {
    color: var(--primary-color);
}

.filter-group-header.collapsed .arrow {
    transform: rotate(-90deg);
}

/* Filter Options Container */
.filter-options {
    overflow: hidden;
    transition: all 0.3s ease;
    animation: sc-slideDown 0.3s ease;
}

.filter-group.collapsed .filter-options {
    display: none;
}

.filter-options > div {
    margin-bottom: 12px;
}

/* ========================================
   FILTER CHECKBOXES
   ======================================== */

.filter-options label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.filter-options label:hover {
    color: var(--primary-color);
}

/* Custom Checkbox */
.supplier-filter-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    background: var(--bg-primary);
}

.supplier-filter-checkbox:hover {
    border-color: var(--primary-color);
}

.supplier-filter-checkbox:checked {
    background-color: var(--bg-primary);
    border-color: var(--primary-color);
}

.supplier-filter-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: bold;
}

/* Label Text and Count */
.filter-options .label-text {
    flex: 1;
    padding-right: 8px;
}

/* Count Badge */
.filter-count {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 400;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.filter-count.zero-results {
    background: var(--bg-light);
    color: #ccc;
}

/* ========================================
   DISABLED STATES
   ======================================== */

.filter-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.filter-disabled .supplier-filter-checkbox {
    cursor: not-allowed;
    border-color: var(--border-color);
}

/* ========================================
   FLOATING HELP BUTTON
   ======================================== */

.floating-help-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.help-choose-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--primary-dark);
    transition: var(--transition);
    position: relative;
}

.help-choose-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}

.help-choose-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Help Tooltip */
.help-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.help-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid #333;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.help-choose-btn:hover .help-tooltip {
    opacity: 1;
    visibility: visible;
    right: 65px;
}

/* ========================================
   NO FILTERS STATE
   ======================================== */

.no-filters-message {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

/* ========================================
   LOADING STATES
   ======================================== */

.filter-loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   FILTER ANIMATIONS
   ======================================== */

.filter-slide-in {
    animation: filterSlideIn 0.3s ease;
}

@keyframes filterSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .supplier-filter-column {
        flex: 1 0 100%;
        margin-bottom: 20px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .supplier-filter-column {
        padding: 15px;
        order: 1;
    }
    
    .filter-group-header {
        font-size: 14px;
        padding: 6px 0;
    }
    
    .filter-options label {
        font-size: 13px;
    }
    
    .supplier-filter-checkbox {
        width: 16px;
        height: 16px;
    }
    
    .filter-count {
        padding: 1px 6px;
        font-size: 11px;
    }
    
    .floating-help-container {
        bottom: 15px;
        right: 15px;
    }
    
    .help-choose-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .help-tooltip {
        display: none;
    }
}