/* ==========================================================================
   Category Page Specific Styles
   ========================================================================== */

/* Category Header */
.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 20px 80px;
    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 1440 320"><path fill="%23ffffff10" d="M0,160L48,176C96,192,192,224,288,213.3C384,203,480,149,576,149.3C672,149,768,203,864,213.3C960,224,1056,192,1152,160C1248,128,1344,96,1392,80L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.category-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.category-icon-large {
    font-size: 4rem;
    margin-bottom: 25px;
    display: inline-block;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.category-title {
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: white;
}

.category-description {
    font-size: 1.15rem;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 25px;
}

.category-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
}

.content-area {
    padding: 20px 0 60px;
}

/* Subcategories Section */
.subcategories-section {
    background: #f8f9fa;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.subcategory-card {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.subcategory-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.subcategory-name {
    color: #333;
    font-weight: 500;
}

.subcategory-count {
    background: #667eea15;
    color: #667eea;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Sort Options */
.sort-options {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sort-label {
    font-weight: 600;
    color: #333;
}

.sort-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 8px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 25px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-btn:hover {
    background: #e9ecef;
    color: #333;
}

.sort-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Category Posts Grid */
.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Post Card */
.category-post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.category-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Post Card Thumbnail */
.post-card-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-post-card:hover .post-card-thumbnail img {
    transform: scale(1.1);
}

.no-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    font-size: 3rem;
    color: #667eea50;
}

.post-format-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Post Card Content */
.post-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #999;
}

.post-card-meta a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.post-card-meta a:hover {
    color: #667eea;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    line-height: 1.4;
    flex: 1;
}

.post-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a:hover {
    color: #667eea;
}

.post-card-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Related Categories Widget */
.related-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-categories-list li {
    border-bottom: 1px solid #f0f0f0;
}

.related-categories-list li:last-child {
    border-bottom: none;
}

.related-categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.related-categories-list a:hover {
    color: #667eea;
    padding-left: 10px;
}

/* Category Popular Posts Widget */
.category-popular-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-popular-posts li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-popular-posts li:last-child {
    border-bottom: none;
}

.category-popular-posts a {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
}

.category-popular-posts .rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.category-popular-posts .post-title {
    color: #333;
    line-height: 1.4;
    flex: 1;
    transition: color 0.3s;
}

.category-popular-posts a:hover .post-title {
    color: #667eea;
}

/* Category Tag Cloud */
.category-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag-cloud .tag-item {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.category-tag-cloud .tag-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    margin: 60px 0;
    text-align: center;
}

.pagination ul.page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination ul.page-numbers li {
    margin: 0;
}

.pagination .page-numbers:not(ul) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: white;
    color: #333;
    text-decoration: none;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pagination .page-numbers:not(ul):hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.pagination .current:not(ul),
.pagination .page-numbers.current:not(ul) {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    font-weight: 600;
}

.pagination .dots {
    border: none !important;
    background: none !important;
    color: #999 !important;
    cursor: default;
    box-shadow: none !important;
}

.pagination .dots:hover {
    background: none !important;
    color: #999 !important;
    transform: none !important;
    box-shadow: none !important;
}

.pagination .prev,
.pagination .next {
    padding: 0 20px;
    font-weight: 600;
    gap: 8px;
}

.pagination .prev:not(ul):hover,
.pagination .next:not(ul):hover {
    background: #5a6fd8;
}

.pagination .prev i {
    font-size: 0.85rem;
}

.pagination .next i {
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .category-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-title {
        font-size: 2.2rem;
    }

    .category-icon-large {
        font-size: 3rem;
        width: 80px;
        height: 80px;
    }

    .category-posts-grid {
        grid-template-columns: 1fr;
    }

    .sort-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-buttons {
        width: 100%;
    }

    .sort-btn {
        flex: 1;
        justify-content: center;
    }

    .subcategories-grid {
        grid-template-columns: 1fr;
    }

    .pagination ul.page-numbers {
        gap: 8px;
    }

    .pagination .page-numbers:not(ul) {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }

    .pagination .prev,
    .pagination .next {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .category-header {
        padding: 80px 20px 60px;
    }

    .category-title {
        font-size: 1.8rem;
    }

    .category-description {
        font-size: 1rem;
    }

    .post-card-title {
        font-size: 1.1rem;
    }

    .category-stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item {
        width: 100%;
        justify-content: center;
    }
}
