/* Knowledge Hub Specific Styles */

/* Article Text Visibility Enhancement */
.article-card h3 {
    color: #dc2626 !important; /* Red color */
    font-weight: 600 !important; /* Semi-bold, not extra bold */
    transition: color 0.3s ease !important;
}

.article-card h3:hover {
    color: #b91c1c !important; /* Darker red on hover */
}

.article-card p {
    color: #4b5563 !important; /* Medium gray instead of darkest */
    font-weight: 500 !important; /* Medium weight */
    font-size: 0.875rem !important; /* Small size (text-sm) */
    opacity: 1 !important; /* Full opacity */
}

/* Ensure hover effects work properly */
.article-card:hover h3 {
    color: #b91c1c !important; /* Dark red on card hover */
}

.article-card:hover p {
    color: #4b5563 !important; /* Stay medium gray on card hover */
}

/* Article Cards Responsive Grid */
#articles-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    #articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    #articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Article Card Animations */
.article-card {
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Format Badge Styles */
.format-badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Category Tag Styles */
.category-tag {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Filter Button Animations */
.category-filter-btn, .date-filter-btn {
    transition: all 0.2s ease;
}

.category-filter-btn:hover {
    transform: translateY(-1px);
}

.category-filter-btn.active {
    background: linear-gradient(135deg, #DC2626 0%, #9333EA 100%);
    box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.4);
}

/* Search Input Enhancements */
#knowledge-search {
    transition: all 0.2s ease;
}

#knowledge-search:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    border-color: #DC2626;
}

/* Pagination Styles */
.pagination-btn {
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    transform: translateY(-1px);
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Line Clamp Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    /* Adjust filter buttons for mobile */
    .category-filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .date-filter-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Stack content header elements on mobile */
    .content-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Adjust article card padding */
    .article-card .p-6 {
        padding: 1.25rem;
    }
    
    /* Smaller search input on mobile */
    #knowledge-search {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Tablet Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Adjust grid gap for tablets */
    #articles-grid {
        gap: 1.5rem;
    }
}

/* Large Screen Optimizations */
@media (min-width: 1280px) {
    /* Increase grid gap on large screens */
    #articles-grid {
        gap: 2.5rem;
    }
    
    /* Larger article cards on xl screens */
    .article-card img {
        height: 12rem;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .article-card {
        background: #1f2937;
        border: 1px solid #374151;
    }
    
    .article-card h3 {
        color: #f9fafb;
    }
    
    .article-card p {
        color: #d1d5db;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .category-filter-btn,
    .date-filter-btn,
    .pagination-btn {
        transition: none;
    }
    
    .article-card:hover {
        transform: none;
    }
    
    .animate-spin {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.category-filter-btn:focus,
.date-filter-btn:focus,
.pagination-btn:focus,
.article-link:focus {
    outline: 2px solid #DC2626;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .article-card {
        border: 2px solid #000;
    }
    
    .category-filter-btn.active {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .category-filter-btn,
    .date-filter-btn,
    .pagination-btn,
    #knowledge-search {
        display: none;
    }
    
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .article-card img {
        display: none;
    }
}