/* Code container: Ensure it doesn't stretch infinitely */
.code-container {
    position: relative;
    display: inline-block; /* Ensures it only grows as much as needed */
    max-width: 90vw; /* Prevents it from stretching too wide */
    width: auto; /* Allows it to dynamically adjust to content */
    min-width: 300px; /* Ensures it doesn't shrink too small */
    padding: 12px;
    border-radius: 6px;
    background: #1e1e1e; /* Dark theme */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    margin: 10px auto; /* Centers the block if inside a flex container */
}

/* Code block styling */
pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    background: none;
    color: #d4d4d4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    margin: 0;
}

/* Copy button styling */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

    .copy-button:hover {
        background: rgba(255, 255, 255, 0.3);
    }


/* Syntax highlighting (existing styles) */
.token.comment {
    color: #6a9955;
    font-style: italic;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted {
    color: #569cd6;
}

.token.boolean, .token.number {
    color: #b5cea8;
}

.token.string, .token.selector, .token.attr-name, .token.char, .token.builtin, .token.inserted {
    color: #ce9178;
}

.token.keyword {
    color: #569cd6;
    font-weight: bold;
}

.token.function {
    color: #dcdcaa;
}

.token.class-name {
    color: #4ec9b0;
}

.token.variable, .token.regex {
    color: #d16969;
}

.token.operator {
    color: #c5c5c5;
}

.token.preprocessor {
    color: #c586c0;
}
