/**
 * Code Copy Button Styles
 * Styling for copy buttons on code blocks
 */

/* Container positioning */
.org-src-container {
    position: relative;
}

pre.src {
    position: relative;
    padding-top: 30px; /* Make room for the button. */
}

/* Copy button styling */
.copy-code-button {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    padding: 4px 10px;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    background-color: #f5f5f5;
    color: #333;
    cursor: pointer;
    opacity: 0.8;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
}

/* Hover state */
.copy-code-button:hover {
    border-color: #b1b1b1;
    background-color: #e8e8e8;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

/* Active (pressed) state */
.copy-code-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}

/* Success state */
.copy-code-button.copied {
    border-color: #28a745;
    background-color: #28a745;
    color: #fff;
}

.copy-code-button.copied:hover {
    border-color: #1e7e34;
    background-color: #218838;
}

/* Failure state */
.copy-code-button.failed {
    border-color: #dc3545;
    background-color: #dc3545;
    color: #fff;
}

/* Focus state for accessibility */
.copy-code-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .copy-code-button {
        border-color: #555;
        background-color: #3a3a3a;
        color: #e0e0e0;
    }

    .copy-code-button:hover {
        border-color: #666;
        background-color: #4a4a4a;
    }
}
