/* Smart Filter Component Styling */

.smart-filter-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.smart-filter-header {
    text-align: right;
    margin-bottom: 25px;
    border-right: 4px solid #2196F3;
    padding-right: 15px;
}

.smart-filter-header h3 {
    margin: 0 0 5px 0;
    color: #1a237e;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.smart-filter-header h3 i {
    color: #2196F3;
    font-size: 1.3em;
}

.smart-filter-subtitle {
    margin: 0;
    color: #555;
    font-size: 0.95em;
    font-weight: 400;
}

.smart-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-right: 4px solid #2196F3;
}

.filter-section-title {
    margin: 0 0 15px 0;
    color: #1a237e;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    justify-content: flex-end;
}

.filter-section-title i {
    color: #2196F3;
    font-size: 1.2em;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    direction: rtl;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    color: #333;
    font-size: 0.9em;
    font-weight: 600;
    text-align: right;
}

.filter-select,
.filter-input {
    padding: 12px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    color: #333;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: ltr;
    text-align: left;
    min-height: 42px;
    overflow: visible;
    text-overflow: clip;
}

.filter-select:hover,
.filter-input:hover {
    border-color: #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2), 0 4px 16px rgba(33, 150, 243, 0.15);
}

/* Maintain selection background color as requested */
.filter-select option:checked,
.filter-input::selection {
    background-color: #e8f4f8;
    color: #1a237e;
}

/* Remove spinner from number input */
.filter-input::-webkit-outer-spin-button,
.filter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-input[type=number] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: textfield;
}

.filter-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 10px;
}

.filter-btn-search,
.filter-btn-reset {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.filter-btn-search {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.filter-btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

.filter-btn-search:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.filter-btn-reset {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.filter-btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
}

.filter-btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

/* Responsive design */
@media (min-width: 1025px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        margin-bottom: 15px;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .smart-filter-container {
        padding: 20px;
        margin: 20px 0;
    }

    .smart-filter-header h3 {
        font-size: 1.2em;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 10px;
    }

    .filter-section {
        padding: 15px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-btn-search,
    .filter-btn-reset {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .smart-filter-container {
        padding: 15px;
        margin: 15px -15px;
        border-radius: 0;
    }

    .smart-filter-header h3 {
        font-size: 1.1em;
    }

    .filter-section {
        padding: 12px;
        border-radius: 6px;
    }
}

/* Premium Dropdown Design */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    border: 2px solid #e8eef5;
    border-radius: 8px;
    padding: 12px 12px 12px 12px;
    padding-right: 40px;
    font-size: 0.95em;
    color: #1a237e;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232196F3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 18px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    letter-spacing: 0.3px;
}

.filter-select:hover {
    border-color: #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.filter-select:focus {
    outline: none;
    border-color: #1976D2;
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2), 0 4px 16px rgba(33, 150, 243, 0.15);
}

.filter-select:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.12);
}

/* Option styling */
.filter-select option {
    padding: 12px;
    background-color: #ffffff;
    color: #1a237e;
    font-weight: 500;
    border-right: 3px solid transparent;
    transition: all 0.2s ease;
}

.filter-select option:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.filter-select option:checked {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #ffffff;
    font-weight: 600;
    border-right: 3px solid #ffffff;
    box-shadow: inset 0 0 20px rgba(33, 150, 243, 0.3);
}

.filter-select option:disabled {
    background-color: #f5f5f5;
    color: #999;
}

/* Optgroup styling */
.filter-select optgroup {
    background-color: #f0f5ff;
    color: #1a237e;
    font-weight: 600;
    padding: 8px;
    border-bottom: 2px solid #e3f2fd;
}

/* Focus state styling */
.filter-select:focus-within {
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2);
}

/* Placeholder styling */
.filter-input::placeholder {
    color: #aaa;
    font-weight: 400;
    font-style: italic;
}

/* Enhanced input styling */
.filter-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
}

.filter-input:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.filter-input:focus {
    background: linear-gradient(135deg, #ffffff 0%, #f0f5ff 100%);
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2), 0 4px 16px rgba(33, 150, 243, 0.15);
}

/* Disabled state */
.filter-select:disabled,
.filter-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Success state for filled filters */
.filter-select:valid {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f9fdfb 0%, #f0fff2 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

/* Error state */
.filter-select:invalid:not(:placeholder-shown) {
    border-color: #f44336;
    background: linear-gradient(135deg, #fdfbfb 0%, #fff3e0 100%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.15);
}
