/* Outstanding Category Archive Page Styles */

/* Category Hero Section */
.category-hero {
    position: relative;
    background: linear-gradient(135deg, var(--category-color-light), var(--category-color-dark));
    padding: 100px 20px 80px;
    color: #fff;
    overflow: hidden;
}

.category-hero-bg {
    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 1000 1000"><defs><pattern id="categoryPattern" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/><circle cx="25" cy="25" r="1" fill="white" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="1000" height="1000" fill="url(%23categoryPattern)"/></svg>') repeat;
    opacity: 0.3;
}

.category-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.category-breadcrumb {
    margin-bottom: 30px;
    font-size: 14px;
    opacity: 0.9;
}

.category-breadcrumb a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.category-breadcrumb a:hover {
    opacity: 0.8;
}

.category-breadcrumb .separator {
    margin: 0 10px;
    opacity: 0.6;
}

.category-breadcrumb .current {
    opacity: 0.7;
}

.category-header {
    text-align: center;
}

.category-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.category-icon i {
    font-size: 36px;
    color: #fff;
}

.category-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.category-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 16px;
    opacity: 0.9;
}

.category-separator {
    opacity: 0.6;
}

.category-description {
    font-size: 18px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Filter and Sort Controls */
.category-controls {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.controls-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active {
    background: var(--category-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.view-btn:hover:not(.active) {
    background: #e9ecef;
    color: #333;
}

.results-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 250px;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--category-color);
    box-shadow: 0 0 0 3px var(--category-color-light);
}

.search-box button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: var(--category-color);
    color: #fff;
}

.sort-dropdown select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    min-width: 150px;
}

.sort-dropdown select:focus {
    border-color: var(--category-color);
}

.filter-dropdown {
    position: relative;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-toggle:hover {
    background: #e9ecef;
}

.filter-toggle.active {
    background: var(--category-color);
    color: #fff;
    border-color: var(--category-color);
}

.filter-panel {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 250px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.filter-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.filter-group select:focus {
    border-color: var(--category-color);
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.filter-actions button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#apply-filters {
    background: var(--category-color);
    color: #fff;
}

#apply-filters:hover {
    background: var(--category-color-dark);
}

#clear-filters {
    background: #f8f9fa;
    color: #666;
}

#clear-filters:hover {
    background: #e9ecef;
}

/* Posts Grid/List */
.category-posts {
    padding: 40px 20px;
    background: #f8f9fa;
    min-height: 600px;
}

.posts-container {
    max-width: 1200px;
    margin: 0 auto;
}

.posts-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 60px;
}

.posts-grid.view-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.posts-grid.view-list {
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Post Cards - Grid View */
.post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.post-card:hover .post-overlay {
    opacity: 1;
}

.post-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.post-image img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
}

.post-image img[loading="lazy"].loaded {
    opacity: 1;
}

/* Image loading placeholder */
.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.post-image img.loaded + .post-image::before {
    display: none;
}

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

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

/* Post Placeholder Image */
.post-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-placeholder-image:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #6c757d;
}

.placeholder-icon {
    margin-bottom: 10px;
    opacity: 0.6;
}

.post-placeholder-image p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Post Overlay */
.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.overlay-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.overlay-content svg {
    transition: transform 0.3s ease;
}

.post-card:hover .overlay-content svg {
    transform: translateX(5px);
}

.post-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--category-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-read-time {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.post-content {
    padding: 25px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.meta-separator {
    opacity: 0.5;
}

.post-author a {
    color: var(--category-color);
    text-decoration: none;
    font-weight: 600;
}

.post-author a:hover {
    text-decoration: underline;
}

.post-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
}

.post-title a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--category-color);
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.read-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--category-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    gap: 12px;
    color: var(--category-color-dark);
}

.post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.post-tag {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: var(--category-color);
    color: #fff;
}

/* List View Styles */
.posts-grid.view-list .post-card {
    display: flex;
    border-radius: 12px;
    height: 200px;
}

.posts-grid.view-list .post-image {
    width: 300px;
    height: auto;
    flex-shrink: 0;
}

.posts-grid.view-list .post-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.posts-grid.view-list .post-overlay {
    border-radius: 12px 0 0 12px;
}

.posts-grid.view-list .post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.posts-grid.view-list .post-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.posts-grid.view-list .post-excerpt {
    flex: 1;
    margin-bottom: 15px;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.no-posts-icon {
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-posts-found h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.no-posts-found p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.primary-btn {
    background: var(--category-color);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--category-color-dark);
    transform: translateY(-2px);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid var(--category-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Pagination */
.category-pagination {
    background: #fff;
    padding: 40px 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.pagination-container .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-container a,
.pagination-container span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    justify-content: center;
}

.pagination-container a:hover {
    background: var(--category-color);
    color: #fff;
    border-color: var(--category-color);
    transform: translateY(-2px);
}

.pagination-container .current {
    background: var(--category-color);
    color: #fff;
    border-color: var(--category-color);
}

.load-more-btn {
    background: var(--category-color);
    color: #fff;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.load-more-btn:hover {
    background: var(--category-color-dark);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Related Categories */
.related-categories {
    background: #fff;
    padding: 60px 20px;
    border-top: 1px solid #e9ecef;
}

.related-container {
    max-width: 1200px;
    margin: 0 auto;
}

.related-categories h3 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
    color: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.related-category-card {
    background: #f8f9fa;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.related-category-card:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--category-color-light);
}

.related-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
}

.related-category-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.related-category-card p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* No Related Categories */
.no-related-categories {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

.no-related-icon {
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-related-categories h4 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.no-related-categories p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.browse-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--category-color);
    color: #fff;
    padding: 15px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.browse-all-btn:hover {
    background: var(--category-color-dark);
    transform: translateY(-2px);
    gap: 15px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .category-hero {
        padding: 80px 20px 60px;
    }
    
    .category-title {
        font-size: clamp(28px, 6vw, 48px);
    }
    
    .controls-container {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .controls-left,
    .controls-right {
        justify-content: center;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .posts-grid.view-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 60px 15px 40px;
    }
    
    .category-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .controls-container {
        padding: 15px;
    }
    
    .controls-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .posts-grid.view-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .posts-grid.view-list .post-card {
        flex-direction: column;
        height: auto;
    }
    
    .posts-grid.view-list .post-image {
        width: 100%;
        height: 200px;
    }
    
    .posts-grid.view-list .post-overlay {
        border-radius: 16px 16px 0 0;
    }
    
    .posts-grid.view-list .post-placeholder-image {
        border-radius: 16px 16px 0 0;
    }
    
    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border: none;
        border-radius: 0;
        padding: 20px;
        min-width: auto;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .category-hero {
        padding: 40px 15px 30px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .category-icon i {
        font-size: 28px;
    }
    
    .category-posts {
        padding: 30px 15px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}