<?php
if (session_status() === PHP_SESSION_NONE) session_start();

/**
 * FILE:  public_html/journals/page.php
 *
 * .htaccess rewrites:
 *   /journals/social-science/aims-scope
 *       → journals/page.php?journal=social-science&slug=aims-scope
 *
 * Same UI as existing page.php — only DB logic updated.
 */

ini_set('display_errors', 1);
error_reporting(E_ALL);

// ── DB ─────────────────────────────────────────────────────────
include_once __DIR__ . '/../config/db_new.php';

// ── Slugs from .htaccess query string ─────────────────────────
$journalSlug = trim($_GET['journal'] ?? '');
$slug        = trim($_GET['slug']    ?? '');

// ── 1. Load journal ────────────────────────────────────────────
$journal = null;
if ($journalSlug && $pdo) {
    try {
        $s = $pdo->prepare("SELECT * FROM journals WHERE slug = ? LIMIT 1");
        $s->execute([$journalSlug]);
        $journal = $s->fetch(PDO::FETCH_ASSOC);
    } catch (PDOException $e) {}
}

// ── 2. Load page by slug + journal_id ─────────────────────────
$pageData = null;
if ($slug && $pdo) {
    try {
        if ($journal) {
            // First: page assigned to this specific journal
            $s = $pdo->prepare(
                "SELECT * FROM pages
                 WHERE slug = ? AND journal_id = ? AND status = 'published'
                 LIMIT 1"
            );
            $s->execute([$slug, $journal['journal_id']]);
            $pageData = $s->fetch(PDO::FETCH_ASSOC);

            // Fallback: shared/unassigned page with same slug
            if (!$pageData) {
                $s = $pdo->prepare(
                    "SELECT * FROM pages
                     WHERE slug = ? AND (journal_id IS NULL OR journal_id = 0) AND status = 'published'
                     LIMIT 1"
                );
                $s->execute([$slug]);
                $pageData = $s->fetch(PDO::FETCH_ASSOC);
            }
        } else {
            // No journal — find by slug alone
            $s = $pdo->prepare(
                "SELECT * FROM pages WHERE slug = ? AND status = 'published' LIMIT 1"
            );
            $s->execute([$slug]);
            $pageData = $s->fetch(PDO::FETCH_ASSOC);
        }
    } catch (PDOException $e) {}
}

// ── 3. Sidebar nav: all published pages for this journal ───────
// Pass $navPages + $journal to nsidebar.php
$navPages = [];
if ($journal && $pdo) {
    try {
        $s = $pdo->prepare(
            "SELECT id, title, slug FROM pages
             WHERE journal_id = ? AND status = 'published'
             ORDER BY title ASC"
        );
        $s->execute([$journal['journal_id']]);
        $navPages = $s->fetchAll(PDO::FETCH_ASSOC);
    } catch (PDOException $e) {}
}

// ── 404 ────────────────────────────────────────────────────────
if (!$pageData) {
    http_response_code(404);
}

// ── SEO Variables ──────────────────────────────────────────────
$siteUrl  = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
$pageUrl  = $siteUrl . $_SERVER['REQUEST_URI'];
$siteName = 'Communeglobal';

