/* ========================================
   SYNTAX HIGHLIGHTING FOR CODE BLOCKS
   ======================================== */

/* Code block container */
.code-block {
    position: relative;
    margin: 1.5rem 0;
}

.code-header {
    background: #2D2D2D;
    color: #CCCCCC;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
}

.code-block pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

/* Syntax highlighting colors */
.keyword {
    color: #569CD6; /* Blue for keywords */
    font-weight: 600;
}

.string {
    color: #CE9178; /* Orange for strings */
}

.comment {
    color: #6A9955; /* Green for comments */
    font-style: italic;
}

.function {
    color: #DCDCAA; /* Yellow for functions */
}

.class-name {
    color: #4EC9B0; /* Teal for class names */
}

.number {
    color: #B5CEA8; /* Light green for numbers */
}

.operator {
    color: #D4D4D4; /* Gray for operators */
}

.annotation {
    color: #9CDCFE; /* Light blue for annotations */
}

.variable {
    color: #9CDCFE; /* Light blue for variables */
}

/* Copy button for code blocks */
.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.copy-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #4CAF50;
    color: white;
}

/* Line numbers */
.line-numbers {
    counter-reset: line;
}

.line-numbers .line {
    counter-increment: line;
    position: relative;
    padding-left: 3.5rem;
}

.line-numbers .line::before {
    content: counter(line);
    position: absolute;
    left: 0;
    width: 3rem;
    text-align: right;
    padding-right: 1rem;
    color: #858585;
    border-right: 1px solid #3C3C3C;
}

/* Highlighted lines */
.highlight-line {
    background: rgba(255, 255, 255, 0.1);
    display: block;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

/* Code language badge */
.language-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 0 8px 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
