/**
 * Enhanced Archive Styles
 * Professional UI/UX for Blog Archive Pages
 */

/* ==========================================================================
   Archive Hero Section
   ========================================================================== */

.archive-hero {
    background: var(--bg-card, #FEFDFB);
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 15px;
    padding: 60px 40px;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.archive-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-primary, #212529);
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary, #212529);
}

.archive-label {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--text-secondary, #6c757d);
}

.archive-description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
    color: var(--text-secondary, #6c757d);
}

.archive-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1rem;
}

.post-count {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
    padding: 8px 20px;
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 25px;
    font-weight: 600;
}

/* Light mode post-count */
[data-theme="light"] .post-count {
    background: #f8f9fa;
    color: #495057;
    border-color: #D0CCC6;
}

/* Dark mode post-count */
[data-theme="dark"] .post-count {
    background: #334155;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Author Archive Header */
.author-archive-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.author-archive-header img {
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    width: 120px;
    height: 120px;
}

.author-archive-header .author-info {
    text-align: left;
}

.author-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.author-stats span,
.author-stats a {
    background: rgba(255,255,255,0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.author-stats a:hover {
    background: rgba(255,255,255,0.3);
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.filter-bar {
    background: var(--bg-card, #FEFDFB);
    padding: 20px;
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.filter-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.view-toggle button {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.view-toggle button.active {
    background: #fff;
    color: #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    font-weight: 500;
    color: #495057;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
}

.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sub-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 500;
    color: #495057;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background: #007bff;
    color: #fff;
}

.filter-tag .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* ==========================================================================
   Posts Grid/List Layout
   ========================================================================== */

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

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

.posts-container.list-view {
    grid-template-columns: 1fr;
}

/* Post Card */
.post-card.enhanced {
    background: var(--bg-card, #FEFDFB);
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    transition: all 0.3s ease;
    height: 100%;
}

.post-card.enhanced:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg, 0 10px 20px rgba(0, 0, 0, 0.1));
    border-color: var(--primary, #00D9FF);
}

.post-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-thumbnail-link {
    display: block;
    position: relative;
    overflow: hidden;
    height: 220px;
}

.post-thumbnail {
    position: relative;
    height: 100%;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.read-more-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.2rem;
}

.post-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-categories {
    display: flex;
    gap: 8px;
}

.category-badge {
    padding: 4px 10px;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
    text-decoration: none;
    border: 1px solid var(--border-color, #D0CCC6);
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.category-badge:hover {
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    color: #0A0F1C;
    border-color: transparent;
}

.reading-time {
    color: #6c757d;
    font-size: 0.9rem;
}

.post-title {
    margin: 0 0 15px;
    font-size: 1.4rem;
    line-height: 1.3;
}

.post-title a {
    color: var(--text-primary, #212529);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #007bff;
}

.post-excerpt {
    color: var(--text-secondary, #6c757d);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.post-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author img {
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

.author-name a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
}

.author-name a:hover {
    color: #007bff;
}

.post-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.3s ease;
}

.read-more-link:hover {
    gap: 12px;
}

/* List View Styles */
.posts-container.list-view .post-card-inner {
    flex-direction: row;
}

.posts-container.list-view .post-thumbnail-link {
    width: 300px;
    height: 200px;
    flex-shrink: 0;
}

.posts-container.list-view .post-content {
    flex: 1;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.pagination.enhanced .page-numbers {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination.enhanced li {
    display: inline-block;
}

.pagination.enhanced a,
.pagination.enhanced span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    color: #495057;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination.enhanced a:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination.enhanced .current {
    background: linear-gradient(135deg, #00D9FF 0%, #00F5A0 100%);
    color: #0A0F1C;
    border-color: transparent;
    font-weight: 600;
}

.pagination.enhanced .dots {
    border: none;
    background: transparent;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ==========================================================================
   No Posts Found
   ========================================================================== */

.no-posts-found {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.no-posts-icon {
    font-size: 5rem;
    color: #dee2e6;
    margin-bottom: 30px;
}

.no-posts-found h2 {
    font-size: 2rem;
    color: #212529;
    margin-bottom: 15px;
}

.no-posts-found p {
    color: #6c757d;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 30px;
}

.no-posts-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: #fff;
}

.search-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.search-form-wrapper h3 {
    margin-bottom: 20px;
    color: #212529;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-field {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 1rem;
}

.search-submit {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.search-submit:hover {
    transform: scale(1.05);
}

.popular-categories {
    margin-top: 50px;
}

.popular-categories h3 {
    margin-bottom: 25px;
    color: #212529;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-card:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-3px);
}

.category-card:hover .category-name,
.category-card:hover .category-count {
    color: #fff;
}

.category-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.category-count {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ==========================================================================
   Archive Sidebar
   ========================================================================== */

.archive-sidebar {
    padding-left: 40px;
}

.archive-sidebar .widget {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.archive-sidebar .widget-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #212529;
    position: relative;
    padding-bottom: 10px;
}

.archive-sidebar .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* ==========================================================================
   Load More Button
   ========================================================================== */

.load-more-wrapper {
    text-align: center;
    margin: 50px 0;
}

.btn-load-more {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .content-wrapper {
        display: block;
    }

    .archive-sidebar {
        padding-left: 0;
        margin-top: 50px;
    }
}

@media (max-width: 768px) {
    .archive-hero {
        padding: 60px 0;
    }

    .archive-title {
        font-size: 2rem;
    }

    .author-archive-header {
        flex-direction: column;
        text-align: center;
    }

    .author-archive-header .author-info {
        text-align: center;
    }

    .filter-options {
        flex-direction: column;
        gap: 15px;
    }

    .posts-container.grid-view {
        grid-template-columns: 1fr;
    }

    .posts-container.list-view .post-card-inner {
        flex-direction: column;
    }

    .posts-container.list-view .post-thumbnail-link {
        width: 100%;
        height: 220px;
    }

    .pagination-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .no-posts-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .archive-title {
        font-size: 1.5rem;
    }

    .filter-bar {
        padding: 15px;
    }

    .post-content {
        padding: 20px;
    }

    .post-title {
        font-size: 1.2rem;
    }

    .pagination.enhanced a,
    .pagination.enhanced span {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: 0.9rem;
    }
}