if ($pageData) {
    $p = $pageData;

    $finalTitle      = $p['meta_title']       ?: ($p['title'] . ' — ' . ($journal['name'] ?? $siteName));
    $finalDesc       = $p['meta_description']  ?: ($p['overview'] ?: '');
    $finalKeywords   = $p['meta_keywords']      ?: '';
    $finalCanonical  = $p['canonical_url']      ?: $pageUrl;
    $finalFeatureImg = $p['feature_image']      ?: '';
    $finalImgAlt     = $p['feature_image_alt']  ?: $p['title'];

    $ogTitle  = $p['og_title']       ?: $finalTitle;
    $ogDesc   = $p['og_description'] ?: $finalDesc;
    $ogImage  = $p['og_image']       ?: $finalFeatureImg;
    $ogType   = $p['og_type']        ?: 'article';

    $twCard   = $p['twitter_card']        ?: 'summary_large_image';
    $twTitle  = $p['twitter_title']       ?: $ogTitle;
    $twDesc   = $p['twitter_description'] ?: $ogDesc;
    $twImage  = $p['twitter_image']       ?: $ogImage;
    $twSite   = $p['twitter_site']        ?: '';

    $schemaRaw = trim($p['schema_markup'] ?? '');
    $aiSummary = trim($p['ai_summary']    ?? '');
    $faqsRaw   = trim($p['faqs']          ?? '[]');

    $faqs = json_decode($faqsRaw, true);
    if (!is_array($faqs)) $faqs = [];
    $faqs = array_filter($faqs, fn($f) => !empty($f['q']) && !empty($f['a']));

    $faqSchema = '';
    if (!empty($faqs)) {
        $faqSchema = json_encode([
            '@context'   => 'https://schema.org',
            '@type'      => 'FAQPage',
            'mainEntity' => array_map(fn($f) => [
                '@type'          => 'Question',
                'name'           => $f['q'],
                'acceptedAnswer' => ['@type' => 'Answer', 'text' => $f['a']],
            ], array_values($faqs)),
        ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
    }

    $htmlTitle = htmlspecialchars($finalTitle);

} else {
    $htmlTitle       = 'Page Not Found — ' . $siteName;
    $finalTitle      = $htmlTitle;
    $finalDesc       = 'The requested page could not be found.';
    $finalKeywords   = '';
    $finalCanonical  = $pageUrl;
    $finalFeatureImg = '';
    $finalImgAlt     = '';
    $ogTitle         = $finalTitle;
    $ogDesc          = $finalDesc;
    $ogImage         = '';
    $ogType          = 'website';
    $twCard          = 'summary';
    $twTitle         = $finalTitle;
    $twDesc          = $finalDesc;
    $twImage         = '';
    $twSite          = '';
    $schemaRaw       = '';
    $aiSummary       = '';
    $faqSchema       = '';
    $faqs            = [];
}

include __DIR__ . '/../include/header.php';
?>


<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

<style>
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

    :root {
        --primary:       #5b21b6;
        --primary-light: #7c3aed;
        --primary-dark:  #4c1d95;
        --secondary:     #0ea5e9;
        --success:       #10b981;
        --warning:       #f59e0b;
        --danger:        #ef4444;
        --gray-50:  #f9fafb;
        --gray-100: #f3f4f6;
        --gray-200: #e5e7eb;
        --gray-300: #d1d5db;
        --gray-600: #4b5563;
        --gray-700: #374151;
        --gray-800: #1f2937;
        --gray-900: #111827;
    }

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

    body { font-family: 'Inter', sans-serif; color: var(--gray-900); line-height: 1.6; background: var(--gray-50); }
    .font-poppins { font-family: 'Poppins', sans-serif; }
    .font-inter   { font-family: 'Inter',   sans-serif; }

    .container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

    /* ── Hero ── */
    .hero-section { background: white; border-bottom: 1px solid var(--gray-200); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
    .hero-content { padding: 1rem 0; }
    .hero-icon {
        width: 64px; height: 64px; background: var(--primary); border-radius: 16px;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 4px 6px rgba(91,33,182,.2);
    }
    .hero-icon i { font-size: 2rem; color: white; }
    .badge { display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; }
    .badge-purple { background: #f3e8ff; color: var(--primary); }
    .badge-blue   { background: #dbeafe; color: var(--secondary); }
    .hero-title { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin: 0.5rem 0 .5rem; }
    .hero-description { color: var(--gray-600); font-size: 1.125rem; max-width: 48rem; }

    /* ── Layout ── */
    .main-layout { display: flex; flex-direction: column; gap: 2rem; padding: 2.5rem 0; }
    @media(min-width:1024px){ .main-layout { flex-direction: row; } }
    .sidebar { width: 100%; }
    @media(min-width:1024px){ .sidebar { width: 25%; flex-shrink: 0; } }
    .main-content { width: 100%; }
    @media(min-width:1024px){ .main-content { width: 75%; } }

    /* ── Cards ── */
    .card { background: white; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.1); overflow: hidden; transition: all .3s; margin-bottom: 1.5rem; }
    .card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.1); transform: translateY(-2px); }
    .card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
    .card-header-purple { background: var(--primary); color: white; border: none; }
    .card-header-blue   { background: var(--secondary); color: white; border: none; }
    .card-title { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: .75rem; }
    .card-body { padding: 0; }

    /* ── Nav ── */
    .nav-list { list-style: none; }
    .nav-item { position: relative; border-bottom: 1px solid var(--gray-100); }
    .nav-item:last-child { border-bottom: none; }
    .nav-link {
        display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem;
        color: var(--gray-700); text-decoration: none; transition: all .2s; font-weight: 500; position: relative;
    }
    .nav-link::before {
        content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
        background: var(--primary); transform: scaleY(0); transition: transform .2s;
    }
    .nav-link:hover, .nav-item.active .nav-link { background: #faf5ff; color: var(--primary); }
    .nav-link:hover::before, .nav-item.active .nav-link::before { transform: scaleY(1); }
    .nav-icon {
        width: 40px; height: 40px; border-radius: 10px; display: flex;
        align-items: center; justify-content: center; font-size: 1rem; color: white; flex-shrink: 0; transition: transform .2s;
    }
    .nav-link:hover .nav-icon { transform: scale(1.1); }
    .icon-purple { background: var(--primary); }
    .icon-blue   { background: var(--secondary); }
    .icon-green  { background: var(--success); }
    .icon-orange { background: var(--warning); }
    .icon-red    { background: var(--danger); }

    /* ── Stats ── */
    .stats-card { background: var(--primary); border-radius: 16px; padding: 1.5rem; color: white; margin-top: 1.5rem; }
    .stats-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
    .stats-header i { font-size: 2rem; }
    .stats-label { font-size: .875rem; opacity: .9; }
    .stats-value { font-size: 2rem; font-weight: 700; }
    .stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .75rem; margin-top: 1rem; }
    .stats-item { background: rgba(255,255,255,.15); border-radius: 12px; padding: .875rem; }
    .stats-item-label { font-size: .75rem; opacity: .9; }
    .stats-item-value { font-size: 1.25rem; font-weight: 700; }

    /* ── Content ── */
    .content-card { background: white; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 2.5rem; }
    .section-heading { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 3px solid var(--primary); display: inline-block; }
    .content-overview { background: #f5f3ff; border-left: 4px solid var(--primary); border-radius: 0 12px 12px 0; padding: 1rem 1.5rem; margin-bottom: 1.75rem; color: var(--gray-700); font-size: 1rem; font-style: italic; }

    /* Rich text body styles */
    .content-body { color: var(--gray-700); line-height: 1.8; font-size: 1rem; }
    .content-body h1 { font-size: 2rem; font-weight: 800; color: var(--gray-900); margin: 1.75rem 0 1rem; }
    .content-body h2 { font-size: 1.6rem; font-weight: 700; color: var(--gray-900); margin: 1.5rem 0 .875rem; border-bottom: 2px solid var(--gray-200); padding-bottom: .5rem; }
    .content-body h3 { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); margin: 1.25rem 0 .75rem; }
    .content-body h4, .content-body h5 { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); margin: 1rem 0 .5rem; }
    .content-body p { margin-bottom: 1rem; }
    .content-body ul { list-style: none; margin: 1rem 0; padding-left: 0; }
    .content-body ul li { position: relative; padding-left: 1.75rem; margin-bottom: .75rem; }
    .content-body ul li::before { content: '●'; position: absolute; left: 0; color: var(--primary); font-weight: bold; }
    .content-body ol { padding-left: 1.5rem; margin: 1rem 0; }
    .content-body ol li { margin-bottom: .75rem; }
    .content-body a { color: var(--primary); text-decoration: underline; }
    .content-body a:hover { color: var(--primary-dark); }
    .content-body blockquote { border-left: 4px solid var(--primary); background: #faf5ff; padding: 1rem 1.5rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0; font-style: italic; color: var(--gray-700); }
    .content-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
    .content-body table th { background: var(--primary); color: white; padding: .75rem 1rem; text-align: left; }
    .content-body table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-200); }
    .content-body table tr:hover td { background: var(--gray-50); }
    .content-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1rem 0; }
    .content-body pre { background: var(--gray-800); color: #e5e7eb; padding: 1.25rem 1.5rem; border-radius: 10px; overflow-x: auto; font-size: .875rem; margin: 1rem 0; }
    .content-body code { background: var(--gray-100); padding: .125rem .375rem; border-radius: 4px; font-size: .875rem; color: var(--primary); }
    .content-body strong { font-weight: 700; color: var(--gray-900); }

    /* ── Page meta bar ── */
    .page-meta {
        display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
        padding: 1rem 0 1.5rem; margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--gray-200);
        font-size: .8rem; color: var(--gray-600);
    }
    .page-meta .meta-chip {
        display: inline-flex; align-items: center; gap: .35rem;
        background: var(--gray-100); padding: .25rem .75rem; border-radius: 9999px;
    }
    .page-meta .meta-chip.published { background: #d1fae5; color: #065f46; }
    .page-meta .meta-chip i { font-size: .7rem; }

    /* ── 404 State ── */
    .not-found-state { text-align: center; padding: 5rem 2rem; }
    .not-found-state .not-found-icon { font-size: 5rem; color: var(--gray-300); margin-bottom: 1.5rem; }
    .not-found-state h2 { font-size: 2rem; font-weight: 800; color: var(--gray-700); margin-bottom: .75rem; }
    .not-found-state p { color: var(--gray-600); font-size: 1.1rem; margin-bottom: 2rem; }
    .btn-primary { display: inline-flex; align-items: center; gap: .5rem; background: var(--primary); color: white; padding: .875rem 2rem; border-radius: 12px; font-weight: 700; text-decoration: none; transition: all .2s; }
    .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(91,33,182,.25); }

    /* Utility */
    .flex { display: flex; }
    .items-center { align-items: center; }
    .gap-2 { gap: .5rem; }
    .gap-4 { gap: 1rem; }
    .mb-3 { margin-bottom: .75rem; }
    .mb-4 { margin-bottom: 1rem; }
    .text-center { text-align: center; }
    
        /* Policy Section */
    .policy-section {
        margin-bottom: 2rem;
    }

    .policy-header {
        background: #4f46e5;
        color: white;
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 1rem;
        border-radius: 4px;
    }

    .policy-content {
        color: var(--gray-700);
        font-size: 0.9375rem;
        line-height: 1.8;
        padding-left: 1rem;
    }

    .policy-content ul {
        margin: 0.5rem 0;
        padding-left: 1.25rem;
    }

    .policy-content li {
        margin-bottom: 0.5rem;
    }

    .closing-statement {
        background: var(--gray-50);
        border-left: 4px solid var(--primary);
        padding: 1.25rem 1.5rem;
        margin-top: 2rem;
        border-radius: 4px;
        color: var(--gray-700);
        font-size: 0.9375rem;
        line-height: 1.8;
    }
   
