/*
* Filename: code.css
* Directory: /www/css/
* Description: Stiler for kodeblokker (Prism.js overstyring) og "Kopier"-knapp.
*/

/* Justering av Prism.js standard */
pre[class*="language-"] {
    border-radius: 8px;
    border: 1px solid #444;
    background: #1e1e1e !important; /* VS Code mørk bakgrunn */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    position: relative; /* Viktig for plassering av kopier-knapp */
    padding-top: 2.5rem !important; /* Plass til "headeren" på boksen */
}

code[class*="language-"], pre[class*="language-"] {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    text-shadow: none !important;
}

/* En liten "header" på toppen av kodeblokken (Mac-stil prikker eller språk-navn) */
pre[class*="language-"]::before {
    content: "CODE";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: #252526;
    border-bottom: 1px solid #333;
    border-radius: 8px 8px 0 0;
    color: #858585;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding-left: 15px;
    box-sizing: border-box;
}

/* "Kopier"-knappen */
.copy-code-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    z-index: 10;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: sans-serif;
}

.copy-code-btn:hover {
    background-color: #444;
    border-color: #777;
}

.copy-code-btn.copied {
    background-color: #28a745;
    border-color: #28a745;
    content: "Kopiert!";
}