/* ===== Category Page Specific Styles ===== */

/* Category Hero */
.category-hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(220,38,38,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
}

.category-header {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.category-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #8b5cf6, #dc2626, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #dc2626, #f43f5e);
    border-radius: 2px;
}

.category-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
}

/* Category Articles */
.category-articles {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: 60vh;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    width: 100%;
}

.article-card {
    background-color: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #dc2626, #f43f5e);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    align-items: center;
}

.article-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.article-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.article-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-stat-icon {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
}

/* Empty State */
.category-empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.category-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.category-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-empty p {
    font-size: 1rem;
}

/* Loading State */
.category-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-title {
        font-size: 2.5rem;
    }
    
    .category-description {
        font-size: 1.1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-card {
        margin: 0 1rem;
    }
    
    .article-image {
        height: 200px;
    }
    
    .article-content {
        padding: 1.25rem;
    }
    
    .article-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .category-hero {
        padding: 4rem 0 3rem;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .article-card {
        margin: 0 0.5rem;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Animation for article cards */
.article-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }
.article-card:nth-child(7) { animation-delay: 0.7s; }
.article-card:nth-child(8) { animation-delay: 0.8s; }
.article-card:nth-child(9) { animation-delay: 0.9s; }
.article-card:nth-child(10) { animation-delay: 1.0s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects for better interactivity */
.article-card:hover .article-title {
    color: var(--primary-color);
}

.article-card:hover .article-category {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    transform: scale(1.05);
}

/* Focus states for accessibility */
.article-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.article-card:focus .article-title {
    color: var(--primary-color);
}