</style>
<style>
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');
    
    .font-poppins {
        font-family: 'Poppins', sans-serif;
    }
    
    .font-inter {
        font-family: 'Inter', sans-serif;
    }
    
    .gradient-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .gradient-secondary {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    }
    
    .gradient-blue {
        background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    }
    
    .gradient-orange {
        background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    }
    
    .card-hover {
        transition: all 0.3s ease;
    }
    
    .card-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }
    
    .nav-item {
        position: relative;
        overflow: hidden;
    }
    
    .nav-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 3px;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }
    
    .nav-item:hover::before,
    .nav-item.active::before {
        transform: scaleY(1);
    }
    
    .discipline-card {
        position: relative;
        padding: 1rem;
        border-radius: 12px;
        background: white;
        border: 1px solid #e5e7eb;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .discipline-card:hover {
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
        transform: translateX(5px);
    }
    
    .discipline-card::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        border-radius: 12px 0 0 12px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .discipline-card:hover::before {
        opacity: 1;
    }
    
    .icon-wrapper {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: white;
    }
    
    .category-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 16px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        margin-bottom: 8px;
    }
    
    .stats-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 16px;
        padding: 1.5rem;
        color: white;
        position: relative;
        overflow: hidden;
    }
    
    .stats-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        animation: pulse 3s ease-in-out infinite;
    }
    
    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }
    
    .search-box {
        position: relative;
    }
    
    .search-box input {
        padding-left: 3rem;
    }
    
    .search-box i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
    }
    
        /* Payment Styles */
    .payment-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .payment-option {
        background: var(--gray-50);
        border-radius: 12px;
        padding: 1.5rem;
        text-align: center;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
    }

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

    .pay-button {
        background: var(--primary);
        color: white;
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
        width: 100%;
    }

    .pay-button:hover {
        background: var(--primary-dark);
    }
