/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a56db;
    --primary-dark: #1e429f;
    --secondary-color: #0e7490;
    --accent-color: #ea580c;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --success-color: #10b981;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.tagline {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1.25rem;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(rgba(26, 86, 219, 0.85), rgba(30, 66, 159, 0.9)),
                url('https://images.unsplash.com/photo-1504711434969-e33886168f5c?w=1600&q=80') center/cover;
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.3) 0%, rgba(30, 66, 159, 0.5) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.875rem;
    margin-bottom: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Trending Topics */
.trending-section {
    margin-bottom: 3rem;
}

.trending-topics {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.trending-topics::-webkit-scrollbar {
    height: 6px;
}

.trending-topics::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.trending-topics::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.trending-topic {
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.trending-topic:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.trending-topic .topic-name {
    font-weight: 600;
    color: var(--text-primary);
}

.trending-topic .topic-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Articles Grid */
.articles-section {
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.article-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transition: transform 0.3s ease;
    display: block;
}

.article-image[src=""] {
    display: none;
}

.article-content {
    padding: 1.75rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.article-category {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.25);
}

.article-date {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.article-title {
    font-size: 1.375rem;
    margin-bottom: 0.875rem;
    color: var(--text-primary);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    border-radius: 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-card:hover .tag {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border: none;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

#modal-body h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#modal-body .modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#modal-body .article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

#modal-body .article-body p {
    margin-bottom: 1rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.disclaimer {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-banner {
        padding: 3rem 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .nav {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}
