/**
 * FCA Knowledge Base - VitePress-Inspired Styles
 * Follows Fluent Community design system with CSS variable fallbacks
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    /* Layout dimensions */
    --fca-kb-sidebar-width: 272px;
    --fca-kb-toc-width: 224px;
    --fca-kb-content-max-width: 740px;
    --fca-kb-nav-height: 64px;

    /* Colors with FC fallbacks */
    --fca-kb-bg: var(--fcom-primary-bg, #ffffff);
    --fca-kb-bg-alt: var(--fcom-secondary-bg, #f6f6f7);
    --fca-kb-bg-soft: var(--fcom-active-bg, #f9f9f9);
    --fca-kb-border: var(--fcom-primary-border, #e2e2e3);
    --fca-kb-divider: var(--fcom-primary-border, #e2e2e3);

    /* Text colors */
    --fca-kb-text-1: var(--fcom-primary-text, #213547);
    --fca-kb-text-2: var(--fcom-secondary-text, #475569);
    --fca-kb-text-3: #94a3b8;

    /* Brand colors */
    --fca-kb-brand: var(--fcom-text-link, #3b82f6);
    --fca-kb-brand-light: #60a5fa;
    --fca-kb-brand-dark: #2563eb;

    /* Semantic colors */
    --fca-kb-tip: #10b981;
    --fca-kb-tip-bg: rgba(16, 185, 129, 0.1);
    --fca-kb-warning: #f59e0b;
    --fca-kb-warning-bg: rgba(245, 158, 11, 0.1);
    --fca-kb-danger: #ef4444;
    --fca-kb-danger-bg: rgba(239, 68, 68, 0.1);
    --fca-kb-info: #3b82f6;
    --fca-kb-info-bg: rgba(59, 130, 246, 0.1);

    /* Code */
    --fca-kb-code-bg: var(--fcom-code-bg, #f6f8fa);
    --fca-kb-code-border: #e2e2e3;

    /* Shadows */
    --fca-kb-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
    --fca-kb-shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07);
    --fca-kb-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --fca-kb-transition: 0.25s ease;
    --fca-kb-transition-fast: 0.15s ease;

    /* Typography */
    --fca-kb-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --fca-kb-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Border radius */
    --fca-kb-radius: 8px;
    --fca-kb-radius-sm: 4px;
    --fca-kb-radius-lg: 12px;
}

/* Dark Mode */
html.dark {
    --fca-kb-bg: var(--fcom-primary-bg, #1b1b1f);
    --fca-kb-bg-alt: var(--fcom-secondary-bg, #161618);
    --fca-kb-bg-soft: #242429;
    --fca-kb-border: var(--fcom-primary-border, #2e2e32);
    --fca-kb-divider: #2e2e32;

    --fca-kb-text-1: var(--fcom-primary-text, rgba(255, 255, 255, 0.87));
    --fca-kb-text-2: var(--fcom-secondary-text, rgba(235, 235, 245, 0.6));
    --fca-kb-text-3: rgba(235, 235, 245, 0.38);

    --fca-kb-code-bg: #2e2e32;
    --fca-kb-code-border: #3e3e42;

    --fca-kb-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.2);
    --fca-kb-shadow-2: 0 3px 12px rgba(0, 0, 0, 0.3);
    --fca-kb-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Base Layout
   ========================================================================== */

.fca-kb-root {
    height: calc(100vh - var(--fcom-header-height, 65px));
    overflow: hidden;
}

.fca-kb {
    font-family: var(--fca-kb-font-family);
    color: var(--fca-kb-text-1);
    background: var(--fcom-primary-bg, var(--fca-kb-bg));
    height: 100%;
}

/* Use secondary background on docs index page */
.fca-kb:has(.fca-kb-index) {
    background: var(--fcom-secondary-bg, var(--fca-kb-bg-alt));
}

.fca-kb *,
.fca-kb *::before,
.fca-kb *::after {
    box-sizing: border-box;
}

/* Main Layout Container */
.fca-kb-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Sidebar */
.fca-kb-sidebar {
    width: var(--fca-kb-sidebar-width);
    height: 100%;
    padding: 24px 24px 24px 32px;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--fca-kb-border);
    background: var(--fca-kb-bg);
    flex-shrink: 0;
}

.fca-kb-sidebar::-webkit-scrollbar {
    width: 6px;
}

.fca-kb-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.fca-kb-sidebar::-webkit-scrollbar-thumb {
    background: var(--fca-kb-border);
    border-radius: 3px;
}

.fca-kb-sidebar:hover::-webkit-scrollbar-thumb {
    background: var(--fca-kb-text-3);
}

/* Main Content */
.fca-kb-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 32px 48px 64px;
    overflow-y: auto;
    overflow-x: hidden;
}

.fca-kb-main::-webkit-scrollbar {
    width: 8px;
}

.fca-kb-main::-webkit-scrollbar-track {
    background: transparent;
}

.fca-kb-main::-webkit-scrollbar-thumb {
    background: var(--fca-kb-border);
    border-radius: 4px;
}

.fca-kb-main:hover::-webkit-scrollbar-thumb {
    background: var(--fca-kb-text-3);
}

/* Table of Contents (Right) */
.fca-kb-toc {
    width: var(--fca-kb-toc-width);
    height: 100%;
    padding: 32px 32px 32px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.fca-kb-toc::-webkit-scrollbar {
    width: 6px;
}

.fca-kb-toc::-webkit-scrollbar-track {
    background: transparent;
}

.fca-kb-toc::-webkit-scrollbar-thumb {
    background: var(--fca-kb-border);
    border-radius: 3px;
}

.fca-kb-toc:hover::-webkit-scrollbar-thumb {
    background: var(--fca-kb-text-3);
}

/* Full-width pages (index, search) */
.fca-kb-index,
.fca-kb-search {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.fca-kb-index::-webkit-scrollbar,
.fca-kb-search::-webkit-scrollbar {
    width: 8px;
}

.fca-kb-index::-webkit-scrollbar-track,
.fca-kb-search::-webkit-scrollbar-track {
    background: transparent;
}

.fca-kb-index::-webkit-scrollbar-thumb,
.fca-kb-search::-webkit-scrollbar-thumb {
    background: var(--fca-kb-border);
    border-radius: 4px;
}

.fca-kb-index:hover::-webkit-scrollbar-thumb,
.fca-kb-search:hover::-webkit-scrollbar-thumb {
    background: var(--fca-kb-text-3);
}

/* Content wrapper for centered content */
.fca-kb-content {
    max-width: var(--fca-kb-content-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Index page needs wider content area for card grids */
.fca-kb-index .fca-kb-content {
    max-width: 1100px;
}

/* ==========================================================================
   Hero Section (Home Page)
   ========================================================================== */

.fca-kb-hero {
    padding: 64px 0 48px;
    text-align: center;
    background: var(--fcom-secondary-bg, transparent);
}

.fca-kb-hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px;
    background: linear-gradient(135deg, var(--fca-kb-brand) 0%, var(--fca-kb-brand-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.fca-kb-hero-subtitle {
    font-size: 1.25rem;
    color: var(--fca-kb-text-2);
    margin: 0 0 40px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 400;
}

/* ==========================================================================
   Search
   ========================================================================== */

/* Search Bar */
.fca-kb-search-bar {
    display: flex;
    max-width: 560px;
    margin: 0 auto 48px;
    position: relative;
}

.fca-kb-search-input {
    flex: 1;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius);
    font-size: 14px;
    background: var(--fca-kb-bg);
    color: var(--fca-kb-text-1);
    transition: border-color var(--fca-kb-transition-fast), box-shadow var(--fca-kb-transition-fast);
}

.fca-kb-search-input:focus {
    outline: none;
    border-color: var(--fca-kb-brand);
    box-shadow: 0 0 0 3px var(--fca-kb-info-bg);
}

.fca-kb-search-input::placeholder {
    color: var(--fca-kb-text-3);
}

.fca-kb-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fca-kb-text-3);
    pointer-events: none;
}

.fca-kb-search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius-sm);
    font-size: 11px;
    font-family: var(--fca-kb-font-mono);
    color: var(--fca-kb-text-3);
    background: var(--fca-kb-bg-soft);
    pointer-events: none;
}

/* Search Modal */
.fca-kb-search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.fca-kb-search-modal {
    width: 100%;
    max-width: 560px;
    background: var(--fca-kb-bg);
    border-radius: var(--fca-kb-radius-lg);
    box-shadow: var(--fca-kb-shadow-3);
    overflow: hidden;
    margin: 0 16px;
}

.fca-kb-search-modal-header {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--fca-kb-border);
}

.fca-kb-search-modal-input {
    flex: 1;
    padding: 16px 0;
    border: none;
    font-size: 16px;
    background: transparent;
    color: var(--fca-kb-text-1);
    outline: none;
}

.fca-kb-search-modal-input::placeholder {
    color: var(--fca-kb-text-3);
}

.fca-kb-search-modal-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.fca-kb-search-modal-result {
    padding: 12px 16px;
    border-radius: var(--fca-kb-radius);
    cursor: pointer;
    transition: background var(--fca-kb-transition-fast);
}

.fca-kb-search-modal-result:hover,
.fca-kb-search-modal-result.active {
    background: var(--fca-kb-bg-soft);
}

.fca-kb-search-modal-result-title {
    font-weight: 500;
    color: var(--fca-kb-text-1);
    margin: 0 0 4px;
}

.fca-kb-search-modal-result-excerpt {
    font-size: 13px;
    color: var(--fca-kb-text-2);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fca-kb-search-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--fca-kb-border);
    font-size: 12px;
    color: var(--fca-kb-text-3);
    display: flex;
    gap: 16px;
}

.fca-kb-search-modal-footer kbd {
    padding: 2px 6px;
    background: var(--fca-kb-bg-soft);
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius-sm);
    font-family: var(--fca-kb-font-mono);
    font-size: 11px;
}

.fca-kb-search-modal-empty {
    padding: 32px;
    text-align: center;
    color: var(--fca-kb-text-3);
}

/* ==========================================================================
   Collection Cards
   ========================================================================== */

.fca-kb-collections-section {
    margin-bottom: 48px;
}

.fca-kb-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fca-kb-text-1);
    margin: 0 0 20px;
}

.fca-kb-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

@media (min-width: 960px) {
    .fca-kb-collection-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .fca-kb-collection-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fca-kb-collection-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 32px;
    padding-bottom: 48px; /* Extra space for arrow */
    background: var(--fca-kb-bg);
    border: 2px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius-lg);
    cursor: pointer;
    transition: all var(--fca-kb-transition);
    overflow: hidden;
}

.fca-kb-collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--fca-kb-brand) 0%, var(--fca-kb-brand-light) 100%);
    transform: translateY(-100%);
    transition: transform var(--fca-kb-transition);
}

