/* Advanced Filter Pro Styles */

.afp-filter-container {
    margin: 20px 0;
    font-family: inherit;
}

.afp-filter-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.afp-filter-group {
    margin-bottom: 15px;
    display: inline-block;
    margin-right: 15px;
    vertical-align: top;
}

.afp-filter-group:last-of-type {
    margin-right: 0;
}

.afp-filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.afp-filter-select {
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
}

.afp-filter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.afp-filter-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button styles with high specificity to override Elementor */
.afp-filter-container .afp-filter-actions .afp-filter-button,
.afp-filter-container .afp-filter-actions .afp-reset-button,
.afp-filter-form .afp-filter-actions .afp-filter-button,
.afp-filter-form .afp-filter-actions .afp-reset-button,
.afp-filter-button,
.afp-reset-button {
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
    text-align: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    outline: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.afp-filter-container .afp-filter-actions .afp-filter-button,
.afp-filter-form .afp-filter-actions .afp-filter-button,
.afp-filter-button {
    background-color: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.afp-filter-container .afp-filter-actions .afp-filter-button:hover,
.afp-filter-form .afp-filter-actions .afp-filter-button:hover,
.afp-filter-button:hover {
    background-color: #005a87 !important;
    color: #fff !important;
    border-color: #005a87 !important;
    text-decoration: none !important;
}

.afp-filter-container .afp-filter-actions .afp-reset-button,
.afp-filter-form .afp-filter-actions .afp-reset-button,
.afp-reset-button {
    background-color: #666 !important;
    color: #fff !important;
    border-color: #666 !important;
}

.afp-filter-container .afp-filter-actions .afp-reset-button:hover,
.afp-filter-form .afp-filter-actions .afp-reset-button:hover,
.afp-reset-button:hover {
    background-color: #555 !important;
    color: #fff !important;
    border-color: #555 !important;
    text-decoration: none !important;
}

/* Additional button states to override all possible Elementor styles */
.afp-filter-button:focus,
.afp-filter-button:active,
.afp-reset-button:focus,
.afp-reset-button:active {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3) !important;
}

.afp-filter-button:disabled,
.afp-reset-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    color: #666 !important;
}

.afp-results-container {
    margin-top: 20px;
}

.afp-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.afp-post-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.afp-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.afp-post-thumbnail {
    overflow: hidden;
    aspect-ratio: 16/9;
}

.afp-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.afp-post-item:hover .afp-post-thumbnail img {
    transform: scale(1.05);
}

.afp-post-content {
    padding: 20px;
}

/* More specific selectors to override Elementor styles */
.afp-filter-container .afp-post-item .afp-post-content .afp-post-title,
.afp-results-container .afp-post-item .afp-post-content .afp-post-title,
.afp-post-title {
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    line-height: 1.4 !important;
    font-weight: normal !important;
}

.afp-filter-container .afp-post-item .afp-post-content .afp-post-title a,
.afp-results-container .afp-post-item .afp-post-content .afp-post-title a,
.afp-post-title a {
    color: #2B6CB0 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.afp-filter-container .afp-post-item .afp-post-content .afp-post-title a:hover,
.afp-results-container .afp-post-item .afp-post-content .afp-post-title a:hover,
.afp-post-title a:hover {
    color: #1e4a73 !important;
}

/* Taxonomy meta styles with high specificity */
.afp-filter-container .afp-post-item .afp-post-content .afp-post-taxonomies,
.afp-results-container .afp-post-item .afp-post-content .afp-post-taxonomies,
.afp-post-taxonomies {
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    display: block !important;
}

.afp-filter-container .afp-taxonomy-group,
.afp-results-container .afp-taxonomy-group,
.afp-taxonomy-group {
    margin-bottom: 6px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px !important;
}

.afp-filter-container .afp-taxonomy-group:last-child,
.afp-results-container .afp-taxonomy-group:last-child,
.afp-taxonomy-group:last-child {
    margin-bottom: 0 !important;
}

.afp-filter-container .afp-taxonomy-label,
.afp-results-container .afp-taxonomy-label,
.afp-taxonomy-label {
    font-weight: 600 !important;
    color: #666 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-width: 60px !important;
}

.afp-filter-container .afp-taxonomy-terms,
.afp-results-container .afp-taxonomy-terms,
.afp-taxonomy-terms {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

.afp-filter-container .afp-taxonomy-term,
.afp-results-container .afp-taxonomy-term,
.afp-taxonomy-term {
    background: #f8f9fa !important;
    color: #495057 !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

.afp-filter-container .afp-taxonomy-term:hover,
.afp-results-container .afp-taxonomy-term:hover,
.afp-taxonomy-term:hover {
    background: #e9ecef !important;
    color: #343a40 !important;
}

.afp-post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.afp-post-meta {
    font-size: 12px;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.afp-post-date {
    font-weight: 500;
}

.afp-pagination {
    text-align: center;
    margin-top: 30px;
}

.afp-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.afp-pagination .page-numbers:hover,
.afp-pagination .page-numbers.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.afp-pagination .page-numbers.dots {
    border: none;
    background: none;
    cursor: default;
}

.afp-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.afp-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.afp-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: afp-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .afp-filter-group {
        display: block;
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .afp-filter-select {
        width: 100%;
        min-width: auto;
    }

    .afp-posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .afp-filter-actions {
        justify-content: center;
    }

    .afp-filter-button,
    .afp-reset-button {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .afp-filter-form {
        padding: 15px;
    }

    .afp-post-content {
        padding: 15px;
    }

    .afp-filter-container .afp-post-item .afp-post-content .afp-post-title,
    .afp-results-container .afp-post-item .afp-post-content .afp-post-title,
    .afp-post-title {
        font-size: 16px !important;
    }

    .afp-filter-container .afp-taxonomy-group,
    .afp-results-container .afp-taxonomy-group,
    .afp-taxonomy-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
    }

    .afp-filter-container .afp-taxonomy-label,
    .afp-results-container .afp-taxonomy-label,
    .afp-taxonomy-label {
        min-width: auto !important;
        font-size: 11px !important;
    }

    .afp-filter-container .afp-taxonomy-term,
    .afp-results-container .afp-taxonomy-term,
    .afp-taxonomy-term {
        font-size: 10px !important;
        padding: 1px 6px !important;
    }
}

/* Desktop specific styles (1024px and above) */
@media (min-width: 1024px) {
    .afp-filter-container .afp-post-item .afp-post-content .afp-post-title,
    .afp-results-container .afp-post-item .afp-post-content .afp-post-title,
    .afp-post-title {
        font-size: 24px !important;
    }

    .afp-filter-form {
        display: flex;
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 15px;
    }

    .afp-filter-group {
        margin-bottom: 0;
        margin-right: 0;
        display: inline-block;
    }

    .afp-filter-actions {
        margin-top: 0;
        display: flex;
        align-items: flex-end;
        gap: 10px;
    }
}

/* Widget specific styles */
.widget .afp-filter-container {
    margin: 0;
}

.widget .afp-filter-form {
    background: none;
    border: none;
    padding: 0;
}

.widget .afp-filter-group {
    display: block;
    margin-right: 0;
    width: 100%;
}

.widget .afp-filter-select {
    width: 100%;
}

.widget .afp-posts-grid {
    grid-template-columns: 1fr;
}

.widget .afp-post-item {
    margin-bottom: 15px;
}

.widget .afp-post-content {
    padding: 15px;
}

.widget .afp-post-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.widget .afp-post-excerpt {
    font-size: 12px;
    margin-bottom: 8px;
}