/**
 * AJAX Post Filter - CSS
 * 
 * Save this file as: css/ajax-filter.css in your theme directory
 */

/* Main wrapper */
.ajax-filter-wrapper {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0;
}

/* Filter controls */
.filter-controls {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #4d4d55;
    font-size: 15px;
}

/* Checkbox styles */
.checkbox-group {
    display: block;
    flex-direction: row;
    gap: 12px;
    border: 1px solid #ec4b95;
    padding: 8px 12px 8px 12px;
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    padding: 0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-right: 5px !important;
   }

.checkbox-label:hover {
 
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-top-color: #4d4d55;
    border-right-color: #4d4d55;
    border-bottom-color: #4d4d55;
    border-left-color: #4d4d55;
    margin-right: 5px !important;
    cursor: pointer;
    accent-color: #ec4b95;
    display:inline-flex;
    vertical-align: middle important;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    color: #ec4b95;
}

.checkbox-label:has(input[type="checkbox"]:checked) {

}

.checkbox-text {
    flex: 1;
    font-size: 20px;
    color: #4d4d55;
    transition: all 0.2s ease;
}

.post-count {
    color: #4d4d55;
    font-size: 15px;
    margin-left: 0;
}

/* Radio button styles */
.radio-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    border: 1px solid #ec4b95;
    padding: 8px 12px 8px 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-label:hover {

}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    cursor: pointer;
    accent-color: #ec4b95;
}

.radio-label input[type="radio"]:checked + .radio-text {

}

.radio-label:has(input[type="radio"]:checked) {

}

.radio-text {
    flex: 1;
    font-size: 20px;
    color: #4d4d55;
    transition: all 0.2s ease;
}

/* Reset button */
.reset-btn {
    padding: 8.25px 16px;
    background-color: #ec4b95;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 21px;
    font-weight: 500;
    cursor: pointer;
    height: fit-content;
    align-self: flex-start;
    margin-top: 26.5px;
}

.reset-btn:hover {
    background-color: #ec4b95;
}

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

.reset-btn.disabled {
    display:none;
}

/* Results count */
.results-count {
    margin-bottom: 20px;
    font-size: 15px;
    color: #4d4d55;
    font-weight: 500;
}

/* Loading state */
.filter-loading {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ec4b95;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.filter-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Results container */
.filter-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    min-height: 300px;
}

/* Post items */
.filter-post-item {
    background: #fff;
    border: 1px solid #969696;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, color 0.3s ease; 
    display: block !important; /* Hidden by default for fade-in animation */
}

.filter-post-item:hover {
    border: 1.5px solid #ec4b95;
    transform: scale(100.7%);
}

.post-thumbnail {
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f0f0f0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.filter-post-item:hover .post-thumbnail img {
}

.post-content {
    padding: 20px;
}

.post-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    line-height: 1.4;
}

.post-title a {
    color: #ec4b95 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    text-decoration: underline;
}

.post-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-size: 15px;
    color: #4d4d55;
}

.post-date {
    display: flex;
    align-items: center;
}

.filter-post-item .cat-links:before {
    content: "\f07b";
    font-family: "GeneratePress";
    font-weight: bold;
    color: #ffaf29;
    text-decoration-color: #ffaf29;
    text-decoration-line: none;
    text-decoration-style: solid;
    text-decoration-thickness: auto;
    margin-right: 5px;
    opacity: 0.7;
}

.cat-links a {
    color: #ec4b95 !important;
    text-decoration: none;
    margin-right: 5px;
}

.cat-links a:hover {
    text-decoration: underline;
}

.post-excerpt {
    color: #4d4d55;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 20px;
}

.read-more {
    display: inline-block;
    color: #00aeef;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    padding-bottom: 10px;
}

.read-more:hover {
    color: #ec4b95;
}

/* No posts found */
.no-posts-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f7f7f7;
    border-radius: 8px;
}

.no-posts-found p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Error message */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #ffe5e5;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    color: #cc0000;
}

/* Pagination */
.filter-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
    margin-top: 20px;
}

.pagination-btn {
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover {
    background-color: #005a87;
}

.pagination-btn:active {
    transform: translateY(1px);
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 25px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-group-categories {
        order: 1;
    }
    
    .filter-group-date {
        order: 2;
    }
    
    .reset-btn {
        width: 100%;
        margin-top: 0;
        order: 3;
    }
    
    .checkbox-group,
    .radio-group {
        max-height: 250px;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    .checkbox-group::-webkit-scrollbar,
    .radio-group::-webkit-scrollbar {
        width: 6px;
    }
    
    .checkbox-group::-webkit-scrollbar-track,
    .radio-group::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .checkbox-group::-webkit-scrollbar-thumb,
    .radio-group::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }
    
    .filter-results {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ajax-filter-wrapper {
        padding: 0;
    }
    
    .filter-controls {
        padding: 15px;
    }
    
    .filter-group-label {
        font-size: 15px;
    }
    
    .checkbox-label,
    .radio-label {
        padding: 8px 10px;
    }
    
    .checkbox-text,
    .radio-text {
        font-size: 14px;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-title {
        font-size: 18px;
    }
}