.fca-kb-collection-card::after {
    content: '→';
    position: absolute;
    bottom: 24px;
    right: 32px;
    font-size: 1.5rem;
    color: var(--fca-kb-text-3);
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--fca-kb-transition);
}

.fca-kb-collection-card:hover {
    border-color: var(--fca-kb-brand);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-6px);
}

.fca-kb-collection-card:hover::before {
    transform: translateY(0);
}

.fca-kb-collection-card:hover::after {
    opacity: 1;
    transform: translateX(0);
    color: var(--fca-kb-brand);
}

.fca-kb-collection-card-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: var(--fca-kb-bg-soft);
    border-radius: var(--fca-kb-radius);
    margin-bottom: 24px;
    transition: transform var(--fca-kb-transition);
}

.fca-kb-collection-card:hover .fca-kb-collection-card-icon {
    transform: scale(1.08);
}

.fca-kb-collection-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fca-kb-text-1);
    margin: 0 0 12px;
    line-height: 1.3;
    transition: color var(--fca-kb-transition);
}

.fca-kb-collection-card:hover .fca-kb-collection-card-title {
    color: var(--fca-kb-brand);
}

.fca-kb-collection-card-description {
    font-size: 15px;
    color: var(--fca-kb-text-2);
    margin: 0 0 24px;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fca-kb-collection-card-count {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--fca-kb-bg-soft);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fca-kb-text-2);
    transition: all var(--fca-kb-transition);
}

