:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --accent-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #fff;
    color: #212529;
    padding-bottom: 2rem;
}

/* Header Styling */
.news-header {
    border-bottom: 1px solid var(--border-color);
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.logo span {
    color: var(--accent-color);
}

/* Mobile Menu - Updated for Hamburger */
.mobile-menu-btn {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

/* Navigation - Updated for mobile hamburger */
.category-nav {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.category-nav .nav-link {
    color: var(--secondary-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.category-nav .nav-link:hover,
.category-nav .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

/* Updated News Cards in Card Format - 4 Columns */
.news-card-container {
    margin-bottom: 1.5rem;
}

.news-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
    background-color: white;
    box-shadow: var(--card-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.news-source {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.news-source i {
    margin-right: 0.375rem;
    font-size: 0.75rem;
}

.news-headline {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 500;
    flex-grow: 1;
}

.news-headline a {
    color: #212529;
    text-decoration: none;
}

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

.news-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.news-time i {
    margin-right: 0.25rem;
    font-size: 0.7rem;
}

.news-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 0.75rem;
}

.badge-breaking {
    background-color: var(--accent-color);
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* Section Headers for News Rows */
.section-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.section-header .view-all {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
}

.section-header .view-all:hover {
    text-decoration: underline;
}

/* Advertisement - Updated for 300x300 on mobile */
.ad-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px dashed #adb5bd;
    border-radius: 8px;
    color: #6c757d;
    text-align: center;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Desktop ad size - CENTERED */
.ad-desktop {
    height: 250px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile ad size - 300x300 */
.ad-mobile {
    height: 300px;
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
}

/* View Toggle */
.view-toggle-btn {
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.view-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Mobile Navigation Menu - FIXED */
.mobile-categories {
    background-color: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: fixed;
    top: 73px; /* Height of header */
    left: 0;
    right: 0;
    z-index: 1020;
}

.mobile-categories.show {
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-categories .nav-link {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    background: white;
}

.mobile-categories .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
    font-weight: 500;
}

.mobile-categories .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
}

/* Footer Styles - 4 Columns */
.footer-column h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-links .country-flag {
    width: 20px;
    height: 15px;
    margin-right: 0.5rem;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .news-card {
        padding: 0.875rem;
    }

    .news-image {
        height: 100px;
    }

    /* Ensure mobile ads are 300x300 */
    .ad-mobile-container {
        display: flex;
        justify-content: center;
        margin: 1.5rem auto;
    }

    /* Hide desktop categories on mobile */
    .desktop-categories {
        display: none !important;
    }

    /* Section headers on mobile */
    .section-header {
        margin: 1.5rem 0 1rem 0;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    /* Footer adjustments for mobile */
    .footer-column {
        margin-bottom: 1.5rem;
    }

    /* Mobile menu positioning fix */
    .mobile-categories {
        top: 70px; /* Adjust based on header height */
    }
}

@media (min-width: 769px) {
    /* Hide mobile menu button on desktop */
    .mobile-menu-btn {
        display: none !important;
    }

    /* Show desktop categories on desktop */
    .desktop-categories {
        display: flex !important;
    }

    /* Hide mobile categories on desktop */
    .mobile-categories {
        display: none !important;
    }

    /* Center ads on desktop */
    .ad-desktop-container {
        display: flex;
        justify-content: center;
        margin: 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .news-card {
        padding: 0.75rem;
    }

    .news-headline {
        font-size: 0.9rem;
    }

    .news-image {
        height: 90px;
    }

    .logo {
        font-size: 1.5rem;
    }

    /* Mobile menu positioning for smaller screens */
    .mobile-categories {
        top: 65px;
    }
}

/* Custom spacing */
.content-spacing {
    margin-top: 1.5rem;
}

/* Body overflow handling for mobile menu */
body.menu-open {
    overflow: hidden;
}
