/* Custom styles for code blocks */
.code-block-container {
    position: relative;
    margin: 1rem 0;
    background-color: #282c34; /* A nice dark background for code */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 500px; /* Enable vertical scrolling for long code blocks */
    overflow: auto; /* Handle both vertical and horizontal scrolling */
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #21252b;
    color: #abb2bf;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', 'Monaco', monospace;
    font-size: 0.9rem;
    position: sticky; /* Make the header stick to the top on scroll */
    top: 0;
    z-index: 1; /* Ensure it stays above the code */
}

.code-block-header .language {
    text-transform: uppercase;
    font-weight: bold;
}

.code-block-header .copy-btn {
    background: none;
    border: 1px solid #61afef;
    color: #61afef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease-in-out;
}

.code-block-header .copy-btn:hover {
    background-color: #61afef;
    color: #282c34;
}

.code-block-header .copy-btn.copied {
    background-color: #98c379;
    color: #282c34;
    border-color: #98c379;
}

.code-block-container pre {
    margin: 0;
    padding: 1rem;
    /* overflow-x is now handled by the container */
    background-color: transparent; /* The container has the background */
    color: #abb2bf;
}

.code-block-container pre code {
    font-family: 'SF Mono', 'Fira Code', 'Menlo', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    background: none;
    padding: 0;
}
