/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #e8f2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-count {
    font-size: 0.9rem;
    font-weight: 400;
    color: #718096;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

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

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.article-content {
    padding: 1.2rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: #718096;
}

.article-source {
    font-weight: 600;
    color: #4a5568;
    background: #edf2f7;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
}

.article-title {
    margin-bottom: 0.8rem;
}

.article-title a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #667eea;
}

.article-description {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-category {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #764ba2;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-ad {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.sidebar-ad h4 {
    margin-bottom: 1rem;
    color: #718096;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending {
    background:white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.trending h3 {
    color: #6A5ACD;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.trending-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.trending-item a:hover {
    color: #667eea;
}

.trending-item small {
    color: #718096;
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
}

/* Ads */
.ad-banner {
    margin: 2rem 0;
    text-align: center;
}

.inline-ad {
    grid-column: 1 / -1;
    margin: 1rem 0;
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination-btn {
    background: #667eea;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.pagination-info {
    color: #718096;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 1rem;
    text-align: center;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
        width: 100%;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo-title {
        font-size: 1.3rem;
    }
    
    .logo-tagline {
        font-size: 0.65rem;
    }
    
    .logo-icon {
        font-size: 1.3rem;
        width: 28px;
        height: 28px;
    }
    
    .logo-link {
        gap: 8px;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .article-content {
        padding: 1rem;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e2e8f0;
    }
    
    .article-card,
    .sidebar-ad,
    .trending {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .article-title a {
        color: #e2e8f0;
    }
    
    .article-description {
        color: #a0aec0;
    }
    
    .inline-ad {
        background: #2d3748;
    }
    .trending h3,
    .sidebar-ad h4 {
        color: #e2e8f0 !important;
    }

}
