/**
 * مرجع جامع هوش مصنوعی و تحلیل داده
 * مؤلف و ناشر دیجیتال: بختیار آهنی (bakhtyarahani.com)
 * استایل‌شیت رسمی، مستقل، ریسپانسیو و مدرن (Vanilla CSS)
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Light Theme Palette */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #4f46e5;
    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #e11d48;
    --danger-bg: #fff1f2;
    --code-bg: #0f172a;
    --code-text: #f8fafc;
    --sidebar-width: 320px;
    --header-height: 64px;
    --content-max-width: 900px;
    --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);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --gradient-primary: linear-gradient(135deg, #2563eb, #4f46e5);
    --gradient-accent: linear-gradient(135deg, #f59e0b, #ea580c);
}

[data-theme="dark"] {
    --bg-main: #090d16;
    --bg-card: #131b2e;
    --bg-sidebar: #0f172a;
    --bg-input: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border-color: #1e293b;
    --border-subtle: #172033;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.12);
    --accent: #6366f1;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --code-bg: #020617;
    --code-text: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #6366f1);
    --gradient-accent: linear-gradient(135deg, #f59e0b, #f97316);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.9;
    font-size: 16px;
    direction: rtl;
    text-align: right;
    transition: background-color 0.2s ease, color 0.2s ease;
    overflow-x: hidden;
}

/* Header Navbar */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.92);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s ease;
    white-space: nowrap;
    min-width: 0;
}

.brand-title-full {
    display: inline;
}

.brand-title-mobile {
    display: none;
}

.brand-link:hover {
    color: var(--primary);
}

.author-link {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.author-link:hover {
    background: var(--primary);
    color: #ffffff;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.control-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop,
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 899;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active,
.sidebar-overlay.active,
.sidebar-backdrop.open,
.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-mobile-title {
    font-weight: 800;
    font-size: 14.5px;
    color: var(--primary);
}

.sidebar-close-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    z-index: 999;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s ease;
}

/* Layout */
.layout-container,
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
    position: relative;
    width: 100%;
}

/* Sidebar */
.sidebar,
.sidebar-drawer {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    right: 0;
    overflow-y: auto;
    padding: 20px 16px;
    z-index: 900;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar,
.sidebar-drawer::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-drawer::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar-search-box {
    margin-bottom: 16px;
}

.sidebar-search-input {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.sidebar-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-group {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.sidebar-group:last-child {
    border-bottom: none;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.sidebar-group-header:hover {
    background: var(--bg-input);
    color: var(--text-main);
}

.sidebar-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.sidebar-arrow.collapsed {
    transform: rotate(90deg);
}

.sidebar-sublinks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 8px;
    padding-right: 8px;
    border-right: 2px solid var(--border-color);
    margin-top: 4px;
}

.sidebar-sublinks.hidden {
    display: none;
}

.sidebar-link {
    display: block;
    padding: 7px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.45;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: normal;
    word-break: break-word;
}

.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-right: 3px solid var(--primary);
    margin-right: -10px;
    padding-right: 7px;
}

.sidebar-master-link {
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-input);
    margin-bottom: 6px;
}

.sidebar-master-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Main Content Wrapper */
.main-wrapper,
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    padding: 36px 36px 80px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% - var(--sidebar-width));
}

.content-container {
    width: 100%;
    max-width: var(--content-max-width);
}

/* Breadcrumbs */
.breadcrumb-nav {
    margin-bottom: 20px;
    font-size: 13.5px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--border-color);
    margin: 0 2px;
}

/* Page Hero Banner */
.page-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0f172a 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.page-hero h1 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 12px;
    line-height: 1.5;
}

.page-hero p {
    font-size: 15.5px;
    line-height: 1.8;
    color: #e2e8f0;
    margin-bottom: 0;
}

.badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.hero-meta-row {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-gold {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-green {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Article Interaction Toolbar */
.article-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reading-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.action-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Article Card Body */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 42px 40px;
    box-shadow: var(--shadow-sm);
}

.article-content h1 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--text-main);
    line-height: 1.5;
}

