/* Code Block Styles */
.code-block {
    position: relative;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

.filename {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: #61afef;
}

.language-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #3e3e3e;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #abb2bf;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    border: none;
    border-radius: 4px;
    color: #1e1e1e;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-button:hover {
    background: #45b393;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #45b393;
}

pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    background: #1e1e1e;
    font-size: 0.9rem;
    line-height: 1.6;
}

code {
    font-family: var(--font-mono);
    color: #abb2bf;
}

/* Inline code */
code:not(pre code) {
    padding: 0.2em 0.4em;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #e83e8c;
}

/* Scrollbar */
pre {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) #2d2d2d;
}

pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #2d2d2d;
}

pre::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

/* Line highlighting */
.line-highlighted {
    background-color: rgba(255, 213, 0, 0.1);
    border-left: 3px solid #ffd500;
    padding-left: 0.5rem;
}

/* Print styles */
@media print {
    .code-header {
        background: #f5f5f5 !important;
        border-bottom: 1px solid #ddd;
    }

    .copy-button {
        display: none !important;
    }

    pre {
        background: #f9f9f9 !important;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    code {
        color: #000 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
}