.fca-kb-collection-card:hover .fca-kb-collection-card-count {
    background: var(--fca-kb-info-bg);
    color: var(--fca-kb-brand);
}

/* ==========================================================================
   Article Cards
   ========================================================================== */

.fca-kb-collections-section,
.fca-kb-articles-section {
    margin-bottom: 64px;
}

.fca-kb-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--fca-kb-text-1);
    margin: 0 0 32px;
    letter-spacing: -0.01em;
}

.fca-kb-article-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fca-kb-article-card {
    display: block;
    padding: 20px 24px;
    background: var(--fca-kb-bg);
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius-lg);
    cursor: pointer;
    transition: all var(--fca-kb-transition);
    text-decoration: none;
    position: relative;
}

.fca-kb-article-card::after {
    content: '→';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fca-kb-text-3);
    font-size: 18px;
    opacity: 0;
    transition: all var(--fca-kb-transition);
}

.fca-kb-article-card:hover {
    border-color: var(--fca-kb-brand);
    background: var(--fca-kb-bg-soft);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.fca-kb-article-card:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

.fca-kb-article-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.fca-kb-article-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fca-kb-text-1);
    margin: 0;
    flex: 1;
    line-height: 1.5;
    padding-right: 32px;
}

.fca-kb-article-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--fca-kb-info-bg);
    border: 1px solid var(--fca-kb-border);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    color: var(--fca-kb-text-2);
    white-space: nowrap;
}

