:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --accent: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
}

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

/* Header */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0; /* Reduced by 25% */
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-toggle .material-symbols-outlined {
    font-size: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    padding: 5px;
    border-radius: 8px;
}

nav a:hover, nav a.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem auto 0;
}

/* News Column */
.news-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    animation: slideInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    cursor: pointer;
}



.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.news-tag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom-left-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 4px;
}

.flag-icon {
    width: 18px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tag-pt { background-color: #10b98120; color: #10b981; }
.tag-en { background-color: #3b82f620; color: #3b82f6; }

.news-source {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.news-item h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.news-item h2 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.news-item h2 a:hover {
    color: var(--primary);
}

.news-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.news-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}


/* Sidebar removed */


.widget h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
}

.newsletter-widget {
    background: linear-gradient(135deg, var(--card-bg), var(--bg-color));
    position: relative;
    overflow: hidden;
}

.newsletter-widget::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    z-index: 0;
}

.newsletter-widget h3, .newsletter-widget p, .newsletter-widget form {
    position: relative;
    z-index: 1;
}

.newsletter-widget button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
}

.newsletter-widget button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}


/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay staggered animation for items */
.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }
.news-item:nth-child(n+4) { animation-delay: 0.4s; }

/* Tag cloud refinement */
.tag {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tag:hover {
    transform: scale(1.1);
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin: 0;
}

.btn-load-more {
    padding: 0.75rem 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-load-more:active {
    transform: translateY(0);
}

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

.tag {
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

.news-status {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary);
    line-height: 1;
    display: flex;
    align-items: center;
    min-height: 20px;
}

#news-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
}

/* Sidebar as a bottom section removed */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Featured Section */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.featured-item {
    grid-column: span 1;
}

.featured-item:first-child {
    grid-column: span 2;
}

.featured-item .news-item {
    height: 100%;
    border: 2px solid transparent;
}

.featured-item:first-child .news-item {
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
                linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
}

.featured-item:first-child h2 {
    font-size: 1.75rem;
}

/* Filter Section */
.filter-section {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.feed-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background-color: #334155;
    border-color: #475569;
    color: #f8fafc;
}

.filter-btn.active {
    background-color: #3b82f6;
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}

.filter-btn-br {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, #2a3a52 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-source { height: 14px; width: 35%; }
.skeleton-title { height: 22px; width: 85%; }
.skeleton-meta { height: 14px; width: 40%; }
.skeleton-excerpt { height: 54px; width: 100%; border-radius: 6px; }

/* Footer */
.main-footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

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

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

/* Header Nav (about/contact pages) */
.header-nav {
    display: flex;
    gap: 1rem;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.header-nav a:hover {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.header-nav a.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.15);
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-back:hover {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.btn-back .material-symbols-outlined {
    font-size: 20px;
}

/* Page Content (about/contact) */
.page-content {
    padding: 3rem 20px;
    max-width: 900px;
}

.page-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.page-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-bottom: 1.25rem;
}

.page-hero-icon .material-symbols-outlined {
    font-size: 32px;
    color: #fff;
}

.page-hero h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* About Cards */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.about-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.4s;
}

.about-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.about-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    margin-bottom: 1rem;
}

.about-card-icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--primary);
}

.about-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.about-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Contact Form */
.contact-section {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #475569;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit .material-symbols-outlined {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .header-content {
        padding: 0.8rem 1rem;
    }

    .menu-toggle {
        display: block;
    }
    
    .filter-section {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: #0f172a;
        flex-direction: column;
        padding: 6rem 1.5rem 2rem;
        gap: 1.5rem;
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
        align-items: flex-start;
        margin: 0;
    }

    .filter-section.active {
        right: 0;
    }

    .feed-filters {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    #news-container {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 1rem;
    }

    .about-section {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 600px) {
    #news-container {
        grid-template-columns: 1fr;
    }

    .page-hero h2 {
        font-size: 1.75rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}
