/**
 * Code Highlighter Styles
 * Custom CSS for the syntax highlighting feature
 */

/* Main code container */
.code-block-wrapper {
    margin: 1.5em 0;
    position: relative;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Code block header */
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language label */
.code-lang-label {
    display: inline-block;
    font-size: 0.8rem;
    font-family: var(--bs-font-monospace);
    color: var(--bs-light);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Copy button */
.code-copy-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.code-copy-btn:hover {
    color: var(--bs-light);
}

.code-copy-btn i {
    font-size: 0.9rem;
}

/* Code content */
.highlight {
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--bs-dark) !important;
    overflow: auto;
}

/* Line numbers */
.highlighttable {
    width: 100%;
    margin: 0;
    border: none;
    border-spacing: 0;
}

.linenodiv {
    padding: 0.5rem 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
    user-select: none;
}

.linenodiv pre {
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.linenodiv span {
    display: block;
    padding: 0 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9em;
}

.code {
    padding: 0.5rem 0 !important;
}

/* Highlighted line */
.hll {
    background-color: rgba(255, 255, 0, 0.15) !important;
}

/* Code wrapper */
pre {
    margin: 0;
    background-color: transparent;
    color: var(--bs-light);
    padding: 0 1rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.9em;
    line-height: 1.5;
}

/* Inline code */
code {
    font-family: var(--bs-font-monospace);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background-color: rgba(var(--bs-secondary-rgb), 0.15);
    border-radius: 3px;
}

/* Success message after copying */
.code-copy-success {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--bs-success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.code-copy-success.show {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .code-block-header {
        padding: 0.5rem;
    }
    
    .code-lang-label {
        font-size: 0.7rem;
    }
    
    pre {
        font-size: 0.8em;
        padding: 0 0.5rem;
    }
    
    .linenodiv span {
        padding: 0 0.3rem;
        font-size: 0.8em;
    }
}

/* Style overrides for Pygments themes */
.highlight .hll { background-color: rgba(255, 255, 0, 0.15) !important; }
.highlight .c { color: #75715e !important; } /* Comment */
.highlight .err { color: #f92672 !important; text-decoration: underline !important; } /* Error */
.highlight .k { color: #66d9ef !important; font-weight: bold !important; } /* Keyword */
.highlight .l { color: #ae81ff !important; } /* Literal */
.highlight .n { color: #f8f8f2 !important; } /* Name */
.highlight .o { color: #f92672 !important; } /* Operator */
.highlight .p { color: #f8f8f2 !important; } /* Punctuation */
.highlight .cm { color: #75715e !important; } /* Comment.Multiline */
.highlight .cp { color: #75715e !important; } /* Comment.Preproc */
.highlight .c1 { color: #75715e !important; } /* Comment.Single */
.highlight .cs { color: #75715e !important; } /* Comment.Special */
.highlight .gd { color: #f92672 !important; } /* Generic.Deleted */
.highlight .ge { font-style: italic !important; } /* Generic.Emph */
.highlight .gi { color: #a6e22e !important; } /* Generic.Inserted */
.highlight .gs { font-weight: bold !important; } /* Generic.Strong */
.highlight .gu { color: #75715e !important; } /* Generic.Subheading */
.highlight .kc { color: #66d9ef !important; font-weight: bold !important; } /* Keyword.Constant */
.highlight .kd { color: #66d9ef !important; font-weight: bold !important; } /* Keyword.Declaration */
.highlight .kn { color: #f92672 !important; } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef !important; } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef !important; font-weight: bold !important; } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef !important; } /* Keyword.Type */
.highlight .ld { color: #e6db74 !important; } /* Literal.Date */
.highlight .m { color: #ae81ff !important; } /* Literal.Number */
.highlight .s { color: #e6db74 !important; } /* Literal.String */
.highlight .na { color: #a6e22e !important; } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 !important; } /* Name.Builtin */
.highlight .nc { color: #a6e22e !important; } /* Name.Class */
.highlight .no { color: #66d9ef !important; } /* Name.Constant */
.highlight .nd { color: #a6e22e !important; } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 !important; } /* Name.Entity */
.highlight .ne { color: #a6e22e !important; } /* Name.Exception */
.highlight .nf { color: #a6e22e !important; } /* Name.Function */
.highlight .nl { color: #f8f8f2 !important; } /* Name.Label */
.highlight .nn { color: #f8f8f2 !important; } /* Name.Namespace */
.highlight .nx { color: #a6e22e !important; } /* Name.Other */
.highlight .py { color: #f8f8f2 !important; } /* Name.Property */
.highlight .nt { color: #f92672 !important; } /* Name.Tag */
.highlight .nv { color: #f8f8f2 !important; } /* Name.Variable */
.highlight .ow { color: #f92672 !important; } /* Operator.Word */
.highlight .w { color: #f8f8f2 !important; } /* Text.Whitespace */
.highlight .mb { color: #ae81ff !important; } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff !important; } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff !important; } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff !important; } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff !important; } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 !important; } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 !important; } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 !important; } /* Literal.String.Char */
.highlight .dl { color: #e6db74 !important; } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 !important; } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 !important; } /* Literal.String.Double */
.highlight .se { color: #ae81ff !important; } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 !important; } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 !important; } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 !important; } /* Literal.String.Other */
.highlight .sr { color: #e6db74 !important; } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 !important; } /* Literal.String.Single */
.highlight .ss { color: #e6db74 !important; } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 !important; } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e !important; } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 !important; } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 !important; } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 !important; } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 !important; } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff !important; } /* Literal.Number.Integer.Long */