.article-content h2 {
    font-size: 21px;
    font-weight: 800;
    margin: 36px 0 16px 0;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-content h3 {
    font-size: 17.5px;
    font-weight: 700;
    margin: 28px 0 12px 0;
    color: var(--text-main);
}

.article-content h4 {
    font-size: 15.5px;
    font-weight: 700;
    margin: 22px 0 10px 0;
    color: var(--text-muted);
}

.article-content p {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 16px;
}

.article-content ul, .article-content ol {
    margin: 12px 0 20px 24px;
    color: var(--text-muted);
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    color: var(--text-main);
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 32px 0;
}

/* Blockquotes & Callouts */
.article-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--primary-light);
    border-right: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.8;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14.5px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-content th {
    background: var(--bg-input);
    color: var(--text-main);
    font-weight: 700;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: right;
}

.article-content td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.article-content tr:nth-child(even) {
    background: var(--bg-input);
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 20px 0;
}

code {
    font-family: var(--font-mono);
    font-size: 13.5px;
}

p code, li code {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    direction: ltr;
    display: inline-block;
}

/* ============================================================
   INTERACTIVE JAVASCRIPT QUIZ ENGINE STYLES
   ============================================================ */
.interactive-quiz-container {
    margin: 32px 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
}

.quiz-container-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.quiz-container-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.interactive-quiz-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    margin-bottom: 22px;
    transition: all 0.2s ease;
}

.interactive-quiz-item:hover {
    border-color: var(--primary);
}

.quiz-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quiz-q-num {
    font-weight: 800;
    font-size: 14.5px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.quiz-q-type {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
}

.quiz-question-text {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 16px;
}

.quiz-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.quiz-option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-radio {
    margin-top: 4px;
    cursor: pointer;
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
}

.quiz-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 13px;
}

.quiz-opt-text {
    flex: 1;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-main);
}

/* Feedback highlighting for options */
.quiz-option-label.option-correct {
    background: var(--success-bg) !important;
    border-color: var(--success) !important;
    color: var(--success);
}

.quiz-option-label.option-correct .quiz-opt-letter {
    background: var(--success);
    color: #ffffff;
}

.quiz-option-label.option-user-wrong {
    background: var(--danger-bg) !important;
    border-color: var(--danger) !important;
    color: var(--danger);
}

.quiz-option-label.option-user-wrong .quiz-opt-letter {
    background: var(--danger);
    color: #ffffff;
}