</style>
<style>

 
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.375rem 0.875rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .badge-purple {
        background: #f3e8ff;
        color: var(--primary);
    }
    
    .badge-blue {
        background: #dbeafe;
        color: var(--secondary);
    }
    
    .hero-title {
        font-size: 2.5rem;
        font-weight: 800;
        color: var(--primary);
        margin: 1rem 0 0.5rem;
    }
    
    .hero-description {
        color: var(--gray-600);
        font-size: 1.125rem;
        max-width: 48rem;
    }
    
    /* Layout */
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 2.5rem 0;
    }
    
    @media (min-width: 1024px) {
        .main-layout {
            flex-direction: row;
        }
    }
    
    .sidebar {
        width: 100%;
    }
    
    @media (min-width: 1024px) {
        .sidebar {
            width: 25%;
            flex-shrink: 0;
        }
    }
    
    .main-content {
        width: 100%;
    }
    
    @media (min-width: 1024px) {
        .main-content {
            width: 75%;
        }
    }
    
    /* Card */
    .card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: all 0.3s ease;
        margin-bottom: 1.5rem;
    }
    
    .card:hover {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }
    
    .card-header {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid var(--gray-200);
        background: var(--gray-50);
    }
    
    .card-header-purple {
        background: var(--primary);
        color: white;
        border: none;
    }
    
    .card-header-blue {
        background: var(--secondary);
        color: white;
        border: none;
    }
    
    .card-header-orange {
        background: var(--warning);
        color: white;
        border: none;
    }
    
    .card-title {
        font-size: 1.25rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .card-body {
        padding: 0;
    }
    
    /* Navigation */
    .nav-list {
        list-style: none;
    }
    
    .nav-item {
        position: relative;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
        color: var(--gray-700);
        text-decoration: none;
        transition: all 0.2s ease;
        font-weight: 500;
        position: relative;
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--primary);
        transform: scaleY(0);
        transition: transform 0.2s ease;
    }
    
    .nav-link:hover,
    .nav-item.active .nav-link {
        background: #faf5ff;
        color: var(--primary);
    }
    
    .nav-link:hover::before,
    .nav-item.active .nav-link::before {
        transform: scaleY(1);
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: white;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }
    
    .nav-link:hover .nav-icon {
        transform: scale(1.1);
    }
    
    .icon-purple { background: var(--primary); }
    .icon-blue { background: var(--secondary); }
    .icon-green { background: var(--success); }
    .icon-orange { background: var(--warning); }
    .icon-red { background: var(--danger); }
    
    /* Stats Card in Sidebar */
    .stats-card {
        background: var(--primary);
        border-radius: 16px;
        padding: 1.5rem;
        color: white;
        margin-top: 1.5rem;
    }
    
    .stats-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-header i {
        font-size: 2rem;
    }
    
    .stats-label {
        font-size: 0.875rem;
        opacity: 0.9;
    }
    
    .stats-value {
        font-size: 2rem;
        font-weight: 700;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .stats-item {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        padding: 0.875rem;
        backdrop-filter: blur(10px);
    }
    
    .stats-item-label {
        font-size: 0.75rem;
        opacity: 0.9;
    }
    
    .stats-item-value {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    /* Featured Banner */
    .featured-banner {
        background: var(--navy);
        color: white;
        padding: 2.5rem;
        margin-bottom: 3rem;
        position: relative;
        overflow: hidden;
        border-radius: 0;
    }
    
    .featured-banner::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 400px;
        height: 400px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 50%;
    }
    
    .featured-banner::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -5%;
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 50%;
    }
    
    .banner-inner {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 2rem;
    }
    
    .banner-logo {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        background: white;
        border: 3px solid rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .banner-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .banner-content {
        flex: 1;
    }
    
    .banner-tag {
        display: inline-block;
        padding: 0.375rem 0.875rem;
        background: rgba(255, 255, 255, 0.15);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .banner-title {
        font-family: 'Crimson Pro', serif;
        font-size: 1.75rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .banner-text {
        font-size: 0.95rem;
        opacity: 0.9;
        line-height: 1.6;
    }
    
    /* Section Title */
    .section-title-wrapper {
        margin-bottom: 2.5rem;
    }
    
    .section-title-main {
        font-family: 'Crimson Pro', serif;
        font-size: 2.25rem;
        font-weight: 700;
        color: var(--navy);
        margin-bottom: 0.75rem;
        position: relative;
        display: inline-block;
    }
    
    .section-title-main::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 0;
        width: 60%;
        height: 4px;
        background: var(--primary);
    }
    
    .section-subtitle-main {
        font-size: 1rem;
        color: var(--slate);
        margin-top: 1.25rem;
        line-height: 1.7;
    }
    
    /* Indexing Grid */
    .indexing-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    @media (min-width: 768px) {
        .indexing-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    .indexing-item {
        background: white;
        padding: 2rem;
        border: 2px solid var(--gray-200);
        display: flex;
        gap: 1.5rem;
        align-items: flex-start;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .indexing-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--primary);
        transform: scaleX(0);
        transition: transform 0.4s ease;
    }
    
    .indexing-item:hover {
        border-color: var(--navy);
        transform: translateX(6px);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    }
    
    .indexing-item:hover::after {
        transform: scaleX(1);
    }
    
    .indexing-logo-wrapper {
        flex-shrink: 0;
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--cream);
        border: 2px solid var(--gray-300);
        overflow: hidden;
    }
    
    .indexing-logo-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 0.5rem;
    }
    
    .indexing-logo-wrapper i {
        font-size: 2rem;
        color: var(--primary);
    }
    
    .indexing-details {
        flex: 1;
    }
    
    .indexing-name {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--navy);
        margin-bottom: 0.5rem;
    }
    
    .indexing-description {
        font-size: 0.875rem;
        color: var(--slate);
        line-height: 1.6;
    }
    
    /* Info Alert Box */
    .info-alert {
        background: white;
        border-left: 5px solid var(--secondary);
        padding: 1.75rem 2rem;
        margin-top: 3rem;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }
    
    .info-alert-title {
        font-weight: 700;
        font-size: 1.15rem;
        color: var(--navy);
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .info-alert-title i {
        color: var(--secondary);
        font-size: 1.25rem;
    }
    
    .info-alert-text {
        color: var(--slate);
        line-height: 1.7;
        font-size: 0.95rem;
    }
    
    /* Animations */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(40px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
</style>
<style>
/* Content Section */
    .content-card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 2.5rem;
    }
   
    .section-heading {
        font-size: 2rem;
        font-weight: 700;
        color: var(--gray-900);
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 3px solid var(--primary);
        display: inline-block;
    }
   
    .content-text {
        color: var(--gray-700);
        line-height: 1.8;
        font-size: 1rem;
    }
   
    .content-text h3 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--gray-900);
        margin: 1.5rem 0 1rem;
    }
   
    .content-text p {
        margin-bottom: 1rem;
    }
   
    .content-text ul {
        list-style: none;
        margin: 1rem 0;
        padding-left: 0;
    }
   
    .content-text ul li {
        position: relative;
        padding-left: 1.75rem;
        margin-bottom: 0.75rem;
    }
   
    .content-text ul li::before {
        content: '●';
        position: absolute;
        left: 0;
        color: var(--primary);
        font-weight: bold;
    }

    /* Archive Section Styles */
    .archive-section {
        margin-top: 2rem;
    }

    .year-section {
        background: white;
        border-radius: 12px;
        border: 1px solid var(--gray-200);
        margin-bottom: 2rem;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .year-section:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .year-header {
        background: var(--gray-50);
        padding: 1.5rem;
        border-bottom: 2px solid var(--primary);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
    }

    .year-header:hover {
        background: #faf5ff;
    }

    .year-title {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .year-icon {
        width: 48px;
        height: 48px;
        background: var(--primary);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.25rem;
    }

    .year-toggle {
        color: var(--primary);
        font-size: 1.5rem;
        transition: transform 0.3s ease;
    }

    .year-section.collapsed .year-toggle {
        transform: rotate(-90deg);
    }

    .volumes-grid {
        padding: 2rem;
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 1.5rem;
    }

    @media (min-width: 768px) {
        .volumes-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (min-width: 1024px) {
        .volumes-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    .volume-card {
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 1.5rem;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .volume-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--secondary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .volume-card:hover {
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateX(4px);
    }

    .volume-card:hover::before {
        transform: scaleY(1);
    }

    .volume-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .volume-icon {
        width: 40px;
        height: 40px;
        background: var(--secondary);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .volume-title {
        font-size: 1.125rem;
        font-weight: 600;
        color: var(--gray-900);
    }

    .volume-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .volume-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--primary);
        text-decoration: none;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        transition: all 0.2s ease;
        background: white;
        border: 1px solid var(--gray-200);
    }

    .volume-link:hover {
        background: #faf5ff;
        border-color: var(--primary);
        transform: translateX(4px);
    }

    .volume-link i {
        font-size: 0.75rem;
        transition: transform 0.2s ease;
    }

    .volume-link:hover i {
        transform: translateX(2px);
    }

    .special-issue-tag {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        background: #dbeafe;
        color: var(--secondary);
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 600;
        margin-left: 0.5rem;
    }

    .conference-tag {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        background: #fef3c7;
        color: var(--warning);
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 600;
        margin-left: 0.5rem;
    }

    .empty-state {
        text-align: center;
        padding: 4rem 2rem;
        color: var(--gray-600);
    }

    .empty-state i {
        font-size: 4rem;
        color: var(--gray-300);
        margin-bottom: 1rem;
    }

    .empty-state p {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
        /* Feature Cards */
    .features-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .feature-card {
        background: white;
        border: 2px solid var(--gray-200);
        border-radius: 16px;
        padding: 2rem;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .feature-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--primary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .feature-card:hover {
        border-color: var(--primary);
        box-shadow: 0 8px 24px rgba(91, 33, 182, 0.12);
        transform: translateY(-4px);
    }

    .feature-card:hover::before {
        transform: scaleY(1);
    }

    .feature-header {
        display: flex;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .feature-number {
        width: 56px;
        height: 56px;
        background: var(--primary);
        color: white;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: 800;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(91, 33, 182, 0.2);
    }

    .feature-title-wrapper {
        flex: 1;
    }

    .feature-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--gray-900);
        margin-bottom: 0.5rem;
    }

    .feature-icon-group {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .feature-mini-icon {
        width: 32px;
        height: 32px;
        background: var(--gray-100);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        font-size: 0.875rem;
        transition: all 0.2s ease;
    }

    .feature-card:hover .feature-mini-icon {
        background: #f3e8ff;
        transform: scale(1.1);
    }

    .feature-content {
        color: var(--gray-600);
        line-height: 1.8;
        font-size: 1rem;
    }

    .feature-content ul {
        list-style: none;
        margin-top: 1rem;
        padding-left: 0;
    }

    .feature-content ul li {
        position: relative;
        padding-left: 2rem;
        margin-bottom: 0.75rem;
        color: var(--gray-700);
    }

    .feature-content ul li::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0.5rem;
        width: 6px;
        height: 6px;
        background: var(--primary);
        border-radius: 50%;
    }

</style>
<style>
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');
    
    :root {
        --primary: #5b21b6;
        --primary-light: #7c3aed;
        --primary-dark: #4c1d95;
        --secondary: #0ea5e9;
        --success: #10b981;
        --warning: #f59e0b;
        --danger: #ef4444;
        --dark: #1e293b;
        --light: #f8fafc;
        --gray-50: #f9fafb;
        --gray-100: #f3f4f6;
        --gray-200: #e5e7eb;
        --gray-300: #d1d5db;
        --gray-600: #4b5563;
        --gray-700: #374151;
        --gray-800: #1f2937;
        --gray-900: #111827;
        
        /* New Enhanced Colors */
        --navy: #0f172a;
        --slate: #475569;
        --cream: #fef9f3;
        --sky-light: #e0f2fe;
        --mint-light: #d1fae5;
        --lavender-light: #ede9fe;
        --peach-light: #fed7aa;
    }
    
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    body {
        font-family: 'Work Sans', 'Inter', sans-serif;
        color: var(--gray-900);
        line-height: 1.6;
        background-color: var(--gray-50);
    }
    
    .font-poppins {
        font-family: 'Poppins', sans-serif;
    }
    
    .font-crimson {
        font-family: 'Crimson Pro', serif;
    }
    
    .font-work {
        font-family: 'Work Sans', sans-serif;
    }
    
    /* Container */
    .container {
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 1rem;
    }
    
    /* Hero Section */
    .hero-section {
        background: white;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    

    .hero-icon {
        width: 64px;
        height: 64px;
        background: var(--primary);
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 6px rgba(91, 33, 182, 0.2);
    }
    
    .hero-icon i {
        font-size: 2rem;
        color: white;
    }
    
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.375rem 0.875rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .badge-purple {
        background: #f3e8ff;
        color: var(--primary);
    }
    
    .badge-blue {
        background: #dbeafe;
        color: var(--secondary);
    }
    
    .hero-title {
        font-size: 2.5rem;
        font-weight: 800;
        color: var(--primary);
        margin: 0.5rem 0 0.5rem;
    }
    
    .hero-description {
        color: var(--gray-600);
        font-size: 1.125rem;
        max-width: 48rem;
    }
    
    /* Layout */
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 2.5rem 0;
    }
    
    @media (min-width: 1024px) {
        .main-layout {
            flex-direction: row;
        }
    }
    
    .sidebar {
        width: 100%;
    }
    
    @media (min-width: 1024px) {
        .sidebar {
            width: 25%;
            flex-shrink: 0;
        }
    }
    
    .main-content {
        width: 100%;
    }
    
    @media (min-width: 1024px) {
        .main-content {
            width: 75%;
        }
    }
    
    /* Card */
    .card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: all 0.3s ease;
        margin-bottom: 1.5rem;
    }
    
    .card:hover {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }
    
    .card-header {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid var(--gray-200);
        background: var(--gray-50);
    }
    
    .card-header-purple {
        background: var(--primary);
        color: white;
        border: none;
    }
    
    .card-header-blue {
        background: var(--secondary);
        color: white;
        border: none;
    }
    
    .card-header-orange {
        background: var(--warning);
        color: white;
        border: none;
    }
    
    .card-title {
        font-size: 1.25rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .card-body {
        padding: 0;
    }
    
    /* Navigation */
    .nav-list {
        list-style: none;
    }
    
    .nav-item {
        position: relative;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
        color: var(--gray-700);
        text-decoration: none;
        transition: all 0.2s ease;
        font-weight: 500;
        position: relative;
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--primary);
        transform: scaleY(0);
        transition: transform 0.2s ease;
    }
    
    .nav-link:hover,
    .nav-item.active .nav-link {
        background: #faf5ff;
        color: var(--primary);
    }
    
    .nav-link:hover::before,
    .nav-item.active .nav-link::before {
        transform: scaleY(1);
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: white;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }
    
    .nav-link:hover .nav-icon {
        transform: scale(1.1);
    }
    
    .icon-purple { background: var(--primary); }
    .icon-blue { background: var(--secondary); }
    .icon-green { background: var(--success); }
    .icon-orange { background: var(--warning); }
    .icon-red { background: var(--danger); }
    
    /* Stats Card in Sidebar */
    .stats-card {
        background: var(--primary);
        border-radius: 16px;
        padding: 1.5rem;
        color: white;
        margin-top: 1.5rem;
    }
    
    .stats-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-header i {
        font-size: 2rem;
    }
    
    .stats-label {
        font-size: 0.875rem;
        opacity: 0.9;
    }
    
    .stats-value {
        font-size: 2rem;
        font-weight: 700;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .stats-item {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        padding: 0.875rem;
        backdrop-filter: blur(10px);
    }
    
    .stats-item-label {
        font-size: 0.75rem;
        opacity: 0.9;
    }
    
    .stats-item-value {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    /* ============================================
       ENHANCED RIGHT CONTENT AREA STYLES
    ============================================ */
    
    /* Page Header */
    .page-header {
        margin-bottom: 3rem;
        animation: slideDown 0.6s ease-out;
    }
    
    .page-subtitle {
        color: var(--slate);
        font-size: 1rem;
        line-height: 1.7;
        max-width: 700px;
    }
    
    /* Stats Overview Grid */
    .stats-overview {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    @media (min-width: 768px) {
        .stats-overview {
            grid-template-columns: repeat(4, 1fr);
        }
    }
    
    .stat-box {
        background: white;
        padding: 2rem 1.5rem;
        border: 2px solid var(--navy);
        position: relative;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-align: center;
        animation: fadeInUp 0.6s ease-out backwards;
    }
    
    .stat-box:nth-child(1) { animation-delay: 0.1s; }
    .stat-box:nth-child(2) { animation-delay: 0.2s; }
    .stat-box:nth-child(3) { animation-delay: 0.3s; }
    .stat-box:nth-child(4) { animation-delay: 0.4s; }
    
    .stat-box::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        background: var(--navy);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .stat-box:hover::before {
        transform: scaleX(1);
    }
    
    .stat-box:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    }
    
    .stat-box.sky { 
        background: var(--sky-light); 
        border-color: var(--secondary);
    }
    .stat-box.sky::before { background: var(--secondary); }
    
    .stat-box.mint { 
        background: var(--mint-light); 
        border-color: var(--success);
    }
    .stat-box.mint::before { background: var(--success); }
    
    .stat-box.lavender { 
        background: var(--lavender-light); 
        border-color: var(--primary);
    }
    .stat-box.lavender::before { background: var(--primary); }
    
    .stat-box.peach { 
        background: var(--peach-light); 
        border-color: var(--warning);
    }
    .stat-box.peach::before { background: var(--warning); }
    
    .stat-icon-main {
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        border: 2px solid var(--navy);
        margin: 0 auto 1rem;
        transition: all 0.3s ease;
    }
    
    .stat-box:hover .stat-icon-main {
        transform: rotate(5deg) scale(1.1);
    }
    
    .stat-icon-main i {
        font-size: 1.75rem;
        color: var(--navy);
    }
    
    .stat-number {
        font-family: 'Crimson Pro', serif;
        font-size: 2.75rem;
        font-weight: 800;
        color: var(--navy);
        line-height: 1;
        margin-bottom: 0.5rem;
    }
    
    .stat-text {
        font-size: 0.85rem;
        color: var(--navy);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Featured Banner */
    .featured-banner {
        background: var(--navy);
        color: white;
        padding: 2.5rem;
        margin-bottom: 3rem;
        position: relative;
        overflow: hidden;
        border-radius: 0;
    }
    
    .featured-banner::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 400px;
        height: 400px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 50%;
    }
    
    .featured-banner::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -5%;
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 50%;
    }
    
    .banner-inner {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 2rem;
    }
    
    .banner-logo {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        background: white;
        border: 3px solid rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .banner-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .banner-content {
        flex: 1;
    }
    
    .banner-tag {
        display: inline-block;
        padding: 0.375rem 0.875rem;
        background: rgba(255, 255, 255, 0.15);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .banner-title {
        font-family: 'Crimson Pro', serif;
        font-size: 1.75rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .banner-text {
        font-size: 0.95rem;
        opacity: 0.9;
        line-height: 1.6;
    }
    
    /* Section Title */
    .section-title-wrapper {
        margin-bottom: 2.5rem;
    }
    
    .section-title-main {
        font-family: 'Crimson Pro', serif;
        font-size: 2.25rem;
        font-weight: 700;
        color: var(--navy);
        margin-bottom: 0.75rem;
        position: relative;
        display: inline-block;
    }
    
    .section-title-main::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 0;
        width: 60%;
        height: 4px;
        background: var(--primary);
    }
    
    .section-subtitle-main {
        font-size: 1rem;
        color: var(--slate);
        margin-top: 1.25rem;
        line-height: 1.7;
    }
    
    /* Indexing Grid */
    .indexing-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    @media (min-width: 768px) {
        .indexing-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    .indexing-item {
        background: white;
        padding: 2rem;
        border: 2px solid var(--gray-200);
        display: flex;
        gap: 1.5rem;
        align-items: flex-start;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .indexing-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--primary);
        transform: scaleX(0);
        transition: transform 0.4s ease;
    }
    
    .indexing-item:hover {
        border-color: var(--navy);
        transform: translateX(6px);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    }
    
    .indexing-item:hover::after {
        transform: scaleX(1);
    }
    
    .indexing-logo-wrapper {
        flex-shrink: 0;
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--cream);
        border: 2px solid var(--gray-300);
        overflow: hidden;
    }
    
    .indexing-logo-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 0.5rem;
    }
    
    .indexing-logo-wrapper i {
        font-size: 2rem;
        color: var(--primary);
    }
    
    .indexing-details {
        flex: 1;
    }
    
    .indexing-name {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--navy);
        margin-bottom: 0.5rem;
    }
    
    .indexing-description {
        font-size: 0.875rem;
        color: var(--slate);
        line-height: 1.6;
    }
    
    /* Info Alert Box */
    .info-alert {
        background: white;
        border-left: 5px solid var(--secondary);
        padding: 1.75rem 2rem;
        margin-top: 3rem;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }
    
    .info-alert-title {
        font-weight: 700;
        font-size: 1.15rem;
        color: var(--navy);
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .info-alert-title i {
        color: var(--secondary);
        font-size: 1.25rem;
    }
    
    .info-alert-text {
        color: var(--slate);
        line-height: 1.7;
        font-size: 0.95rem;
    }
    
    /* Animations */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(40px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Contribute Section */
    .contribute-section {
        background: white;
        padding: 5rem 0;
        margin-top: 3rem;
    }
    
    .section-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: #f3e8ff;
        color: var(--primary);
        border-radius: 9999px;
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 3rem;
        font-weight: 800;
        color: var(--gray-900);
        margin-bottom: 1rem;
    }
    
    .section-description {
        font-size: 1.25rem;
        color: var(--gray-600);
        max-width: 48rem;
        margin: 0 auto 3rem;
    }
    
    /* Action Cards */
    .action-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 80rem;
        margin: 0 auto;
    }
    
    @media (min-width: 768px) {
        .action-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @media (min-width: 1024px) {
        .action-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    
    .action-card {
        background: white;
        border: 2px solid var(--gray-200);
        border-radius: 16px;
        padding: 2rem;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        text-align: center;
    }
    
    .action-card:hover {
        border-color: var(--primary);
        box-shadow: 0 10px 30px rgba(91, 33, 182, 0.1);
        transform: translateY(-4px);
    }
    
    .action-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--primary);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }
    
    .action-card:hover::after {
        transform: scaleX(1);
    }
    
    .action-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.75rem;
        color: white;
        margin: 0 auto 1.5rem;
        transition: transform 0.3s ease;
        background: var(--primary);
    }
    
    .action-card:hover .action-icon {
        transform: scale(1.1);
    }
    
    .action-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--gray-900);
        margin-bottom: 0.75rem;
    }
    
    .action-description {
        color: var(--gray-600);
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }
    
    .action-link {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
        transition: gap 0.2s ease;
    }
    
    .action-link:hover {
        gap: 0.75rem;
    }
    
    /* Utility Classes */
    .text-center { text-align: center; }
    .mb-1 { margin-bottom: 0.25rem; }
    .mb-2 { margin-bottom: 0.5rem; }
    .mb-3 { margin-bottom: 0.75rem; }
    .mb-4 { margin-bottom: 1rem; }
    .mb-6 { margin-bottom: 1.5rem; }
    .mt-4 { margin-top: 1rem; }
    .mt-6 { margin-top: 1.5rem; }
    .flex { display: flex; }
    .items-center { align-items: center; }
    .gap-2 { gap: 0.5rem; }
    .gap-3 { gap: 0.75rem; }
    .gap-4 { gap: 1rem; }
    
    /* Responsive Adjustments */
    @media (max-width: 768px) {
        .hero-title {
            font-size: 2rem;
        }
        
        .section-title-main {
            font-size: 1.75rem;
        }
        
        .banner-inner {
            flex-direction: column;
            text-align: center;
        }
        
        .banner-logo {
            margin: 0 auto;
        }
        
        .stat-number {
            font-size: 2.25rem;
        }
    }
    
    /* Stats Banner */
    .stats-banner {
        background: white;
        border: 2px solid var(--gray-200);
        border-radius: 20px;
        padding: 2.5rem;
        margin-top: 3rem;
    }
    
    .stats-banner-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    @media (min-width: 768px) {
        .stats-banner-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }
    
    .stat-item {
        text-align: center;
        transition: transform 0.2s ease;
    }
    
    .stat-item:hover {
        transform: scale(1.05);
    }
    
    .stat-icon-wrapper {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 1rem;
    }
    
    .stat-icon-wrapper.blue { background: var(--secondary); }
    .stat-icon-wrapper.purple { background: var(--primary); }
    .stat-icon-wrapper.green { background: var(--success); }
    .stat-icon-wrapper.orange { background: var(--warning); }
    
    .stat-icon-wrapper i {
        font-size: 1.5rem;
        color: white;
    }
    
    .stat-value {
        font-size: 2.5rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
    }
    
    .stat-value.blue { color: var(--secondary); }
    .stat-value.purple { color: var(--primary); }
    .stat-value.green { color: var(--success); }
    .stat-value.orange { color: var(--warning); }
    
    .stat-label {
        color: var(--gray-600);
        font-weight: 500;
    }
    /*==============board member=====================*/
    /* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 2px solid var(--gray-200);
    transition: all 0.2s ease;
}

.stat-box:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-heading i {
    color: var(--primary);
}

.section-description {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Leadership Section */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.leadership-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(91, 33, 182, 0.2);
    transition: all 0.3s ease;
}

