:root {
        /* Light theme */
        --bg-primary: #ffffff;
        --bg-secondary: #f8fafc;
        --bg-tertiary: #f1f5f9;
        --text-primary: #1e293b;
        --text-secondary: #475569;
        --text-muted: #64748b;
        --border-color: #e2e8f0;
        --border-hover: #cbd5e1;
        --accent-primary: #3b82f6;
        --accent-hover: #2563eb;
        --success: #10b981;
        --warning: #f59e0b;
        --danger: #ef4444;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    }

    [data-theme="dark"] {
        /* Dark theme */
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --border-hover: #475569;
        --accent-primary: #60a5fa;
        --accent-hover: #3b82f6;
        --success: #34d399;
        --warning: #fbbf24;
        --danger: #f87171;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    }

    /* Apply theme to entire page */
    html[data-theme="<?= $currentTheme ?>"] {
        color-scheme: <?= $isDark ? 'dark' : 'light' ?>;
    }

    html[data-theme="<?= $currentTheme ?>"] body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    /* Use default header from main.css - no overrides */

    .logo {
        color: var(--text-primary) !important;
    }

    .nav-links a {
        color: var(--text-primary) !important;
    }

    .nav-links a:hover {
        background: var(--bg-tertiary) !important;
        color: var(--accent-primary) !important;
    }

    .search-input {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    .search-input:focus {
        border-color: var(--accent-primary) !important;
    }

    .btn-outline {
        color: var(--accent-primary) !important;
        border-color: var(--accent-primary) !important;
        background: transparent !important;
    }

    .btn-outline:hover {
        background: var(--accent-primary) !important;
        color: white !important;
    }

    .btn-solid {
        background: var(--accent-primary) !important;
        color: white !important;
    }

    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
    }

    /* Theme toggle button styles */
    .theme-toggle {
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.5rem;
        cursor: pointer;
        font-size: 1.2rem;
        transition: all 0.3s ease;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1001;
    }

    .theme-toggle:hover {
        background: var(--accent-primary);
        color: white;
        transform: scale(1.05);
    }



    /* Main content */
    .main-content {
        padding: 2rem 0;
    }

    .news-grid {
        display: grid;
        gap: 2rem;
    }

    /* News item styles */
    .news-item {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        overflow: hidden;
        transition: all 0.3s ease;
        position: relative;
    }

    .news-item:hover {
        border-color: var(--border-hover);
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }

    .news-content {
        padding: 1.5rem;
    }

    .news-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .category-badge {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.25rem 0.75rem;
        border-radius: 15px;
        font-size: 0.8rem;
        font-weight: 500;
        color: white;
    }

    .news-date {
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .news-title {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }

    .news-title a {
        color: var(--text-primary);
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .news-title a:hover {
        color: var(--accent-primary);
    }

    .news-summary {
        color: var(--text-secondary);
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .news-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .news-stats {
        display: flex;
        gap: 1rem;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .read-more {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 500;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .read-more:hover {
        background: var(--accent-primary);
        color: white;
    }

    /* Pagination */
    .pagination {
        margin-top: 3rem;
        display: flex;
        justify-content: center;
        gap: 0.5rem;
    }

    .pagination a, .pagination span {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .pagination a {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    .pagination a:hover {
        background: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
    }

    .pagination .current {
        background: var(--accent-primary);
        color: white;
        border: 1px solid var(--accent-primary);
    }

    /* Empty state */
    .empty-state {
        text-align: center;
        padding: 4rem 2rem;
        color: var(--text-muted);
    }

    .empty-state-icon {
        font-size: 4rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }


    /* Responsive */
    @media (max-width: 768px) {
        .container {
            padding: 0 0.5rem;
            max-width: 100vw;
            overflow-x: hidden;
        }

        .news-meta {
            flex-direction: column;
            align-items: flex-start;
        }

        .news-footer {
            flex-direction: column;
            gap: 1rem;
            align-items: flex-start;
        }

        .pagination {
            flex-wrap: wrap;
        }

        .theme-toggle {
            top: 0.5rem;
            right: 4rem;
        }
    }

    /* Animations */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .news-item {
        animation: fadeIn 0.5s ease-out;
    }

    .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(4) { animation-delay: 0.4s; }
    
    /* Advertisement responsive styles */
    .ad-space {
        max-width: 100%;
        overflow: hidden;
        text-align: center;
        padding: 1rem;
        background: var(--bg-tertiary);
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    .ad-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    /* Mobile article collapsing functionality */
    .mobile-only {
        display: none;
    }
    
    .mobile-hidden {
        display: block;
    }
    
    .mobile-collapsible {
        cursor: default;
    }
    
    .expand-icon {
        color: var(--text-muted);
        transition: transform 0.3s ease;
        float: right;
        margin-left: 1rem;
    }
    
    .article-content {
        transition: max-height 0.3s ease, opacity 0.3s ease;
        overflow: hidden;
    }
    
    .article-content.collapsed {
        max-height: 0;
        opacity: 0;
        padding: 0;
        margin: 0;
    }
    
    /* Responsive ad containers */
    @media (max-width: 768px) {
        .ad-space {
            max-width: 100%;
            margin: 0.5rem 0;
            padding: 0.5rem;
        }
        
        /* Limit ad content width on mobile */
        .ad-space > * {
            max-width: 100%;
            box-sizing: border-box;
        }
        
        /* Force images in ads to be responsive */
        .ad-space img {
            max-width: 100% !important;
            height: auto !important;
        }
        
        /* Mobile article collapsing */
        .mobile-only {
            display: inline;
        }
        
        .mobile-hidden {
            display: none;
        }
        
        .mobile-collapsible {
            cursor: pointer;
        }
        
        .article-content.collapsed {
            max-height: 0;
            opacity: 0;
            padding: 0;
            margin: 0;
        }
        
        .news-title {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .news-title a {
            pointer-events: none;
            color: var(--text-primary);
            text-decoration: none;
        }
    }

    /* Hub Header Styles */
    .hub-header {
        margin-bottom: 2rem;
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .hub-title {
        font-size: 2.5rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
        text-align: center;
        line-height: 1.2;
    }

    @media (max-width: 768px) {
        .hub-title {
            font-size: 2rem;
        }
        
        .hub-header {
            padding: 1rem 0;
            margin-bottom: 1.5rem;
        }
    }
    
    <?php if (isset($adManager)): ?>
    <?= $adManager->getAdStyles() ?>
    <?php endif; ?>