/* News.css - Stylesheet for the news page */

/* News Container */
.news-container {
    padding: 2rem 0;
}

/* News Header */
.news-header {
    margin-bottom: 2rem;
    text-align: center;
}

.news-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* News Categories */
.news-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 30px;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background-color: var(--primary-color-light);
    color: white;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* News Content */
.news-content {
    max-width: 1200px;
    margin: 0 auto;
}

.news-category-content {
    display: none;
}

.news-category-content.active {
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* News List */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* News Card */
.news-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.news-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.news-card-content {
    padding: 1.5rem;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: var(--text-color);
}

.news-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.news-card-source {
    display: flex;
    align-items: center;
}

.news-card-source img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    border-radius: 50%;
}

.news-card-date {
    display: flex;
    align-items: center;
}

.news-card-date i {
    margin-right: 5px;
}

.news-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .news-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .news-header h2 {
        font-size: 2rem;
    }
    
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .news-list {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .news-categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        justify-content: flex-start;
    }
    
    .category-btn {
        white-space: nowrap;
    }
}

/* Dark Mode Adjustments */
.dark-mode .news-card {
    background-color: var(--dark-bg-secondary);
}

.dark-mode .category-btn {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text-color);
}

.dark-mode .category-btn:hover {
    background-color: var(--primary-color-light);
    color: white;
}

.dark-mode .category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.dark-mode .news-card-title {
    color: var(--dark-text-color);
}

.dark-mode .news-card-description {
    color: var(--dark-text-secondary);
}

.dark-mode .news-card-meta {
    color: var(--dark-text-tertiary);
}