/* Quiz Item Feedback Explanation Box */
.quiz-feedback-box {
    margin-top: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.quiz-feedback-box.hidden {
    display: none;
}

.quiz-feedback-header {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
}

.quiz-feedback-header.correct {
    background: var(--success-bg);
    color: var(--success);
    border-bottom: 1px solid rgba(5, 150, 105, 0.2);
}

.quiz-feedback-header.wrong {
    background: var(--danger-bg);
    color: var(--danger);
    border-bottom: 1px solid rgba(225, 29, 72, 0.2);
}

.quiz-feedback-header.unans {
    background: var(--warning-bg);
    color: var(--warning);
    border-bottom: 1px solid rgba(217, 119, 6, 0.2);
}

.quiz-explanation-content {
    background: var(--bg-card);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Quiz Action Buttons Bar */
.quiz-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-submit-quiz {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.btn-submit-quiz:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset-quiz {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-quiz:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-reveal-all {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reveal-all:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.hidden {
    display: none !important;
}

/* Instant Report Card Component */
.quiz-report-card {
    margin-top: 30px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeInReport 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInReport {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.report-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.report-qualitative-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
}

.badge-excellent {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-good {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.badge-average {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-needs-work {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.report-card-body {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.report-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-score-percent {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.score-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    font-weight: 600;
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex: 1;
    min-width: 240px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
}

.stat-item .stat-label {
    font-size: 11.5px;
    color: var(--text-light);
}

.stat-item.correct .stat-value { color: var(--success); }
.stat-item.wrong .stat-value { color: var(--danger); }
.stat-item.unans .stat-value { color: var(--warning); }
.stat-item.total .stat-value { color: var(--primary); }

.report-advice-message {
    background: var(--bg-card);
    border-right: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-main);
}

/* ============================================================
   FAQ ACCORDION & CARDS STYLES (SEO / FAQPage Schema)
   ============================================================ */
.faq-section {
    margin: 40px 0 20px 0;
    border-top: 2px dashed var(--border-color);
    padding-top: 30px;
}

.faq-section h2 {
    border-bottom: none;
    margin-top: 0;
    padding-bottom: 0;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.faq-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question-btn {
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.faq-icon {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer-content {
    display: none;
    padding: 0 20px 18px 20px;
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
}

.faq-item.open .faq-answer-content {
    display: block;
}

/* ============================================================
   GLOSSARY / DICTIONARY PAGE STYLES
   ============================================================ */
.glossary-search-container {
    margin-bottom: 24px;
}

.glossary-search-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.glossary-search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.glossary-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.glossary-filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.glossary-filter-btn:hover, .glossary-filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.glossary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.glossary-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.glossary-card-header {
    margin-bottom: 10px;
}

.glossary-term-fa {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.glossary-term-en {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--primary);
    direction: ltr;
    text-align: right;
}

.glossary-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-input);
    color: var(--text-light);
    margin-top: 6px;
}

.glossary-def {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 10px 0 14px 0;
}

.glossary-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.glossary-link:hover {
    text-decoration: underline;
}

/* Navigation Cards (Prev / Next) */
.pagination-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 36px;
    width: 100%;
}

.pagination-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pagination-label {
    font-size: 12px;
    color: var(--text-light);
}

.pagination-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary);
}

.pagination-btn.next {
    text-align: left;
}

/* Floating Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 36px 24px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-light);
    background: var(--bg-card);
    margin-top: 50px;
    width: 100%;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Mobile & Tablet Responsive Engine */
@media (max-width: 1024px) {
    .main-wrapper {
        padding: 24px 18px 60px 18px;
    }
    .article-card {
        padding: 28px 20px;
    }
    .report-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .glossary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    :root {
        --header-height: 58px;
    }
    .site-header {
        height: 58px;
        padding: 0 16px;
    }
    .layout-container,
    .layout-wrapper {
        padding-top: 58px;
    }
    .reading-progress {
        top: 58px;
    }
    .author-link {
        display: none !important;
    }
    .hamburger-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: var(--bg-input);
    }
    .sidebar,
    .sidebar-drawer {
        top: 58px;
        width: min(320px, 85vw);
        transform: translateX(100%);
        box-shadow: none;
    }
    .sidebar.open,
    .sidebar.active,
    .sidebar-drawer.open,
    .sidebar-drawer.active {
        transform: translateX(0);
        box-shadow: -4px 0 25px rgba(0, 0, 0, 0.35);
    }
    .sidebar-mobile-header {
        display: flex;
    }
    .main-wrapper,
    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 24px 16px 60px 16px;
    }
    .pagination-container {
        grid-template-columns: 1fr;
    }
    .page-hero {
        padding: 26px 18px;
    }
    .page-hero h1 {
        font-size: 21px;
    }
    .report-card-body {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .brand-title-full {
        display: none !important;
    }
    .brand-title-mobile {
        display: inline !important;
        font-size: 14.5px;
        font-weight: 800;
        white-space: nowrap;
    }
    .brand-link {
        font-size: 14px;
        gap: 6px;
    }
    .header-controls {
        gap: 5px;
    }
    .control-btn {
        padding: 6px 9px;
        font-size: 14px;
        min-width: 34px;
        justify-content: center;
    }
    .control-btn .btn-text {
        display: none !important;
    }
    .site-header {
        padding: 0 12px;
    }

    /* Breadcrumbs on mobile: horizontal scroll without ugly wrap */
    .breadcrumb-nav {
        margin-bottom: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .breadcrumb-nav::-webkit-scrollbar {
        display: none;
    }
    .breadcrumb-list {
        flex-wrap: nowrap;
        white-space: nowrap;
        font-size: 12.5px;
    }
    .breadcrumb-item {
        flex-shrink: 0;
    }

    /* Article Toolbar */
    .article-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
        margin-bottom: 18px;
    }
    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    .reading-time-badge {
        width: 100%;
        text-align: center;
        display: block;
        padding: 6px 10px;
        background: var(--bg-input);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        font-size: 12.5px;
    }
    .toolbar-badges {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
        width: 100%;
    }
    .toolbar-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .toolbar-right .action-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12.5px;
    }

    /* Main Content Typography & Cards */
    .main-wrapper {
        padding: 14px 10px 48px 10px;
    }
    .article-card {
        padding: 18px 14px;
        border-radius: var(--radius-md);
    }
    .page-hero {
        padding: 22px 14px;
    }
    .page-hero h1 {
        font-size: 19px;
        line-height: 1.45;
    }
    .page-hero p {
        font-size: 13px;
        line-height: 1.65;
    }
    .article-content h1 {
        font-size: 20px;
        line-height: 1.45;
        margin-bottom: 12px;
    }
    .article-content h2 {
        font-size: 17px;
        line-height: 1.45;
        margin-top: 24px;
        margin-bottom: 10px;
    }
    .article-content h3 {
        font-size: 15px;
        line-height: 1.45;
        margin-top: 18px;
    }
    .article-content p, 
    .article-content li {
        font-size: 14.5px;
        line-height: 1.85;
    }
    .article-content blockquote {
        margin: 14px 0;
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Responsive Tables & Math Formulas */
    .article-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
        margin: 16px 0;
    }
    .article-content pre {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 13px;
    }
    mjx-container {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Quiz Component */
    .interactive-quiz-container {
        padding: 16px 12px;
        margin: 20px 0;
        border-radius: var(--radius-md);
    }
    .quiz-container-title {
        font-size: 14px;
    }
    .quiz-container-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .interactive-quiz-item {
        padding: 14px 10px;
    }
    .quiz-question-text {
        font-size: 14px;
        line-height: 1.7;
    }
    .quiz-option-label {
        padding: 10px 10px;
        gap: 8px;
        min-height: 44px;
    }
    .quiz-opt-letter {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 11px;
    }
    .quiz-opt-text {
        font-size: 13px;
        line-height: 1.6;
    }
    .quiz-actions-bar {
        flex-direction: column;
        gap: 8px;
    }
    .quiz-actions-bar .btn {
        width: 100%;
        justify-content: center;
        padding: 11px 14px;
        font-size: 13.5px;
    }
    .quiz-report-card {
        padding: 18px 12px;
    }
    .report-card-body {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .report-score-circle {
        width: 84px;
        height: 84px;
    }
    .report-score-percent {
        font-size: 24px;
    }
    .report-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }
    .stat-item {
        padding: 8px 4px;
    }
    .stat-value {
        font-size: 17px;
    }
    .stat-label {
        font-size: 10.5px;
    }
    .report-advice-message {
        font-size: 13px;
        line-height: 1.65;
    }

    /* Homepage Components */
    .hero-lead {
        font-size: 14px;
        line-height: 1.75;
    }
    .hero-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .stat-card {
        padding: 12px 10px;
    }
    .stat-num {
        font-size: 24px;
    }
    .stat-label {
        font-size: 11.5px;
    }
    .hero-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .features-grid, 
    .study-paths-grid, 
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .roadmap-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 14px -14px;
        padding: 0 14px;
    }
    .roadmap-table {
        font-size: 12.5px;
    }
    .author-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 14px;
        gap: 12px;
    }
    .author-avatar {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    .alphabet-filter {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 6px;
    }
    .filter-letter {
        flex-shrink: 0;
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .brand-title-mobile {
        font-size: 13px !important;
    }
    .stat-value {
        font-size: 15px;
    }
    .quiz-opt-text {
        font-size: 12.5px;
    }
    .control-btn {
        padding: 5px 7px;
        font-size: 13px;
    }
}

/* Print Stylesheet */
@media print {
    .site-header, .sidebar, .reading-progress, .back-to-top, .pagination-container, .hamburger-btn, .article-toolbar, .quiz-actions-bar {
        display: none !important;
    }
    .main-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .article-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
        line-height: 1.6;
    }
    .quiz-feedback-box {
        display: block !important;
    }
    .faq-answer-content {
        display: block !important;
    }
}


/* ==========================================
   HOMEPAGE ENHANCED COMPONENTS
   ========================================== */
.hero-lead {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-muted);
    max-width: 820px;
    margin-bottom: 20px;
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 4px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff !important;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary) !important;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
}

.features-section {
    margin-bottom: 36px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: var(--shadow-sm);
}

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

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 15.5px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.feature-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.roadmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
    margin: 0 !important;
}

.roadmap-table th {
    background: var(--bg-input);
    color: var(--text-main);
    padding: 12px 14px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    text-align: right;
}

.roadmap-table td {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    vertical-align: middle;
}

.roadmap-table tr:hover {
    background: var(--primary-light);
}

.table-action-link {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 12.5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.table-action-link:hover {
    background: var(--primary);
    color: #ffffff;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.role-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    border-top: 3px solid var(--primary);
}

.role-box h4 {
    font-size: 14.5px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.role-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0;
}

.author-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-main) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 36px;
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    flex-shrink: 0;
}

.author-info h3 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
}

.author-info p {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================================
   TOAST NOTIFICATION (FLOATING SNACKBAR)
   ============================================================ */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.45);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

[data-theme="light"] .toast-notification {
    background: rgba(30, 41, 59, 0.94);
    color: #ffffff;
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.25);
}

