/**
 * Taxonomy Filter for Elementor - Styles
 */

.tfe-taxonomy-filter-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.tfe-taxonomy-filter-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
    transition: all 0.3s ease;
}

.tfe-taxonomy-filter-select:hover {
    border-color: #999;
}

.tfe-taxonomy-filter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.tfe-taxonomy-filter-select option {
    padding: 10px;
    background-color: #fff;
    color: #333;
}

/* Loading state */
.tfe-filtering {
    position: relative;
    min-height: 200px;
}

.tfe-filtering .e-loop-item,
.tfe-filtering .elementor-post,
.tfe-filtering article,
.tfe-filtering .post-item {
    opacity: 0.5;
    pointer-events: none;
}

/* Loading overlay */
.tfe-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tfe-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tfe-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: tfe-spin 1s linear infinite;
    margin-bottom: 15px;
}

.tfe-loading-text {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

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

/* Disabled select state */
.tfe-taxonomy-filter-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* No results message */
.tfe-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tfe-taxonomy-filter-select {
        font-size: 14px;
        padding: 10px 12px;
        padding-right: 35px;
    }
}

/* Elementor editor compatibility */
.elementor-editor-active .tfe-taxonomy-filter-wrapper {
    pointer-events: auto;
}

/* Smooth transitions for filtered items */
.e-loop-item,
.elementor-post,
article,
.post-item {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
