/* ================================================
   Advanced Blog Filter Pro - Styling v2.3
   ================================================ */

/* General Wrapper */
.abf-pro-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ================================================
   FILTER TOGGLE BUTTON
   ================================================ */

.abf-pro-filter-toggle-wrapper {
    margin-bottom: 20px;
    text-align: left;
}

.abf-pro-filter-toggle-wrapper[dir="rtl"] {
    text-align: right;
}

.abf-pro-filter-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.abf-pro-filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ================================================
   FILTER SECTION
   ================================================ */

.abf-pro-filters {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    max-height: 1000px;
    overflow: hidden;
}

.abf-pro-filters.abf-pro-filters-collapsed {
    max-height: 0;
    padding: 0;
    margin-bottom: 0;
    border: none;
    overflow: hidden;
}

.abf-pro-filter-header h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.abf-pro-filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.abf-pro-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.abf-pro-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   CATEGORIES
   ================================================ */

.abf-pro-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abf-pro-category-item {
    padding: 8px 0;
}

.abf-pro-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
}

.abf-pro-category-label:hover {
    color: #667eea;
}

.abf-pro-category-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.abf-pro-category-count {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}

.toggle-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease;
    color: #999;
}

.abf-pro-category-item.open .toggle-arrow {
    transform: rotate(90deg);
}

.abf-pro-subcategories {
    margin-top: 8px;
    margin-left: 24px;
    border-left: 2px solid #ddd;
    padding-left: 12px;
}

.abf-pro-depth-1 {
    margin-left: 20px;
}

.abf-pro-depth-2 {
    margin-left: 40px;
}

/* ================================================
   SELECT DROPDOWN
   ================================================ */

.abf-pro-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.abf-pro-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* ================================================
   BUTTONS
   ================================================ */

.abf-pro-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.abf-pro-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.abf-pro-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.abf-pro-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.abf-pro-btn-secondary {
    background: #e9ecef;
    color: #333;
    border: 1px solid #ddd;
}

.abf-pro-btn-secondary:hover {
    background: #dee2e6;
}

/* ================================================
   RESULTS WRAPPER & GRID
   ================================================ */

.abf-pro-results-wrapper {
    margin-top: 30px;
}

.abf-pro-posts-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* 3 Columns - Desktop */
.abf-pro-posts-grid.abf-pro-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 2 Columns Option */
.abf-pro-posts-grid.abf-pro-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 1 Column Option */
.abf-pro-posts-grid.abf-pro-cols-1 {
    grid-template-columns: 1fr;
}

/* ================================================
   POST ITEM CARD
   ================================================ */

.abf-pro-post-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.abf-pro-post-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* ================================================
   POST IMAGE - FULL SIZE
   ================================================ */

.abf-pro-post-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.abf-pro-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.abf-pro-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.abf-pro-post-item:hover .abf-pro-post-image img {
    transform: scale(1.05);
}

/* ================================================
   POST CONTENT
   ================================================ */

.abf-pro-post-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Date - SMALL */
.abf-pro-post-date {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Title - SMALL */
.abf-pro-post-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: #222;
}

.abf-pro-post-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.abf-pro-post-title a:hover {
    color: #667eea;
}

/* Excerpt */
.abf-pro-post-excerpt {
    font-size: 12px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

/* Read More Link */
.abf-pro-read-more {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.abf-pro-read-more:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ================================================
   PAGINATION
   ================================================ */

.abf-pro-pagination {
    margin-top: 30px;
}

.abf-pro-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.abf-pro-page-btn {
    padding: 8px 16px;
    font-size: 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.abf-pro-page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.abf-pro-page-info {
    font-size: 12px;
    color: #666;
}

/* ================================================
   NO POSTS
   ================================================ */

.abf-pro-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.abf-pro-no-posts p {
    margin: 0;
}

/* ================================================
   RESPONSIVE - TABLET
   ================================================ */

@media (max-width: 1024px) {
    .abf-pro-posts-grid.abf-pro-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .abf-pro-posts-grid.abf-pro-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .abf-pro-filter-toggle-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    .abf-pro-post-title {
        font-size: 14px;
    }

    .abf-pro-post-excerpt {
        font-size: 12px;
    }
}

/* ================================================
   RESPONSIVE - MOBILE (1 COLUMN)
   ================================================ */

@media (max-width: 768px) {
    .abf-pro-wrapper {
        padding: 15px;
    }

    /* Force 1 column on mobile */
    .abf-pro-posts-grid {
        grid-template-columns: 1fr !important;
    }

    .abf-pro-post-image {
        aspect-ratio: 4 / 3;
    }

    .abf-pro-post-content {
        padding: 14px;
    }

    .abf-pro-post-date {
        font-size: 10px;
    }

    .abf-pro-post-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .abf-pro-post-excerpt {
        font-size: 12px;
        line-height: 1.5;
    }

    .abf-pro-filter-actions {
        flex-direction: column;
    }

    .abf-pro-filter-actions .abf-pro-btn {
        width: 100%;
    }

    .abf-pro-pagination-controls {
        flex-direction: column;
        gap: 10px;
    }

    .abf-pro-page-btn {
        width: 100%;
    }

    .abf-pro-categories-list {
        gap: 6px;
    }

    .abf-pro-category-label {
        font-size: 12px;
    }

    .abf-pro-filter-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .abf-pro-wrapper {
        padding: 10px;
    }

    .abf-pro-post-item {
        border-radius: 6px;
    }

    .abf-pro-post-content {
        padding: 12px;
    }

    .abf-pro-post-date {
        font-size: 9px;
    }

    .abf-pro-post-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .abf-pro-post-excerpt {
        font-size: 11px;
    }

    .abf-pro-filter-toggle-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .abf-pro-filter-section {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .abf-pro-filters {
        padding: 15px;
    }
}

/* ================================================
   RTL Support
   ================================================ */

.abf-pro-wrapper[dir="rtl"] .abf-pro-subcategories {
    margin-right: 24px;
    margin-left: 0;
    border-left: none;
    border-right: 2px solid #ddd;
    padding-left: 0;
    padding-right: 12px;
}

.abf-pro-wrapper[dir="rtl"] .abf-pro-depth-1 {
    margin-left: 0;
    margin-right: 20px;
}

.abf-pro-wrapper[dir="rtl"] .abf-pro-depth-2 {
    margin-left: 0;
    margin-right: 40px;
}

.abf-pro-wrapper[dir="rtl"] .toggle-arrow {
    margin-left: 0;
    margin-right: auto;
}

.abf-pro-wrapper[dir="rtl"] .abf-pro-category-count {
    margin-left: 0;
    margin-right: 4px;
}

.abf-pro-wrapper[dir="rtl"] .abf-pro-read-more {
    align-self: flex-end;
}

/* ================================================
   Loading State
   ================================================ */

.abf-pro-posts-grid {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.abf-pro-posts-grid.loading {
    opacity: 0.5;
}
