/* Blog Filters */
.blog-filters {
    margin-top: 1.5rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: white;
    color: var(--text-dark);
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filter-btn.active::before {
    display: none;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image {
    transform: scale(1.08);
}

.blog-card-content {
    padding: 1.75rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.blog-category.cloud {
    background: rgba(56, 161, 105, 0.1);
    color: #2f855a;
}

.blog-category.web {
    background: rgba(237, 100, 166, 0.1);
    color: #b83280;
}

.blog-category.devops {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

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

.blog-card-excerpt {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-read-time {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.blog-tag {
    padding: 0.25rem 0.7rem;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-light);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.7rem 1.2rem;
    border: 2px solid rgba(148, 163, 184, 0.25);
    background: white;
    color: var(--text-dark);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 45px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

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

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-filters {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-card-content {
        padding: 1.5rem;
    }
    
    .blog-card-title {
        font-size: 1.25rem;
    }
    
    .pagination {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-width: 40px;
    }
}

@media (max-width: 640px) {
    /* Blog Grid - Horizontal Scroll */
    .blog-grid {
        display: flex;
        grid-template-columns: none;
        gap: 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
    }
    
    .blog-card {
        min-width: calc(100vw - 3rem);
        max-width: calc(100vw - 3rem);
        flex: 0 0 calc(100vw - 3rem);
        scroll-snap-align: start;
    }
    
    .blog-card-title,
    .blog-card-excerpt,
    .blog-author {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .blog-card-title {
        font-size: 1.15rem;
    }
    
    .blog-card-excerpt {
        font-size: 0.9rem;
    }
    
    .blog-card-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .blog-category {
        font-size: 0.75rem;
        padding: 0.25rem 0.7rem;
    }
    
    .filter-btn {
        padding: 0.45rem 1rem;
        font-size: 0.8rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .blog-card-content {
        padding: 1rem;
    }
    
    .blog-card-title {
        font-size: 1.05rem;
    }
    
    .blog-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Smooth fade transitions for filtering */
.blog-card.hiding {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-card.showing {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
