/**
 * Archive Page Styles
 */

/* Archive Header */
.archive-header,
.taxonomy-header {
    background: linear-gradient(135deg, #6b4ac5 0%, #8b6ae0 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.archive-header-content,
.taxonomy-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.archive-title,
.taxonomy-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.archive-description,
.taxonomy-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.archive-stats,
.taxonomy-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.archive-stats .stat-item,
.taxonomy-stats .stat-item {
    font-size: 1rem;
    opacity: 0.9;
}

.archive-stats .stat-item strong,
.taxonomy-stats .stat-item strong {
    font-size: 1.5rem;
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Category Icon */
.category-icon-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.category-icon-large svg {
    color: white;
}

/* Filters Section */
.archive-filters,
.taxonomy-filters {
    background: white;
    padding: 30px 0;
    border-bottom: 2px solid var(--color-background);
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-wrapper {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group.search-box-wrapper {
    flex: 2;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input.typing {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(107, 74, 197, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(107, 74, 197, 0.1);
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(107, 74, 197, 0.1);
}

.view-toggle {
    flex: 0;
    min-width: auto;
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    transition: all 0.3s ease;
}

.view-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.view-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Tools Grid */
.archive-tools-section {
    padding: 60px 0;
}

#tools-container {
    min-height: 400px;
    position: relative;
}

#tools-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tools-container.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
    z-index: 11;
}

/* Tool Card Base Styles */
.tool-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-image {
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--gray-light);
    margin: 0 auto;
}

.tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-card:hover .tool-image img {
    transform: scale(1.05);
}

.tool-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.tool-title a {
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.tool-title a:hover {
    color: var(--primary);
}

/* List View */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tools-list .tool-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 24px;
}

.tools-list .tool-card .tool-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    padding-bottom: 0;
}

.tools-list .tool-card .tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tools-list .tool-card .tool-title {
    font-size: 1.5rem;
}

.tools-list .tool-card .tool-meta {
    order: -1;
}

.tools-list .tool-card .tool-actions {
    margin-top: 0;
}

/* No Results */
.no-results,
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.no-results h2 {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 12px;
}

.no-results p,
.no-results-message {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

/* Pagination */
.archive-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.archive-pagination .page-numbers {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.archive-pagination .page-numbers li {
    display: inline-block;
}

.archive-pagination .page-numbers a,
.archive-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.archive-pagination .page-numbers a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.archive-pagination .page-numbers .current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.archive-pagination .page-numbers .dots {
    border: none;
    pointer-events: none;
}

/* Categories Section */
.categories-section {
    background: var(--color-background);
    padding: 80px 0;
}

.categories-section .section-title {
    text-align: center;
    margin-bottom: 50px;
}

.categories-section .section-title h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text);
}

.categories-section .section-title p {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .archive-title {
        font-size: 2rem;
    }
    
    .filters-wrapper {
        flex-wrap: wrap;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 8px);
        min-width: auto;
    }
    
    .filter-group.search-box-wrapper {
        flex: 1 1 100%;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .archive-header {
        padding: 40px 0;
    }
    
    .archive-title {
        font-size: 1.75rem;
    }
    
    .archive-description {
        font-size: 1rem;
    }
    
    .archive-stats {
        gap: 30px;
    }
    
    .archive-filters {
        position: static;
    }
    
    .filters-wrapper {
        flex-direction: column;
    }
    
    .filter-group {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .view-toggle {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    .tools-list .tool-card {
        flex-direction: column;
        text-align: center;
    }
    
    .tools-list .tool-card .tool-thumbnail {
        width: 150px;
        height: 150px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .archive-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .archive-pagination .page-numbers a,
    .archive-pagination .page-numbers span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

/* ============================================
   Taxonomy Pagination Styles
   ============================================ */
.taxonomy-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.taxonomy-pagination .page-numbers {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.taxonomy-pagination .page-numbers li {
    display: inline-block;
}

.taxonomy-pagination .page-numbers a,
.taxonomy-pagination .page-numbers li > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.taxonomy-pagination .page-numbers a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(107, 74, 197, 0.05);
    transform: translateY(-2px);
}

.taxonomy-pagination .page-numbers .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.taxonomy-pagination .page-numbers .dots {
    border: none;
    pointer-events: none;
    background: transparent;
    color: var(--gray-medium);
}

/* .taxonomy-pagination .page-numbers .prev,
.taxonomy-pagination .page-numbers .next {
    font-weight: 600;
    padding: 0 24px;
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(107, 74, 197, 0.2);
} */

.taxonomy-pagination .page-numbers .prev:hover,
.taxonomy-pagination .page-numbers .next:hover {
    background: #5a3ba8;
    border-color: #5a3ba8;
    color: white;
    box-shadow: 0 4px 12px rgba(107, 74, 197, 0.3);
    transform: translateY(-2px);
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .taxonomy-pagination {
        margin-top: 40px;
    }
    
    .taxonomy-pagination .page-numbers {
        gap: 6px;
    }
    
    .taxonomy-pagination .page-numbers a,
    .taxonomy-pagination .page-numbers span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
    
    .taxonomy-pagination .page-numbers .prev,
    .taxonomy-pagination .page-numbers .next {
        padding: 0 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .taxonomy-pagination .page-numbers a,
    .taxonomy-pagination .page-numbers span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.85rem;
    }
    
    /* Hide some page numbers on very small screens */
    .taxonomy-pagination .page-numbers li:not(.prev):not(.next):not(.current) {
        display: none;
    }
    
    .taxonomy-pagination .page-numbers li.current,
    .taxonomy-pagination .page-numbers li.prev,
    .taxonomy-pagination .page-numbers li.next {
        display: inline-block;
    }
}
