:root {
    --nl-bg: linear-gradient(to bottom, #f0f4f8 0%, #e8eef5 100%);
    --nl-card-bg: #FFFFFF;
    --nl-header-bg: linear-gradient(135deg, var(--base-color) 0%, var(--secondary-color) 100%);
    --nl-board-header: #4f46e5;
    --nl-primary-green: #10b981;
    --nl-primary-hover: #ef4444;
    --nl-link-blue: #2563eb;
    --nl-link-visited: #7c3aed;
    --nl-text-main: #1e293b;
    --nl-text-muted: #64748b;
    --nl-border: #e2e8f0;
    --nl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --nl-transition: all 0.2s ease;
}

body {
    background: linear-gradient(to bottom, #f0f4f8 0%, #e8eef5 100%);
    background-attachment: fixed;
    color: var(--nl-text-main);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: normal;
}

a {
    color: var(--nl-link-blue);
    text-decoration: none;
}

a:visited {
    color: var(--nl-link-visited);
}

a:hover {
    color: var(--nl-primary-hover);
    text-decoration: underline;
}

.nl-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 4px;
    /* Minimal padding */
}

/* Header / Banner */
.nl-banner {
    text-align: center;
    padding: 20px;
    background: var(--nl-header-bg);
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: var(--nl-shadow);
}

.nl-logo {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin: 5px 0;
    text-decoration: none !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nl-stats {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    font-size: 12px;
    text-align: left;
    border-radius: 8px;
    margin-top: 10px;
    color: #1e293b;
}

.nl-stats b {
    color: #000;
}

/* Cards (Sections) */
.nl-card {
    background: var(--nl-card-bg);
    border: 1px solid var(--nl-border);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: var(--nl-shadow);
    transition: var(--nl-transition);
}

.nl-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nl-card-header {
    background: linear-gradient(135deg, var(--base-color) 0%, var(--secondary-color) 100%);
    padding: 8px 12px;
    border-bottom: 1px solid var(--nl-border);
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    text-align: left;
    border-radius: 8px 8px 0 0;
}

/* Header component styling */
.header-main-area {
    background: linear-gradient(135deg, var(--base-color) 0%, var(--secondary-color) 100%) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header {
    background: transparent !important;
}

/* Body section */
.body-section {
    background: transparent !important;
    min-height: 100vh;
    padding-top: 40px !important;
    /* Added separation */
    padding-bottom: 60px !important;
}

/* Logo text styling */
.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #fff !important;
    margin-left: 10px;
    text-decoration: none !important;
    display: inline-block;
}

/* Specific Style for Categories Section Header */
.nl-card:first-of-type .nl-card-header {
    background-color: #D1E6EF;
    /* Often distinctive on Nairaland */
}

.nl-card-body {
    padding: 4px;
}

/* Modern Button Styles */
.btn {
    border-radius: 8px !important;
    font-size: 14px !important;
    padding: 10px 20px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.btn--primary {
    background: linear-gradient(135deg, var(--base-color) 0%, var(--secondary-color) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.4) !important;
}

.btn--primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.5) !important;
}

.btn--secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.4) !important;
}

.btn--secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.5) !important;
}

.btn-outline-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: none !important;
}

.btn-outline-primary:hover {
    transform: translateY(-2px) !important;
}

/* Category Grid mimicking table */
.nl-category-grid {
    display: block;
    /* Stack on mobile, flow on desktop */
    text-align: center;
    line-height: 1.8;
}

.nl-category-link {
    font-weight: bold;
    color: var(--nl-link-blue);
    font-size: 13px;
    margin: 0 2px;
}

/* Recent Topics */
.nl-topic-item {
    display: block;
    padding: 2px 0;
    text-decoration: none;
    color: var(--nl-text-main);
}

.nl-topic-item:hover {
    background-color: #E7E7E7;
}

.nl-topic-prefix {
    display: none;
    /* Nairaland doesn't usually use this arrow */
}

.nl-topic-title {
    font-weight: bold;
    font-size: 13px;
    color: #0000FF;
    /* Specific override */
}

.nl-topic-meta {
    font-size: 11px;
    color: #555;
    margin-left: 5px;
}

/* Search Bar */
.nl-search-bar {
    text-align: center;
    margin: 10px 0;
}

.nl-search-input {
    border: 1px solid #888;
    padding: 2px;
    font-size: 13px;
    width: 200px;
    border-radius: 0;
}

.nl-search-btn {
    border: 1px solid #888;
    background: #EEE;
    font-size: 13px;
    cursor: pointer;
    border-radius: 0;
    padding: 2px 5px;
    color: #000;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin: 10px 0;
    display: flex;
    list-style: none;
    padding: 0;
    font-size: 13px;
}

.page-item {
    margin: 0 2px;
}

.page-link {
    border: none;
    color: #0000FF;
    padding: 0;
    font-weight: bold;
    background: transparent;
}

.page-item.active .page-link {
    background-color: transparent;
    border-color: transparent;
    color: #000;
    font-weight: bold;
}

.page-link:hover {
    color: #CC0000;
    text-decoration: underline;
    background: transparent;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-left: 10px;
    text-decoration: none;
}

/* ===== Mobile Responsive Fixes ===== */

/* Ads banner - prevent overflow on mobile */
.nl-ads-section {
    overflow: hidden;
    width: 100%;
}

.nl-ad-link {
    display: block;
    width: 100%;
}

.nl-ad-banner {
    width: 100% !important;
    overflow: hidden !important;
}

/* Offcanvas sidenav - match homepage blue gradient */
#offcanvasExample {
    background: linear-gradient(135deg, var(--base-color) 0%, var(--secondary-color) 100%) !important;
    color: #ffffff !important;
}

#offcanvasExample .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#offcanvasExample .btn-close {
    filter: invert(1) brightness(2);
}

#offcanvasExample .user-info.bg--color {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px !important;
}

#offcanvasExample .user-info h4 {
    color: #ffffff !important;
}

#offcanvasExample .side-Nav li a {
    color: #ffffff !important;
    font-weight: 500;
    padding: 8px 12px;
    display: block;
    border-radius: 8px;
    transition: background 0.2s ease;
}

#offcanvasExample .side-Nav li a:hover,
#offcanvasExample .side-Nav li a.active {
    background: rgba(255, 255, 255, 0.15) !important;
    text-decoration: none;
}

/* Stack ads full-width below md breakpoint */
@media (max-width: 767.98px) {
    .nl-ads-section .row>[class*="col-"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .nl-ad-banner {
        height: 80px !important;
    }

    /* Prevent horizontal scroll from any overflow */
    .nl-container {
        overflow-x: hidden;
    }

    .nl-banner {
        padding: 12px 10px;
    }

    .nl-logo {
        font-size: 24px;
    }

}

/* Fix blank space in Latest News & Topics - Global */
.nl-card-body {
    padding-top: 0 !important;
}

.forum-card-wraper {
    padding-top: 5px !important;
}

@media (max-width: 1440px),
(max-width: 1023px),
(max-width: 768px) {
    .forum-card-wraper {
        padding-top: 5px !important;
    }
}

/* Dashboard Stats Cards - Blue Gradient Theme */
.stats-card {
    background: var(--nl-header-bg) !important;
    color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.stats-card h4,
.stats-card p {
    color: #fff !important;
}

.stats-card p {
    opacity: 0.8;
}