.blog-list-header {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.blog-list-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.create-post-btn {
    background: white;
    color: var(--primary);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.create-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    color: var(--primary-dark);
}

/* Filter Bar - Now at Top */
.filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

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

.filter-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: block;
}

.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box {
    position: relative;
    flex: 2;
    min-width: 250px;
}

/* Base input styles — padding will be adjusted based on page direction */
.search-input {
    width: 100%;
    padding: 0.75rem 1rem; /* fallback: small horizontal padding */
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

/* LTR: leave extra space on the right for the button */
[dir="ltr"] .search-input {
    padding: 0.75rem 3rem 0.75rem 1rem; /* top right bottom left */
}

/* RTL: leave extra space on the left for the button */
[dir="rtl"] .search-input {
    padding: 0.75rem 1rem 0.75rem 3rem; /* top right bottom left (swapped) */
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Position button based on text direction */
[dir="ltr"] .search-btn {
    right: 0.5rem;
}

[dir="rtl"] .search-btn {
    left: 0.5rem;
}

.search-btn:hover {
    opacity: 0.9;
}

.clear-filters-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.clear-filters-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Draft Toggle Button */
.draft-toggle-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
    user-select: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label i {
    font-size: 1.1rem;
    color: var(--primary);
}

.draft-mode-badge {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.active-filters {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Horizontal Scroll Sections - Featured Content */
.scroll-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 2px dashed #e2e8f0;
}

.scroll-section.top-featured {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    border: 2px solid #e9d5ff;
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #e2e8f0;
}

.scroll-container::-webkit-scrollbar {
    height: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    border-radius: 10px;
}

.scroll-content {
    display: inline-flex;
    gap: 0.75rem;
}

/* Clear visual separator before main content */
.main-content-separator {
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--primary) 50%,
        transparent 100%
    );
    margin: 2.5rem 0;
    border-radius: 2px;
}

.main-content-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

/* Horizontal Blog Card - Smaller Compact Design */
.blog-card-horizontal {
    width: 220px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: top;
    white-space: normal;
}

.blog-card-horizontal:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.blog-card-image-horizontal {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.blog-card-body-horizontal {
    padding: 0.85rem;
}

.blog-card-category {
    display: inline-block;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.blog-card-title-horizontal {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    color: #718096;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.blog-card-meta-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #a0aec0;
    font-size: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Main Grid - More Compact Cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.blog-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.blog-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt-main {
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    flex-grow: 1;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #a0aec0;
    font-size: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e2e8f0;
}

.blog-card-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-card-link:hover {
    color: var(--primary-dark);
}

.pagination {
    margin-top: 2.5rem;
}

.page-link {
    color: var(--primary);
    border-color: #e2e8f0;
}

.page-link:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.blog-image-placeholder {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.blog-icon-placeholder {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Bottom sections styling - More subtle */
.bottom-section {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #fefefe;
    border-radius: 15px;
    border: 2px dashed #e2e8f0;
}

.section-subtitle {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.4rem;
}

/* Mobile Optimizations - Show 2 cards side by side */
@media (max-width: 768px) {
    .blog-list-header {
        padding: 2rem 0;
    }

    .blog-list-header h1 {
        font-size: 1.8rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group,
    .search-box {
        min-width: 100%;
    }

    .section-title {
        font-size: 1rem;
    }

    .section-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    /* Horizontal scroll cards - Show ~2 cards at a time on mobile */
    .blog-card-horizontal {
        width: 165px;
    }

    .blog-card-image-horizontal {
        height: 95px;
    }

    .blog-card-body-horizontal {
        padding: 0.7rem;
    }

    .blog-card-title-horizontal {
        font-size: 0.8rem;
    }

    .blog-card-category {
        font-size: 0.6rem;
        padding: 0.1rem 0.4rem;
    }

    .blog-card-excerpt {
        font-size: 0.65rem;
    }

    .blog-card-meta-horizontal {
        font-size: 0.6rem;
    }

    .scroll-content {
        gap: 0.6rem;
    }

    .scroll-section {
        padding: 1rem;
    }

    /* Main grid - More compact on mobile */
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .blog-card-image {
        height: 120px;
    }

    .blog-card-body {
        padding: 0.85rem;
    }

    .blog-card-title {
        font-size: 0.88rem;
    }

    .blog-card-excerpt-main {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .blog-card-meta {
        font-size: 0.65rem;
    }
}

/* Extra small screens - Ensure 2 horizontal cards visible */
@media (max-width: 480px) {
    .blog-card-horizontal {
        width: 150px;
    }

    .blog-card-image-horizontal {
        height: 85px;
    }

    .blog-card-title-horizontal {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .blog-card-excerpt {
        font-size: 0.6rem;
        -webkit-line-clamp: 1;
    }

    .section-subtitle {
        font-size: 0.65rem;
    }

    /* Main grid on very small screens */
    .blog-grid {
        grid-template-columns: 1fr;
    }
}