.fca-kb-article-card-badge-icon {
    font-size: 12px;
}

.fca-kb-article-card-excerpt {
    font-size: 14px;
    color: var(--fca-kb-text-2);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Recent Articles Section
   ========================================================================== */

.fca-kb-recent-section {
    margin-top: 64px;
    margin-bottom: 64px;
}

.fca-kb-recent-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.fca-kb-recent-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--fca-kb-bg);
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius-lg);
    cursor: pointer;
    transition: all var(--fca-kb-transition);
    gap: 16px;
}

.fca-kb-recent-card:hover {
    background: var(--fca-kb-bg-soft);
    border-color: var(--fca-kb-brand);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.fca-kb-recent-card-content {
    flex: 1;
    min-width: 0;
}

.fca-kb-recent-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--fca-kb-text-1);
    line-height: 1.4;
}

.fca-kb-recent-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--fca-kb-text-3);
    flex-wrap: wrap;
}

.fca-kb-recent-card-collection {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--fca-kb-info-bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--fca-kb-text-2);
}

.fca-kb-recent-card-icon {
    font-size: 14px;
    line-height: 1;
}

.fca-kb-recent-card-date {
    color: var(--fca-kb-text-3);
}

.fca-kb-recent-card-arrow {
    color: var(--fca-kb-text-3);
    font-size: 18px;
    flex-shrink: 0;
    transition: all var(--fca-kb-transition);
}

.fca-kb-recent-card:hover .fca-kb-recent-card-arrow {
    color: var(--fca-kb-brand);
    transform: translateX(4px);
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.fca-kb-sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--fca-kb-text-3);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    z-index: 10;
    transition: color var(--fca-kb-transition-fast);
}

.fca-kb-sidebar-close:hover {
    color: var(--fca-kb-text-1);
}