/* ============================================================
   INTERACTIVE SHARE MODAL
   ============================================================ */
.share-modal-container {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.share-modal-container.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.share-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9991;
}

.share-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 92%;
    max-width: 480px;
    padding: 24px;
    z-index: 9992;
    direction: rtl;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal-container.open .share-modal-dialog {
    transform: translate(-50%, -50%) scale(1);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.share-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.share-modal-close {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-modal-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.share-modal-topic {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.share-copy-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-url-input {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-main);
    direction: ltr;
    text-align: left;
    outline: none;
    font-family: inherit;
}

.share-url-input:focus {
    border-color: var(--primary);
}

.share-copy-btn {
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
}

.share-networks-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.share-networks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.share-network-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.share-network-btn:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.share-network-btn.tg {
    background: #0088cc;
    color: #ffffff;
}

.share-network-btn.wa {
    background: #25d366;
    color: #ffffff;
}

.share-network-btn.eitaa {
    background: #ff7900;
    color: #ffffff;
}

.share-network-btn.bale {
    background: #0076a8;
    color: #ffffff;
}

.share-network-btn.x {
    background: #111827;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    grid-column: span 2;
}

@media (max-width: 480px) {
    .share-modal-dialog {
        padding: 18px;
        width: 95%;
    }
    .share-networks-grid {
        grid-template-columns: 1fr 1fr;
    }
    .toast-notification {
        width: 90%;
        max-width: 340px;
        white-space: normal;
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* ============================================================
   TOPIC INFOGRAPHIC & ARCHITECTURAL DIAGRAM
   ============================================================ */
.topic-infographic {
    margin: 0 0 28px 0;
    text-align: center;
}

.infographic-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.35);
    background: var(--bg-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.infographic-wrapper:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 45px -8px rgba(37, 99, 235, 0.25);
}

.infographic-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.infographic-overlay {
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
    flex-wrap: wrap;
}

[data-theme="light"] .infographic-overlay {
    background: rgba(248, 250, 252, 0.92);
    border-top: 1px solid var(--border-color);
}

.infographic-caption-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="light"] .infographic-caption-title {
    color: var(--text-main);
}

.infographic-caption-title span {
    font-size: 16px;
}

.infographic-view-btn {
    text-decoration: none;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary) !important;
    border: 1px solid var(--border-color);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.infographic-view-btn:hover {
    background: var(--primary);
    color: #ffffff !important;
}

.topic-infographic figcaption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 600px) {
    .infographic-overlay {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }
    .infographic-view-btn {
        align-self: flex-end;
    }
}

/* ============================================================
   SEARCH INTENT BANNER (SEO Intent & User Goal)
   ============================================================ */
.search-intent-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-right: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.search-intent-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.search-intent-content {
    flex-grow: 1;
}

.search-intent-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-intent-query {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text-main);
}

