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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --featured-color: #fbbf24;
    --heart-color: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header */
.header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

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

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

/* Article Card */
.article-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--featured-color);
    color: #1f2937;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.featured-badge i {
    font-size: 0.7rem;
}

.article-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 3rem;
}

.article-meta-top {
    padding: 1rem 1.25rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.meta-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.meta-item i {
    font-size: 0.875rem;
}

.meta-item i.fa-heart {
    color: var(--heart-color);
}

.article-content {
    padding: 0 1.25rem 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
}

.article-description {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-footer {
    margin-bottom: 1rem;
}

.article-author-date {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-author-date span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-author-date i {
    font-size: 0.875rem;
}

.read-more-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background-color 0.2s;
    text-align: center;
    margin-top: auto;
}

.read-more-btn:hover {
    background: var(--primary-dark);
}

/* Article Detail Page */
.article-detail {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.article-header {
    position: relative;
}

.article-image-large {
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.article-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-meta-top {
    padding: 1.5rem 2rem 1rem;
}

.article-title-large {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 2rem 1rem;
    line-height: 1.3;
    color: var(--text-color);
}

.article-author-date {
    margin: 0 2rem 1.5rem;
}

.article-tags {
    margin: 0 2rem 1.5rem;
}

.article-body {
    padding: 0 2rem 2rem;
}

.article-content-full {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
}

.article-footer-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.back-btn {
    display: inline-block;
    background: var(--card-bg);
    color: var(--primary-color);
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

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

/* No Articles */
.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-light);
}

/* Page Title */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
}

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

.category-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.category-count {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.view-category-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.view-category-btn:hover {
    background: var(--primary-dark);
}

.category-header {
    margin-bottom: 2rem;
}

.category-description {
    color: var(--text-light);
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .article-title-large {
        font-size: 1.5rem;
        margin: 0 1.5rem 1rem;
    }

    .article-meta-top,
    .article-author-date,
    .article-tags,
    .article-body,
    .article-footer-actions {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .article-image-large {
        height: 250px;
    }

    .nav {
        gap: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

