/* =============================================================================
   Examples page styles — extracted from inline <style> blocks for performance.
   Removing inline CSS from the template reduces Rust template AST by ~500 nodes.
   ============================================================================= */

/* Pygments syntax highlighting - matching homepage colors (One Dark theme) */
pre {
    line-height: 125%;
    margin: 0;
}

td.linenos .normal {
    color: #5c6370;
    background-color: transparent;
    padding-left: 5px;
    padding-right: 5px;
}

span.linenos {
    color: #5c6370;
    background-color: transparent;
    padding-left: 5px;
    padding-right: 5px;
}

.highlight {
    background: #0B0F19;
    color: #abb2bf;
}

/* Whitespace spans - let content flow naturally with white-space: pre */
.highlight .w {
    white-space: pre;
}

.highlight .hll {
    background-color: #2c313c
}

/* Comments */
.highlight .c {
    color: #5c6370;
    font-style: italic
}

/* Comment */
.highlight .cm {
    color: #5c6370;
    font-style: italic
}

/* Comment.Multiline */
.highlight .cp {
    color: #5c6370;
    font-style: italic
}

/* Comment.Preproc */
.highlight .c1 {
    color: #5c6370;
    font-style: italic
}

/* Comment.Single */
.highlight .cs {
    color: #5c6370;
    font-style: italic
}

/* Comment.Special */

/* Keywords */
.highlight .k {
    color: #c678dd
}

/* Keyword - purple */
.highlight .kc {
    color: #c678dd
}

/* Keyword.Constant */
.highlight .kd {
    color: #c678dd
}

/* Keyword.Declaration */
.highlight .kn {
    color: #c678dd
}

/* Keyword.Namespace */
.highlight .kp {
    color: #c678dd
}

/* Keyword.Pseudo */
.highlight .kr {
    color: #c678dd
}

/* Keyword.Reserved */
.highlight .kt {
    color: #e5c07b
}

/* Keyword.Type - yellow */

/* Strings */
.highlight .s {
    color: #98c379
}

/* Literal.String - green */
.highlight .sb {
    color: #98c379
}

/* Literal.String.Backtick */
.highlight .sc {
    color: #98c379
}

/* Literal.String.Char */
.highlight .sd {
    color: #98c379
}

/* Literal.String.Doc */
.highlight .s2 {
    color: #98c379
}

/* Literal.String.Double */
.highlight .se {
    color: #d19a66
}

/* Literal.String.Escape - orange */
.highlight .sh {
    color: #98c379
}

/* Literal.String.Heredoc */
.highlight .si {
    color: #98c379
}

/* Literal.String.Interpol */
.highlight .sx {
    color: #98c379
}

/* Literal.String.Other */
.highlight .sr {
    color: #98c379
}

/* Literal.String.Regex */
.highlight .s1 {
    color: #98c379
}

/* Literal.String.Single */
.highlight .ss {
    color: #98c379
}

/* Literal.String.Symbol */

/* Numbers */
.highlight .m {
    color: #d19a66
}

/* Literal.Number - orange */
.highlight .mb {
    color: #d19a66
}

/* Literal.Number.Bin */
.highlight .mf {
    color: #d19a66
}

/* Literal.Number.Float */
.highlight .mh {
    color: #d19a66
}

/* Literal.Number.Hex */
.highlight .mi {
    color: #d19a66
}

/* Literal.Number.Integer */
.highlight .mo {
    color: #d19a66
}

/* Literal.Number.Oct */
.highlight .il {
    color: #d19a66
}

/* Literal.Number.Integer.Long */

/* Functions */
.highlight .nf {
    color: #61afef
}

/* Name.Function - blue */
.highlight .fm {
    color: #61afef
}

/* Name.Function.Magic */

/* Classes */
.highlight .nc {
    color: #e5c07b
}

/* Name.Class - yellow */
.highlight .ne {
    color: #e5c07b
}

/* Name.Exception */

/* Decorators */
.highlight .nd {
    color: #E57324
}

/* Name.Decorator - rust/orange */

/* Names and variables */
.highlight .n {
    color: #abb2bf
}

/* Name */
.highlight .na {
    color: #d19a66
}

/* Name.Attribute - orange */
.highlight .nb {
    color: #e5c07b
}

/* Name.Builtin - yellow */
.highlight .nn {
    color: #abb2bf
}

/* Name.Namespace */
.highlight .nv {
    color: #e06c75
}

/* Name.Variable - red */
.highlight .vc {
    color: #e06c75
}

/* Name.Variable.Class */
.highlight .vg {
    color: #e06c75
}

/* Name.Variable.Global */
.highlight .vi {
    color: #e06c75
}

/* Name.Variable.Instance */
.highlight .vm {
    color: #e06c75
}

/* Name.Variable.Magic */

/* HTML/XML Tags */
.highlight .nt {
    color: #e06c75
}

/* Name.Tag - red */

/* Operators and punctuation */
.highlight .o {
    color: #56b6c2
}

/* Operator - cyan */
.highlight .ow {
    color: #c678dd
}

/* Operator.Word - purple */
.highlight .p {
    color: #abb2bf
}

/* Punctuation */

/* Others */
.highlight .l {
    color: #d19a66
}

/* Literal */
.highlight .no {
    color: #d19a66
}

/* Name.Constant - orange */
.highlight .err {
    color: #e06c75
}

/* Error - red */
.highlight .ge {
    font-style: italic
}

/* Generic.Emph */
.highlight .gs {
    font-weight: bold
}

/* Generic.Strong */


/* =============================================================================
   Component styles (formerly inline at bottom of template)
   ============================================================================= */

/* Custom Scrollbar for Tab Contents */
.code-tabs .tab-contents::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-tabs .tab-contents::-webkit-scrollbar-track {
    background: #0B0F19;
}

.code-tabs .tab-contents::-webkit-scrollbar-thumb {
    background: #2c313c;
    border-radius: 5px;
    border: 2px solid #0B0F19;
}

.code-tabs .tab-contents::-webkit-scrollbar-thumb:hover {
    background: #3e4451;
}

/* Streaming word-by-word animation */
.streaming-word {
    opacity: 0;
    animation: streamIn 0.15s ease forwards;
}

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

/* Demo card hover effect */
.demo-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-card:hover {
    box-shadow: 0 10px 30px rgba(229, 115, 36, 0.2);
}

/* Code tabs styling */
.code-tabs {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.code-tabs .tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
    flex-shrink: 0;
}

.code-tabs .tab-button {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-bottom: 2px solid transparent;
    color: #94A3B8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.code-tabs .tab-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #E57324;
}

.code-tabs .tab-button.active {
    background: rgba(229, 115, 36, 0.1);
    border-bottom-color: #E57324;
    color: #E57324;
}

.code-tabs .tab-contents {
    position: relative;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.code-tabs .tab-content {
    display: none;
    height: 100%;
}

.code-tabs .tab-content.active {
    display: block;
}

/* Code block styling */
.code-block {
    margin-bottom: 0;
    height: 100%;
}

.code-block .code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.code-block .code-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #94A3B8;
}

.code-block .code-copy {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s;
}

.code-block .code-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Pygments code styling */
.code-block .highlight {
    margin: 0;
    border-radius: 0 0 0.5rem 0.5rem;
    overflow: auto;
    max-height: 500px;
}

.code-block .highlight pre {
    padding: 1rem;
    padding-bottom: 2.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    margin: 0;
    overflow-x: auto;
    white-space: pre;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre;
}

.code-block .highlight span {
    white-space: pre;
}