/* ============================================================
   HUMAN EXPERT LAYER & E-E-A-T AUTHOR CARD
   ============================================================ */
.expert-author-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin: 36px 0 28px 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.expert-author-card:hover {
    border-color: var(--primary);
    box-shadow: 0 14px 30px -5px rgba(37, 99, 235, 0.15);
}

.expert-author-badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.expert-author-badge {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.expert-disclosure-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.expert-author-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.expert-avatar-box {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    border: 3px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.expert-author-info {
    flex-grow: 1;
}

.expert-author-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.expert-author-role {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.expert-author-desc {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.expert-author-disclosure {
    font-size: 12.5px;
    line-height: 1.7;
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-light);
    margin-bottom: 14px;
}

.expert-author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.expert-author-link:hover {
    color: var(--primary-dark);
    transform: translateX(-3px);
}

@media (max-width: 600px) {
    .expert-author-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .expert-author-badge-row {
        justify-content: center;
    }
    .expert-author-link {
        justify-content: center;
    }
}

/* ============================================================
   SCIENTIFIC REFERENCES SECTION (SEO Strategy #5)
   ============================================================ */
.scientific-references-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin: 32px 0 24px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.scientific-references-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.scientific-references-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.scientific-references-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reference-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.7;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}

.reference-item:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.reference-source-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    flex-shrink: 0;
    margin-top: 2px;
}

.reference-content {
    flex-grow: 1;
    color: var(--text-muted);
}

.reference-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.reference-link:hover {
    text-decoration: underline;
}

/* Optimized Infographics & Responsive Image Presentation */
.infographic-figure {
    margin: 32px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.infographic-figure:hover {
    box-shadow: var(--shadow-lg);
}

.infographic-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 675;
    display: block;
    object-fit: cover;
}

.infographic-caption {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
    line-height: 1.7;
}


/* ==========================================================================
   V2 SEO-FIRST ARCHITECTURE COMPONENTS (CROSS-TOPICS, RESOURCES, AUTHOR)
   ========================================================================== */

.related-topics-section {
    margin: 40px 0 20px 0;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.related-topics-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.related-topic-card {
    display: block;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s ease;
}

.related-topic-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px -8px rgba(37, 99, 235, 0.25);
}

.related-topic-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary);
    color: #ffffff;
    border-radius: 9999px;
    margin-bottom: 8px;
}

