/**
 * 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;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #333;
    background-color: #f5f5f5;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* Active/click state */
.copy-code-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

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

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

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

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

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