/* Enhanced code styling using Bootstrap components */

/* Header gradient styling */
.gradient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-top: 6rem !important; /* Account for fixed navbar height */
    position: relative;
    overflow: hidden;
}

.gradient-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 1;
}

.gradient-header .container {
    position: relative;
    z-index: 2;
}

.gradient-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gradient-header p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Inline code styling */
code {
    color: #e83e8c;
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 0.375rem;
    font-size: 87.5%;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Pre-formatted code blocks */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #212529;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    position: relative;
}

/* Code inside pre blocks */
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

/* Light theme for code blocks - consistent with GitHub style */
pre.hljs {
    background-color: #f6f8fa;
    color: #24292f;
    border: 1px solid #d1d9e0;
}

pre.hljs code {
    color: #24292f;
}

/* Copy button for code blocks */
.code-block-container {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.code-block-container:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background-color: #5a6268;
}

.copy-code-btn:active {
    background-color: #495057;
}

/* Language label */
.code-language-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    background-color: rgba(108, 117, 125, 0.8);
    color: white;
    border-radius: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal backdrop blur effect */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: backdrop-filter 0.3s ease, opacity 0.15s linear;
}

.modal-backdrop.show {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Modal fade transition enhancement */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: translate(0, -50px) scale(0.95);
}

.modal.show .modal-dialog {
    transform: translate(0, 0) scale(1);
}

/* Additional blur effect for content behind modal */
body.modal-open {
    overflow: hidden;
}

body.modal-open .page-container {
    filter: blur(2px);
    transition: filter 0.3s ease;
}

body:not(.modal-open) .page-container {
    filter: blur(0px);
    transition: filter 0.3s ease;
}
