/* TradQor Academy Core Stylesheet */
:root {
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    transition: background-color 0.25s ease, color 0.25s ease;
    padding-bottom: 26px; /* Space for sticky AI notice */
}

/* Reading Progress Bar */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Brand icon box */
.brand-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}

.brand-icon-box.sm {
    width: 28px;
    height: 28px;
    font-size: 1rem;
    border-radius: 8px;
}

.academy-badge {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.text-gradient {
    background: linear-gradient(135deg, #60a5fa, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism navbar */
.backdrop-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-bs-theme="dark"] .main-navbar {
    background-color: rgba(11, 15, 25, 0.85);
}

[data-bs-theme="light"] .main-navbar {
    background-color: rgba(255, 255, 255, 0.88);
}

/* Code Snippets & Highlighting */
pre {
    position: relative;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

pre code {
    font-family: var(--font-mono) !important;
    font-size: 0.88rem !important;
    padding: 1.25rem !important;
    border-radius: 10px;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Sticky Table of Contents */
.toc-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.toc-link {
    display: block;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.toc-link:hover, .toc-link.active {
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

/* Interactive Widgets Container */
.interactive-widget-box {
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin: 2rem 0;
}

.interactive-header {
    padding: 0.85rem 1.25rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.interactive-body {
    padding: 1.5rem;
}

/* Orderbook Canvas & Rows */
.orderbook-table {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.ob-row-bid {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.12));
    color: #10b981;
}

.ob-row-ask {
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.12));
    color: #ef4444;
}

/* Concept Cards */
.concept-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.concept-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

/* Formula Callouts */
.formula-block {
    background: var(--bs-tertiary-bg);
    border-left: 4px solid var(--bs-info);
    padding: 0.85rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-size: 1.05rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.formula-block .katex-display {
    margin: 0.25rem 0;
}

/* Deep-dive Content Typography */
.content-section {
    font-size: 1.05rem;
}

.content-section h2 {
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.content-section h3 {
    font-weight: 600;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.content-section p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.content-section ul, .content-section ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

/* Fixed Bottom AI Notice */
.fixed-bottom-ai-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    line-height: 1.4;
    pointer-events: none;
    letter-spacing: 0.2px;
}

[data-bs-theme="light"] .fixed-bottom-ai-notice {
    background: rgba(248, 250, 252, 0.94);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.x-small {
    font-size: 0.75rem;
}

