/* Blog Category Styles */

/* Active category chip styling */
.category-chip.active {
    background: #dc2626 !important;
    color: white !important;
    border: 2px solid #dc2626;
}

.category-chip.active:hover {
    background: #b91c1c !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Category header enhancements */
.category-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    position: relative;
    overflow: hidden;
}

.category-header::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="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="90" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* Category statistics cards */
.category-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.posts {
    background: #fef2f2;
    color: #dc2626;
}

.stat-card .stat-icon.views {
    background: #eff6ff;
    color: #2563eb;
}

.stat-card .stat-icon.latest {
    background: #f0fdf4;
    color: #16a34a;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Category breadcrumb */
.category-breadcrumb {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.category-breadcrumb .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.category-breadcrumb .breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #d1d5db;
}

.category-breadcrumb .breadcrumb-item.active {
    color: #dc2626;
    font-weight: 600;
}

.category-breadcrumb .breadcrumb-item a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-breadcrumb .breadcrumb-item a:hover {
    color: #dc2626;
}

/* Category filter buttons */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-filter-btn {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.category-filter-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.category-filter-btn.active {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.category-filter-btn .filter-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Enhanced post cards for category pages */
.category-post-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.category-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #dc2626;
}

.category-post-card .post-image {
    position: relative;
    overflow: hidden;
}

.category-post-card .post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post-card:hover .post-image img {
    transform: scale(1.05);
}

.category-post-card .post-category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.category-post-card .post-content {
    padding: 1.5rem;
}

.category-post-card .post-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.category-post-card .post-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.category-post-card .post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
}

.category-post-card .post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Empty state for categories with no posts */
.category-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-empty-state .empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.category-empty-state .empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.category-empty-state .empty-description {
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.category-empty-state .empty-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #dc2626;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.category-empty-state .empty-action:hover {
    background: #b91c1c;
}

/* Loading skeleton for category posts */
.category-skeleton {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.category-skeleton .skeleton-image {
    height: 200px;
    background: #f3f4f6;
    position: relative;
    overflow: hidden;
}

.category-skeleton .skeleton-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-loading 1.5s infinite;
}

.category-skeleton .skeleton-content {
    padding: 1.5rem;
}

.category-skeleton .skeleton-title {
    height: 1.5rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.category-skeleton .skeleton-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-loading 1.5s infinite;
}

.category-skeleton .skeleton-excerpt {
    height: 3rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.category-skeleton .skeleton-excerpt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-loading 1.5s infinite;
}

.category-skeleton .skeleton-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-skeleton .skeleton-meta-item {
    height: 0.75rem;
    width: 80px;
    background: #f3f4f6;
    border-radius: 0.25rem;
    position: relative;
    overflow: hidden;
}

.category-skeleton .skeleton-meta-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-post-card .post-content {
        padding: 1rem;
    }

    .category-post-card .post-title {
        font-size: 1rem;
    }

    .category-empty-state {
        padding: 2rem 1rem;
    }

    .category-empty-state .empty-icon {
        font-size: 3rem;
    }

    .category-empty-state .empty-title {
        font-size: 1.25rem;
    }
}

/* Recent Posts in Sidebar */
.recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.recent-post-item:hover {
    background: #f9fafb;
    border-radius: 0.375rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    transform: translateX(2px);
}

.recent-post-item:last-child {
    border-bottom: none;
}

.recent-post-image {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f3f4f6;
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-post-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.recent-post-meta i {
    font-size: 0.625rem;
}

/* Print styles */
@media print {
    .category-header,
    .category-sidebar,
    .category-filters,
    .category-breadcrumb {
        display: none !important;
    }

    .category-post-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