.fca-kb-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--fca-kb-border);
    margin-bottom: 12px;
}

.fca-kb-sidebar-icon {
    font-size: 24px;
    line-height: 1;
}

.fca-kb-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fca-kb-text-1);
    margin: 0;
    letter-spacing: -0.01em;
}

.fca-kb-sidebar-nav {
    padding: 0;
}

.fca-kb-sidebar-group {
    margin-bottom: 8px;
}

.fca-kb-sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--fca-kb-text-2);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all var(--fca-kb-transition-fast);
    border-radius: var(--fca-kb-radius-sm);
}

.fca-kb-sidebar-group-header:hover {
    background: var(--fca-kb-bg-soft);
    color: var(--fca-kb-text-1);
}

.fca-kb-sidebar-group-icon {
    font-size: 10px;
    opacity: 0.6;
    width: 12px;
    text-align: center;
    transition: transform var(--fca-kb-transition-fast);
}

.fca-kb-sidebar-group-title {
    flex: 1;
}

.fca-kb-sidebar-group-count {
    font-size: 11px;
    color: var(--fca-kb-text-3);
    font-weight: 500;
    padding: 2px 6px;
    background: var(--fca-kb-bg-soft);
    border-radius: 9999px;
}

.fca-kb-sidebar-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.fca-kb-sidebar-item {
    margin: 0;
}

.fca-kb-sidebar-link {
    display: block;
    padding: 8px 16px 8px 36px;
    color: var(--fca-kb-text-2);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: all var(--fca-kb-transition-fast);
    border-left: 2px solid transparent;
    position: relative;
}

.fca-kb-sidebar-link:hover {
    color: var(--fca-kb-text-1);
    background: var(--fca-kb-bg-soft);
}

.fca-kb-sidebar-link.is-active {
    color: var(--fca-kb-brand);
    background: var(--fca-kb-info-bg);
    border-left-color: var(--fca-kb-brand);
    font-weight: 500;
}

.fca-kb-sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--fca-kb-brand);
    border-radius: 50%;
}

/* Mobile sidebar toggle */
.fca-kb-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--fca-kb-brand);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--fca-kb-shadow-2);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Table of Contents
   ========================================================================== */

.fca-kb-toc-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--fca-kb-text-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
}

.fca-kb-toc-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--fca-kb-border);
}

.fca-kb-toc-link {
    display: block;
    padding: 4px 0 4px 16px;
    font-size: 13px;
    color: var(--fca-kb-text-2);
    text-decoration: none;
    transition: color var(--fca-kb-transition-fast);
    cursor: pointer;
    margin-left: -1px;
    border-left: 2px solid transparent;
}

.fca-kb-toc-link:hover {
    color: var(--fca-kb-text-1);
}

.fca-kb-toc-link.active {
    color: var(--fca-kb-brand);
    border-left-color: var(--fca-kb-brand);
}

.fca-kb-toc-link.level-3 {
    padding-left: 28px;
    font-size: 12px;
}

/* ==========================================================================
   Article Content
   ========================================================================== */

.fca-kb-article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--fca-kb-border);
}

.fca-kb-article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--fca-kb-text-2);
    margin-bottom: 16px;
}

.fca-kb-article-breadcrumb a {
    color: var(--fca-kb-text-2);
    text-decoration: none;
    transition: color var(--fca-kb-transition-fast);
}

.fca-kb-article-breadcrumb a:hover {
    color: var(--fca-kb-brand);
}

.fca-kb-article-breadcrumb-sep {
    color: var(--fca-kb-text-3);
}

.fca-kb-article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fca-kb-text-1);
    margin: 0 0 16px;
    line-height: 1.3;
}

.fca-kb-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--fca-kb-text-2);
}

.fca-kb-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fca-kb-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.fca-kb-tag-collection {
    background: var(--fca-kb-info-bg);
    color: var(--fca-kb-brand);
}

.fca-kb-tag-category {
    background: var(--fca-kb-tip-bg);
    color: var(--fca-kb-tip);
}