.related-topic-heading {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    line-height: 1.45;
}

.related-topic-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Resources Hub */
.resources-category-section {
    margin-bottom: 40px;
}

.resources-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.resources-category-icon {
    font-size: 1.8rem;
}

.resources-category-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.resources-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.resource-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.resource-item-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
}

.resource-source-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    margin-bottom: 10px;
}

.resource-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
    line-height: 1.45;
}

.resource-item-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.resource-item-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: auto;
}

.resource-item-link:hover {
    text-decoration: underline;
}

/* Author Profile Hub */
.author-profile-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-bottom: 40px;
}

.author-hero-flex {
    display: flex;
    gap: 28px;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.author-avatar-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 0 12px 30px -5px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.author-credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.author-cred-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.author-cred-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.author-cred-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.author-social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.author-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-social-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   SIDEBAR ACCORDIONS & MODERN DRAWER TOPICS
   ========================================================================== */
.sidebar-chapter-accordion {
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    overflow: hidden;
}

.sidebar-chapter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-input);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    transition: background 0.15s ease, color 0.15s ease;
    list-style: none;
}

.sidebar-chapter-summary::-webkit-details-marker {
    display: none;
}

.sidebar-chapter-summary:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-chapter-summary.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.chapter-summary-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chapter-num-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--primary);
    color: #ffffff;
    border-radius: 4px;
    flex-shrink: 0;
}

