/* catalog.css - Catalog page specific styles with Recommended Font Sizes */

/* Ensure header stays sticky */
#header,
#header .header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, #007a2d 100%);
    color: var(--white);
    padding: 3rem 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.page-header h1 {
    font-size: 46px; /* Recommended: 46px - matches all page headers */
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 0.8s;
}

.page-header p {
    font-size: 17px; /* Recommended: 17px */
    animation: fadeInUp 1s;
    line-height: 1.6;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 1.2s;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
}

.stat-item .stat-label {
    font-size: 16px; /* Recommended: 16px */
    color: var(--white);
}

/* Search Section */
.search-section {
    background: var(--white);
    padding: 2rem;
    margin: -2rem 0 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 16px; /* Recommended: 16px */
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 57, 0.1);
}

.search-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 16px; /* Recommended: 16px */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #007a2d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px; /* Recommended: 16px */
    font-weight: 500;
}

.filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

/* Ensure footer is not affected by grid layout */
.footer {
    display: block !important;
}

.footer .container {
    display: block !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer .footer-content {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Active Filters Indicator */
.active-filters-bar {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px var(--shadow);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-filters-text {
    font-size: 16px; /* Recommended: 16px */
    color: #666;
    font-weight: 600;
}

.active-filters-text strong {
    color: var(--primary);
}

.clear-all-link {
    color: var(--primary);
    font-size: 16px; /* Recommended: 16px */
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.clear-all-link:hover {
    color: #007a2d;
}

.filter-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px var(--shadow);
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.filter-section:hover {
    box-shadow: 0 5px 15px var(--shadow);
}

.filter-section h3 {
    font-size: 16px; /* Recommended: 16px */
    margin-bottom: 1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
}

.filter-option:hover {
    background: rgba(0, 150, 57, 0.05);
}

.filter-option.active {
    background: rgba(0, 150, 57, 0.06);
    color: var(--primary);
    font-weight: 500;
}

.filter-option input[type="checkbox"] {
    display: none;
}

.filter-option label {
    flex: 1;
    cursor: pointer;
    font-size: 16px; /* Recommended: 16px */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-count {
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.filter-option.active .filter-count {
    color: var(--primary);
    font-weight: 600;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info {
    font-size: 17px; /* Recommended: 17px */
    color: #666;
}

.results-info strong {
    color: var(--primary);
    font-size: 19px;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sort-select {
    padding: 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px; /* Recommended: 16px */
    transition: all 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.6rem 0.8rem;
    border: 2px solid #e0e0e0;
    background: var(--white);
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.view-btn:hover,
.view-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

/* Datasets Grid */
.datasets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.datasets-grid.list-view .dataset-card {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* Dataset Card */
.dataset-card {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.dataset-card:hover {
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dataset-title {
    font-size: 19px; /* Recommended: 19px */
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.dataset-title:hover {
    color: #007a2d;
    text-decoration: underline;
}

/* Badges */
.dataset-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.format {
    background: var(--primary);
    color: var(--white);
}

/* Dataset Meta */
.dataset-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 16px; /* Recommended: 16px */
    color: #666;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Dataset Description */
.dataset-description {
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 16px; /* Recommended: 16px */
}

/* Dataset Tags */
.dataset-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.3rem 0.8rem;
    background: var(--light);
    border-radius: 15px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Dataset Actions */
.dataset-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.btn {
    width: 100%;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 16px; /* Recommended: 16px */
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: #007a2d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 2rem 0;
    animation: fadeIn 0.5s;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.empty-suggestions {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: inline-block;
    text-align: left;
}

.empty-suggestions li {
    padding: 0.5rem 0;
    color: #495057;
    font-size: 1rem;
}

.empty-suggestions li::before {
    content: "→ ";
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

.btn-reset {
    padding: 0.9rem 2rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.btn-reset:hover {
    background: #007a2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 57, 0.3);
}

.btn-reset:active {
    transform: translateY(0);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.page-btn {
    padding: 0.7rem 1.2rem;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 16px; /* Recommended: 16px */
}

.page-btn:hover,
.page-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
    
    .active-filters-bar {
        position: sticky;
        top: 80px;
        z-index: 100;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 28px;
    }

    .search-bar {
        flex-direction: column;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .datasets-grid.list-view .dataset-card {
        grid-template-columns: 1fr;
    }

    .dataset-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.empty-state .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}