/* ==========================================================================
   vscxml Documentation Styles
   Documentation-specific styles (shared styles in shared.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.sidebar-link-nested {
    padding-left: 1.5rem;
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Documentation Content Typography
   -------------------------------------------------------------------------- */

.docs-content {
    line-height: 1.75;
    color: #d1d5db;
}

.docs-content > * + * {
    margin-top: 1.5rem;
}

/* Headings */
.docs-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #f3f4f6;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.docs-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #f3f4f6;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #d1d5db;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Anchor links on headings */
.docs-content h2[id],
.docs-content h3[id],
.docs-content h4[id] {
    scroll-margin-top: 5rem;
}

.docs-content h2[id]:hover .anchor-link,
.docs-content h3[id]:hover .anchor-link,
.docs-content h4[id]:hover .anchor-link {
    opacity: 1;
}

.anchor-link {
    margin-left: 0.5rem;
    color: #6b7280;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.anchor-link:hover {
    color: #3b82f6;
}

/* Paragraphs */
.docs-content p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Links */
.docs-content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.docs-content a:hover {
    border-bottom-color: #60a5fa;
}

/* Lists */
.docs-content ul,
.docs-content ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-content ul {
    list-style-type: disc;
}

.docs-content ol {
    list-style-type: decimal;
}

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

.docs-content li > ul,
.docs-content li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Strong & Emphasis */
.docs-content strong {
    font-weight: 600;
    color: #f3f4f6;
}

.docs-content em {
    font-style: italic;
}

/* Horizontal Rule */
.docs-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 3rem 0;
}

/* --------------------------------------------------------------------------
   Code Blocks
   -------------------------------------------------------------------------- */

.docs-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
}

/* Inline code */
.docs-content :not(pre) > code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 0.375rem;
    color: #f472b6;
    font-size: 0.85em;
}

/* Code blocks */
.docs-content pre {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

.docs-content pre code {
    background: none;
    padding: 0;
    color: #e6edf3;
    font-size: 0.875rem;
    line-height: 1.4;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', 'Menlo', monospace;
    font-variant-ligatures: none;
    letter-spacing: 0;
    -webkit-font-feature-settings: "liga" 0, "calt" 0;
    font-feature-settings: "liga" 0, "calt" 0;
    white-space: pre;
    tab-size: 4;
}

/* Code block header (language label) */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem 0.75rem 0 0;
    margin: 1.5rem 0 0 0;
}

.code-header + pre {
    margin-top: 0;
    border-radius: 0 0 0.75rem 0.75rem;
}

.code-lang {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

/* Copy button */
.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.copy-btn:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
}

.docs-content thead {
    background: rgba(255, 255, 255, 0.05);
}

.docs-content th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-content td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #d1d5db;
}

.docs-content tr:last-child td {
    border-bottom: none;
}

.docs-content tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* --------------------------------------------------------------------------
   Blockquotes & Callouts
   -------------------------------------------------------------------------- */

.docs-content blockquote {
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0 0.5rem 0.5rem 0;
    color: #93c5fd;
}

.docs-content blockquote p {
    margin: 0;
}

/* Callouts */
.callout {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    border: 1px solid;
}

.callout-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.callout-content {
    font-size: 0.9375rem;
}

.callout-note {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}
.callout-note .callout-title { color: #60a5fa; }

.callout-tip {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}
.callout-tip .callout-title { color: #34d399; }

.callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}
.callout-warning .callout-title { color: #fbbf24; }

.callout-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}
.callout-danger .callout-title { color: #f87171; }

/* --------------------------------------------------------------------------
   Images & Figures
   -------------------------------------------------------------------------- */

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.docs-content figure {
    margin: 2rem 0;
}

.docs-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Table of Contents (Right Sidebar)
   -------------------------------------------------------------------------- */

.toc-nav a {
    display: block;
    padding: 0.375rem 0;
    color: #6b7280;
    font-size: 0.8125rem;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
    transition: all 0.15s ease;
}

.toc-nav a:hover {
    color: #d1d5db;
}

.toc-nav a.text-blue-400 {
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.toc-nav .toc-h3 {
    padding-left: 1.5rem;
    margin-left: -0.75rem;
}

/* --------------------------------------------------------------------------
   ASCII Art / Diagrams
   -------------------------------------------------------------------------- */

.docs-content pre.ascii-art,
.docs-content pre.diagram {
    font-family: 'Consolas', 'Monaco', 'Menlo', 'DejaVu Sans Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.docs-content pre.ascii-art code,
.docs-content pre.diagram code {
    font-family: inherit;
    font-variant-ligatures: none;
    letter-spacing: 0;
    -webkit-font-feature-settings: "liga" 0, "calt" 0;
    font-feature-settings: "liga" 0, "calt" 0;
    white-space: pre;
}

/* --------------------------------------------------------------------------
   Target Tabs (Java/JS/C)
   -------------------------------------------------------------------------- */

.target-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.target-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.target-tab:hover {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.05);
}

.target-tab.active {
    color: #60a5fa;
    background: #0d1117;
    border-color: rgba(255, 255, 255, 0.1);
}

.target-content {
    display: none;
}

.target-content.active {
    display: block;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .docs-content h1 {
        font-size: 1.875rem;
    }

    .docs-content h2 {
        font-size: 1.5rem;
    }

    .docs-content h3 {
        font-size: 1.25rem;
    }

    .docs-content pre {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
        border-radius: 0.5rem;
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .docs-content table {
        font-size: 0.875rem;
    }

    .docs-content th,
    .docs-content td {
        padding: 0.625rem 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    .glass-nav,
    .glass-sidebar,
    #toc,
    .copy-btn {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }

    .docs-content {
        color: #000;
    }

    .docs-content a {
        color: #000;
        text-decoration: underline;
    }

    .docs-content pre {
        border: 1px solid #ccc;
        background: #f5f5f5;
    }
}