.chapter-title-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
}

.chapter-title-link:hover {
    color: var(--primary);
}

.accordion-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.sidebar-chapter-accordion[open] .accordion-arrow {
    transform: rotate(180deg);
}

.sidebar-topic-list {
    list-style: none;
    padding: 4px 8px 8px 8px;
    margin: 0;
    background: var(--bg-card);
}

.sidebar-topic-item {
    margin: 2px 0;
}

.sidebar-topic-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    line-height: 1.4;
}

.sidebar-topic-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(-2px);
}

.sidebar-topic-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-right: 2px solid var(--primary);
}

.topic-num-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-topic-link.active .topic-num-dot {
    background: var(--primary);
    color: #ffffff;
}

.topic-title-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   HOMEPAGE & HERO SECTION
   ========================================================================== */
.homepage-hero {
    text-align: center;
    padding: 40px 24px 32px 24px;
    margin-bottom: 40px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-main) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.hero-main-title {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 900;
    color: var(--text-main);
    margin: 16px 0 14px 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.hero-lead-text {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto 24px auto;
    line-height: 1.8;
}

.hero-actions-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.hero-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff !important;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    box-shadow: 0 8px 25px -6px rgba(37, 99, 235, 0.4);
    transition: all 0.25s ease;
}

.hero-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -6px rgba(37, 99, 235, 0.6);
}


.hero-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--bg-card);
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hero-secondary-btn:hover {
    background: var(--primary-light);
    color: var(--primary) !important;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.home-section {
    margin-bottom: 48px;
    width: 100%;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

/* ==========================================================================
   CURRICULUM & ROADMAP CARDS
   ========================================================================== */
.curriculum-grid,
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.curriculum-card,
.roadmap-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.03);
}

.curriculum-card:hover,
.roadmap-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px -8px rgba(37, 99, 235, 0.15);
}

.curriculum-card-header,
.roadmap-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.curriculum-num,
.roadmap-num-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.curriculum-title,
.roadmap-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
}

.curriculum-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.curriculum-title a:hover {
    color: var(--primary);
}

.curriculum-desc,
.roadmap-card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 16px 0;
    flex: 1;
}

.curriculum-topics-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

.curriculum-topics-list li {
    margin-bottom: 6px;
}

.curriculum-topics-list li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.curriculum-topics-list li a:hover {
    background: var(--primary-light);
    color: var(--primary);
    padding-right: 12px;
}

.curriculum-footer {
    margin-top: auto;
}

.curriculum-btn,
.roadmap-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.curriculum-btn:hover,
.roadmap-link:hover {
    gap: 10px;
    text-decoration: underline;
}

/* ==========================================================================
   GLOSSARY FILTER & CATEGORIES
   ========================================================================== */
.glossary-filter-container {
    margin-bottom: 28px;
    width: 100%;
}

.glossary-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.glossary-cat-btn {
    padding: 7px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.glossary-cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.glossary-cat-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}



/* ==========================================================================
   ENHANCED POLISH & VISUAL EXCELLENCE (COVER, BRAND & MICRO-INTERACTIONS)
   ========================================================================== */
.brand-logo {
    font-size: 1.6rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.25));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-link:hover .brand-logo {
    transform: scale(1.1) rotate(6deg);
}

.hero-cover-container {
    margin: 36px auto 16px auto;
    text-align: center;
    max-width: 880px;
    position: relative;
}

.hero-cover-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.35);
    display: block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.hero-cover-img:hover {
    transform: translateY(-4px) scale(1.008);
    box-shadow: 0 25px 55px -10px rgba(37, 99, 235, 0.35);
}

.pagination-btn.prev {
    text-align: right;
    justify-content: flex-start;
}

.pagination-btn.next {
    text-align: left;
    justify-content: flex-end;
}

/* Enhanced details/summary smooth styling */
.sidebar-chapter-accordion summary {
    outline: none;
}

.sidebar-chapter-accordion summary:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.sidebar-topic-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Smooth scrollbar refinement */
.sidebar-drawer,
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