.leadership-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transition: all 0.3s ease;
}

.leadership-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(91, 33, 182, 0.3);
}

.leadership-card:hover::before {
    top: -30%;
    right: -30%;
}

.leadership-content {
    position: relative;
    z-index: 1;
}

.leadership-role {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.leadership-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.leadership-affiliation {
    font-size: 0.875rem;
    opacity: 0.9;
    line-height: 1.5;
}

.leadership-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 4rem;
    opacity: 0.1;
}

/* Board Members */
.board-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.member-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.15);
    transform: translateY(-3px);
}

.member-card:hover::before {
    transform: scaleX(1);
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 6px rgba(91, 33, 182, 0.3);
}

.member-prefix {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.member-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.member-affiliation {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.member-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.member-location i {
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .section-heading {
        font-size: 1.5rem;
    }

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

    .board-members-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*==================author style guidelines=====================*/

/* Content Card */
.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2.5rem;
}

/* Heading */
.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

/* Intro Text */
.intro-text {
    color: var(--gray-700);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #faf5ff;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
}

/* Guidelines List */
.guidelines-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guideline-item {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.guideline-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(91,33,182,0.08);
}

/* Header */
.guideline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.guideline-item:hover .guideline-header {
    background: #faf5ff;
}

.guideline-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.guideline-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

/* Icon Colors */
.icon-purple { background: var(--primary); }
.icon-blue   { background: var(--secondary); }
.icon-green  { background: var(--success); }
.icon-orange { background: var(--warning); }
.icon-red    { background: var(--danger); }

.guideline-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Body */
.guideline-body {
    padding: 1rem 1.25rem 1.25rem;
}

.guideline-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-left: 0;
}

.guideline-body ul li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--gray-700);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.guideline-body ul li::before {
    content: '›';
    position: absolute;
    left: 0.25rem;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Nested list */
.guideline-body ul ul {
    margin-top: 0.4rem;
    padding-left: 1.25rem;
}

.guideline-body ul ul li::before {
    content: '–';
    color: var(--gray-600);
}

/* Closing Note */
.closing-note {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-radius: 12px;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.7;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.closing-note i {
    font-size: 1.25rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/*===================reviewer guidelines========================*/

/* Content Wrapper (same as previous section) */
.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2.5rem;
}

/* Headings inside content */
.content-card p strong {
    color: var(--gray-900);
    font-weight: 700;
}

/* Paragraph Styling */
.content-card p {
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

/* Section Titles (like Review Assignment, Review Process, etc.) */
.content-card p strong:first-child {
    display: inline-block;
    margin-top: 1rem;
}

/* List Styling */
.content-card ul {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.content-card ul li {
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
}

</style>

<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

<main class="font-inter">

    <!-- ── HERO ── -->
    <div class="hero-section">
        <div class="container">
            <div class="hero-content">
                <?php if ($pageData): ?>
                <div class="flex items-center gap-4">
                    <div class="hero-icon">
                        <i class="fas fa-book-open"></i>
                    </div>
                    <div>
                        <div class="flex items-center gap-2">
                            <?php if ($journal): ?>
                            <span class="badge badge-purple">
                                <i class="fas fa-graduation-cap"></i>
                                <?= htmlspecialchars($journal['name']) ?>
                            </span>
                            <?php else: ?>
                            <span class="badge badge-purple">
                                <i class="fas fa-graduation-cap"></i>
                                Social Sciences
                            </span>
                            <?php endif; ?>
                            <span class="badge badge-blue">
                                <i class="fas fa-globe"></i>
                                Open Access
                            </span>
                        </div>
                        <h1 class="hero-title font-poppins">
                            <?= htmlspecialchars($pageData['title']) ?>
                        </h1>
                    </div>
                </div>
                <?php if ($pageData['overview']): ?>
                <p class="hero-description">
                    <?= htmlspecialchars($pageData['overview']) ?>
                </p>
                <?php endif; ?>

                <?php else: ?>
                <div class="flex items-center gap-4">
                    <div class="hero-icon" style="background:#ef4444;">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <div>
                        <h1 class="hero-title font-poppins" style="color:#ef4444;">Page Not Found</h1>
                    </div>
                </div>
                <p class="hero-description">The page you're looking for doesn't exist or hasn't been published yet.</p>
                <?php endif; ?>
            </div>
        </div>
    </div>

    <!-- ── MAIN LAYOUT ── -->
    <div class="container">
        <div class="main-layout">

            <!-- Left Sidebar -->
            <?php include __DIR__ . '/../include/nsidebar.php'; ?>

            <!-- Right Content -->
            <section class="main-content">

                <?php if ($pageData): ?>
                <div class="content-card">
                    <h2 class="section-heading font-poppins">
                        <?= htmlspecialchars($pageData['title']) ?>
                    </h2>

                    <?php if (!empty($pageData['description'])): ?>
                    <div class="content-body">
                        <?= $pageData['description'] ?>
                    </div>
                    <?php else: ?>
                    <p style="color:var(--gray-600);font-style:italic;">No content has been added to this page yet.</p>
                    <?php endif; ?>
                </div>

                <?php else: ?>
                <div class="content-card">
                    <div class="not-found-state">
                        <div class="not-found-icon"><i class="fas fa-file-times"></i></div>
                        <h2>Oops! Page not found</h2>
                        <p>The page <code style="background:var(--gray-100);padding:.2rem .6rem;border-radius:6px;color:var(--primary);"><?= htmlspecialchars($slug) ?></code> doesn't exist or is not published.</p>
                        <a href="/journals/<?= htmlspecialchars($journalSlug ?: 'social-science') ?>/" class="btn-primary">
                            <i class="fas fa-arrow-left"></i> Go to Journal
                        </a>
                    </div>
                </div>
                <?php endif; ?>

            </section>
        </div>
    </div>

</main>

<script>
function filterDisciplines() {
    const searchInput = document.getElementById('disciplineSearch').value.toLowerCase();
    const disciplineCards = document.querySelectorAll('.discipline-card');
    const categories = document.querySelectorAll('.discipline-category');
    disciplineCards.forEach(card => {
        const text = card.textContent.toLowerCase();
        card.style.display = text.includes(searchInput) ? 'block' : 'none';
    });
    categories.forEach(category => {
        const visibleCards = category.querySelectorAll('.discipline-card[style="display: block;"]');
        category.style.display = (visibleCards.length === 0 && searchInput !== '') ? 'none' : 'block';
    });
}
</script>

<?php include __DIR__ . '/../include/footer.php'; ?>