/**
 * Resources Filters Styles
 */

/* Container */
.tfp-resources-filters-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Category Filters */
.tfp-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tfp-filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 18px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    user-select: none;
}

.tfp-filter-checkbox:hover {
    border-color: #1e2640;
    background: #f0f7ff;
}

.tfp-filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.tfp-filter-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #1e2640;
}

.tfp-filter-checkbox span {
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
}

/* Posts Grid */
.tfp-posts-container {
    min-height: 400px;
    transition: opacity 0.3s ease;
}

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

@media (max-width: 768px) {
    .tfp-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Post Item */
.tfp-post-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tfp-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.tfp-post-thumbnail {
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.tfp-post-thumbnail a {
    display: block;
    line-height: 0;
}

.tfp-post-thumbnail img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.3s ease;
}

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

.tfp-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.tfp-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tfp-post-title a:hover {
    color: #1e2640;
}

.tfp-post-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.tfp-post-date,
.tfp-post-categories {
    display: inline-block;
}

.tfp-post-categories {
    font-style: italic;
}

.tfp-post-excerpt {
    flex: 1;
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

.tfp-read-more {
    display: inline-block;
    padding: 10px 20px;
    background: #1e2640;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
    align-self: flex-start;
}

.tfp-read-more:hover {
    background: #7a1317;
    color: #ffffff;
}

/* No Posts Message */
.tfp-no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

/* Pagination */
.tfp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 20px 0;
}

.tfp-pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.tfp-pagination-btn {
    padding: 10px 15px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.tfp-pagination-btn:hover {
    background: #1e2640;
    border-color: #1e2640;
    color: #ffffff;
}

.tfp-pagination-btn.active {
    background: #1e2640;
    border-color: #1e2640;
    color: #ffffff;
    cursor: default;
}

.tfp-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tfp-pagination-dots {
    padding: 0 5px;
    color: #999;
}

/* Loading Indicator */
.tfp-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 20px 40px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 16px;
    font-weight: 600;
}

.tfp-loading span {
    display: inline-block;
    animation: loading-pulse 1.5s ease-in-out infinite;
    -webkit-animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .tfp-resources-filters-container {
        padding: 15px;
    }
    
    .tfp-category-filters {
        gap: 10px;
        padding: 15px;
    }
    
    .tfp-posts-grid {
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .tfp-category-filters {
        flex-direction: column;
    }
    
    .tfp-filter-checkbox {
        width: 100%;
        justify-content: flex-start;
    }
    
    .tfp-pagination {
        gap: 5px;
    }
    
    .tfp-pagination-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}