.fca-kb-tag-version {
    background: var(--fca-kb-warning-bg);
    color: var(--fca-kb-warning);
}

/* Article Body Typography */
.fca-kb-article-body {
    line-height: 1.7;
    color: var(--fca-kb-text-1);
}

.fca-kb-article-body h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 48px 0 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fca-kb-border);
}

.fca-kb-article-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fca-kb-border);
}

.fca-kb-article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 16px;
}

.fca-kb-article-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 24px 0 12px;
}

.fca-kb-article-body h1:first-child,
.fca-kb-article-body h2:first-child,
.fca-kb-article-body h3:first-child {
    margin-top: 0;
}

.fca-kb-article-body p {
    margin: 16px 0;
}

.fca-kb-article-body a {
    color: var(--fca-kb-brand);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--fca-kb-transition-fast);
}

.fca-kb-article-body a:hover {
    color: var(--fca-kb-brand-dark);
    text-decoration: underline;
}

.fca-kb-article-body ul,
.fca-kb-article-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.fca-kb-article-body li {
    margin: 8px 0;
}

.fca-kb-article-body li > ul,
.fca-kb-article-body li > ol {
    margin: 8px 0;
}

.fca-kb-article-body blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    border-left: 4px solid var(--fca-kb-brand);
    background: var(--fca-kb-bg-soft);
    border-radius: 0 var(--fca-kb-radius) var(--fca-kb-radius) 0;
}

.fca-kb-article-body blockquote p {
    margin: 0;
}

.fca-kb-article-body code {
    padding: 2px 6px;
    background: var(--fca-kb-code-bg);
    border-radius: var(--fca-kb-radius-sm);
    font-family: var(--fca-kb-font-mono);
    font-size: 0.875em;
    color: var(--fca-kb-text-1);
}

.fca-kb-article-body pre {
    margin: 16px 0;
    padding: 16px 20px;
    background: var(--fca-kb-code-bg);
    border: 1px solid var(--fca-kb-code-border);
    border-radius: var(--fca-kb-radius);
    overflow-x: auto;
}

.fca-kb-article-body pre code {
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.6;
}

.fca-kb-article-body table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.fca-kb-article-body th,
.fca-kb-article-body td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--fca-kb-border);
}

.fca-kb-article-body th {
    background: var(--fca-kb-bg-soft);
    font-weight: 600;
}

.fca-kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--fca-kb-radius);
}

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

/* ==========================================================================
   Previous/Next Navigation
   ========================================================================== */

.fca-kb-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--fca-kb-border);
}

.fca-kb-prev-next-link {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--fca-kb-bg);
    border: 1px solid var(--fca-kb-border);
    border-radius: var(--fca-kb-radius);
    text-decoration: none;
    transition: border-color var(--fca-kb-transition-fast), background var(--fca-kb-transition-fast);
    cursor: pointer;
}

.fca-kb-prev-next-link:hover {
    border-color: var(--fca-kb-brand);
    background: var(--fca-kb-bg-soft);
}

.fca-kb-prev-next-link.next {
    text-align: right;
    align-items: flex-end;
}

.fca-kb-prev-next-label {
    font-size: 12px;
    color: var(--fca-kb-text-3);
    margin-bottom: 4px;
}

.fca-kb-prev-next-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--fca-kb-brand);
}

/* ==========================================================================
   Loading & States
   ========================================================================== */

.fca-kb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 20px;
    text-align: center;
}

.fca-kb-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--fca-kb-bg-soft);
    border-top-color: var(--fca-kb-brand);
    border-radius: 50%;
    animation: fca-kb-spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes fca-kb-spin {
    to { transform: rotate(360deg); }
}

.fca-kb-loading-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--fca-kb-text-2);
    margin: 0;
}

.fca-kb-error {
    padding: 80px 20px;
    text-align: center;
    color: var(--fca-kb-danger);
    background: var(--fca-kb-danger-bg);
    border-radius: var(--fca-kb-radius-lg);
    margin: 40px 0;
}

