/* Enhanced Category Filter and Post Grid Styles */

/* Enhanced Category Filter Styles */
.category-filter {
    background: #ffffff !important;
    padding: 28px !important;
    margin-bottom: 32px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1) !important;
}

.category-filter .filter-main-title {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    color: #1a202c !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: center !important;
}

/* Modern Horizontal Category Layout */
.categories-horizontal {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
}

/* Filter section styling */
.categories-horizontal .filter-section {
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto !important;
}

/* Parent category modern pills */
.parent-category {
    margin-bottom: 0 !important;
}

.parent-category label {
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 30px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    color: #1a202c !important;
}

.parent-category label:hover {
    background: #3182ce !important;
    color: white !important;
    border-color: #3182ce !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
}

.parent-category input[type="checkbox"] {
    margin-right: 8px !important;
    accent-color: #3182ce !important;
}

/* FIX FOR VISIBILITY ISSUE: Keep text visible when selected */
.parent-category input[type="checkbox"]:checked + span {
    color: #1a202c !important; /* Changed from white to dark color */
}

.parent-category input[type="checkbox"]:checked {
    accent-color: #3182ce !important;
}

.parent-category label:has(input[type="checkbox"]:checked) {
    background: #e6f0fa !important; /* Lighter blue for better contrast */
    color: #1a202c !important; /* Dark text color */
    border-color: #3182ce !important;
}

/* Enhanced Subcategories dropdown */
.subcategories {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 300px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px rgba(0,0,0,0.1) !important;
    padding: 20px !important;
    margin-top: 8px !important;
    z-index: 1000 !important;
    display: none !important;
}

.subcategory-title {
    margin: 0 0 16px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #6b7280 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.subcategories label {
    font-weight: 500 !important;
    display: block !important;
    margin-bottom: 10px !important;
    cursor: pointer !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.subcategories label:hover {
    background-color: #f8f9fa !important;
    color: #3182ce !important;
}

.subcategories input[type="checkbox"] {
    margin-right: 8px !important;
    accent-color: #3182ce !important;
}

/* Subcategory Section Styling */
.subcategory-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.subcategory-section-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    text-align: center;
}

.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.subcategories-list label {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.subcategories-list label:hover {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
    transform: translateY(-1px);
}

.subcategories-list input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #3182ce;
}

.subcategories-list label:has(input[type="checkbox"]:checked) {
    background: #3182ce !important;
    color: white !important;
    border-color: #3182ce !important;
}

.subcategories-list input[type="checkbox"]:checked {
    accent-color: white !important;
}

.subcategories-list input[type="checkbox"]:checked + span {
    color: white !important;
}

/* Enhanced Sidebar Styles */
.sidebar-area {
    padding-left: 32px !important;
    padding-top: 0 !important;
}

.sidebar-area .widget {
    background: #ffffff !important;
    padding: 24px !important;
    margin-bottom: 28px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-area .widget:hover {
    box-shadow: 0 10px 15px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px) !important;
}

.sidebar-area .widget h3,
.sidebar-area .widget h4,
.sidebar-area .widget .widget-title {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    color: #1a202c !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #f1f5f9 !important;
    padding-bottom: 12px !important;
}

.sidebar-area .widget ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar-area .widget li {
    padding: 8px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.sidebar-area .widget li:last-child {
    border-bottom: none !important;
}

.sidebar-area .widget a {
    color: #4a5568 !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-area .widget a:hover {
    color: #3182ce !important;
}

/* Posts Grid Styles - Enhanced 3-Column Layout */
.posts-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 28px !important;
    margin-top: 32px !important;
    margin-bottom: 40px !important;
}

/* Large screens - maintain 3 columns with better spacing */
@media (min-width: 1400px) {
    .posts-grid {
        gap: 32px !important;
    }
}

/* Medium screens (tablets) -> 2 columns */
@media (max-width: 1199px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }
}

/* Small screens -> 1 column */
@media (max-width: 767px) {
    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Enhanced Post Card Styling */
.post-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
    position: relative !important;
}

.post-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 25px rgba(0,0,0,0.1) !important;
    border-color: #3182ce !important;
}

/* Post Image with Overlay Effect */
.post-image {
    position: relative !important;
    overflow: hidden !important;
}

.post-image img {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
    display: block !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.post-item:hover .post-image img {
    transform: scale(1.05) !important;
}

/* Post Content */
.post-content {
    padding: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

.post-title {
    margin: 0 0 12px 0 !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #1a202c !important;
}

.post-title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.post-title a:hover {
    color: #3182ce !important;
}

.post-categories {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.post-excerpt {
    color: #4a5568 !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    font-size: 15px !important;
    flex-grow: 1 !important;
}

/* Enhanced Actions */
.post-actions {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    margin-top: auto !important;
    padding-top: 16px !important;
    border-top: 1px solid #f1f5f9 !important;
}

.like-btn, .share-btn {
    background: #3182ce !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 60px !important;
    justify-content: center !important;
}

.like-btn:hover, .share-btn:hover {
    transform: translateY(-1px) scale(1.05) !important;
    background: #2c5aa0 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
}

.like-btn.liked {
    background: #e53e3e !important;
}

.like-btn.liked:hover {
    background: #c53030 !important;
}

.like-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.share-btn.copied {
    background: #38a169 !important;
}

/* Like button icon styling */
.like-icon {
    font-size: 16px !important;
    line-height: 1 !important;
}

.like-count {
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Misc */
.no-posts-message {
    text-align: center !important;
    padding: 60px 20px !important;
    color: #6b7280 !important;
    font-size: 18px !important;
    grid-column: 1 / -1 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

.loading {
    text-align: center !important;
    padding: 60px 20px !important;
    font-size: 18px !important;
    color: #6b7280 !important;
    grid-column: 1 / -1 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px 20px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-toggle:hover {
    background: #2c5aa0;
}

.mobile-filter-toggle .toggle-icon {
    float: right;
    transition: transform 0.2s ease;
}

/* Responsive adjustments for filters and sidebar */
@media (max-width: 991px) {
    .sidebar-area {
        padding-left: 0 !important;
        margin-top: 32px !important;
    }
}

@media (max-width: 767px) {
    .category-filter {
        padding: 20px !important;
    }

    .categories-horizontal {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    .subcategories {
        position: static !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
        border: 1px solid #e2e8f0 !important;
        margin-top: 12px !important;
        min-width: auto !important;
    }

    .filter-section {
        width: 100% !important;
    }

    .parent-category label {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .mobile-filter-toggle {
        display: block !important;
    }

    .post-image img {
        height: 200px !important;
    }
    
    .subcategory-section {
        margin-top: 16px;
        padding: 16px;
    }
    
    .subcategories-list {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subcategories-list label {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .post-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .like-btn, .share-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .post-content {
        padding: 20px !important;
    }

    .sidebar-area .widget {
        padding: 20px !important;
    }

    .category-filter {
        padding: 16px !important;
    }

    .category-filter .filter-main-title {
        font-size: 20px !important;
    }
}