.fca-kb-error p {
    margin: 0 0 24px;
    font-weight: 500;
}

.fca-kb-empty {
    padding: 120px 20px;
    text-align: center;
    color: var(--fca-kb-text-2);
    background: var(--fca-kb-bg-soft);
    border-radius: var(--fca-kb-radius-lg);
    margin: 40px 0;
}

.fca-kb-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
    filter: grayscale(1);
}

.fca-kb-empty p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.fca-kb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--fca-kb-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fca-kb-transition-fast);
}

.fca-kb-btn-primary {
    background: var(--fca-kb-brand);
    color: #fff;
}

.fca-kb-btn-primary:hover {
    background: var(--fca-kb-brand-dark);
}

.fca-kb-btn-secondary {
    background: var(--fca-kb-bg-soft);
    color: var(--fca-kb-text-1);
    border: 1px solid var(--fca-kb-border);
}

.fca-kb-btn-secondary:hover {
    background: var(--fca-kb-bg-alt);
    border-color: var(--fca-kb-text-3);
}

.fca-kb-btn-link {
    background: none;
    border: none;
    color: var(--fca-kb-brand);
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.fca-kb-btn-link:hover {
    color: var(--fca-kb-brand-dark);
}

/* ==========================================================================
   Search Results (Page)
   ========================================================================== */

.fca-kb-search-results {
    padding: 0 24px;
}

.fca-kb-search-info {
    padding: 16px 0;
    font-size: 14px;
    color: var(--fca-kb-text-2);
    border-bottom: 1px solid var(--fca-kb-border);
    margin-bottom: 24px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large Desktop */
@media (min-width: 1400px) {
    .fca-kb-main {
        padding: 32px 64px 64px;
    }
}

/* Hide TOC on smaller screens */
@media (max-width: 1279px) {
    .fca-kb-toc {
        display: none;
    }

    .fca-kb-main.has-toc {
        max-width: calc(100% - var(--fca-kb-sidebar-width));
    }
}

/* Tablet - Collapsible Sidebar */
@media (max-width: 959px) {
    .fca-kb-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform var(--fca-kb-transition);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .fca-kb-sidebar.is-open {
        transform: translateX(0);
    }

    .fca-kb-sidebar-close {
        display: block;
    }

    .fca-kb-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
        display: none;
        backdrop-filter: blur(2px);
    }

    .fca-kb-sidebar-backdrop.is-open {
        display: block;
    }

    .fca-kb-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .fca-kb-main {
        max-width: 100% !important;
        padding: 24px 24px 64px;
    }

    .fca-kb-layout {
        flex-direction: column;
    }
}

/* Mobile */
@media (max-width: 639px) {
    .fca-kb-hero-title {
        font-size: 1.75rem;
    }

    .fca-kb-hero-subtitle {
        font-size: 1rem;
    }

    .fca-kb-collection-grid {
        grid-template-columns: 1fr;
    }

    .fca-kb-prev-next {
        grid-template-columns: 1fr;
    }

    .fca-kb-prev-next-link.next {
        text-align: left;
        align-items: flex-start;
    }

    .fca-kb-article-title {
        font-size: 1.5rem;
    }

    .fca-kb-article-body h1 {
        font-size: 1.5rem;
    }

    .fca-kb-article-body h2 {
        font-size: 1.25rem;
    }

    .fca-kb-article-body h3 {
        font-size: 1.125rem;
    }

    .fca-kb-main {
        padding: 16px 16px 64px;
    }

    .fca-kb-search-bar {
        margin-bottom: 32px;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.fca-kb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Fade transitions for Vue */
.fca-kb-fade-enter-active,
.fca-kb-fade-leave-active {
    transition: opacity 0.2s ease;
}

.fca-kb-fade-enter-from,
.fca-kb-fade-leave-to {
    opacity: 0;
}
