/* Fonts */
:root {
    --default-font: "Noto Serif Georgian",  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --heading-font: "Exo 2", sans-serif;
    --nav-font: "Ubuntu",  sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
    font-family: var(--default-font);
    line-height: 1.8;
}

h1,
h2,
h3,
h4,
h5,
h6,
code {
    font-family: var(--heading-font);
}

/* Custom styles for code blocks */
.code-block-container {
    position: relative;
    margin: 1rem 0;
    background-color: #282c34; /* A nice dark background for code */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /*max-height: 500px; !* Enable vertical scrolling for long code blocks *!*/
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #21252b;
    color: #abb2bf;
    font-family: var(--heading-font);
    font-size: 0.9rem;
    position: sticky; /* Make the header stick to the top on scroll */
    top: 80px;
    z-index: 1; /* Ensure it stays above the code */
}

.code-block-header .language {
    text-transform: uppercase;
    font-weight: bold;
}

.code-block-header .copy-btn {
    background: none;
    border: 1px solid #61afef;
    color: #61afef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease-in-out;
}

.code-block-header .copy-btn:hover {
    background-color: #61afef;
    color: #282c34;
}

.code-block-header .copy-btn.copied {
    background-color: #98c379;
    color: #282c34;
    border-color: #98c379;
}

.code-block-container pre {
    margin: 0;
    padding: 1rem;
    /* overflow-x is now handled by the container */
    background-color: transparent; /* The container has the background */
    color: #abb2bf;
}

.code-block-container pre code {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    line-height: 1.5;
    background: none;
    padding: 0;
}

.main-content {
    flex: 1;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: box-shadow 0.3s ease;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    transition: transform 0.3s ease;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    transform: rotate(90deg);
}

@media (max-width: 991.98px) {
    .navbar-collapse.show, .navbar-collapse.collapsing {
        background-color: var(--bs-body-bg);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
}

[data-bs-theme="dark"] .navbar {
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

[data-bs-theme="light"] {
    --bs-body-bg: #f8f9fa;
    --bs-body-color: #212529;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #f8f9fa;
}

[data-bs-theme="dark"] .lead {
    color: #adb5bd;
}

[data-bs-theme="dark"] .text-primary {
    color: #0d6efd !important;
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #0d6efd;
    --bs-btn-border-color: #0d6efd;
    --bs-btn-hover-bg: #0b5ed7;
    --bs-btn-hover-border-color: #0a58ca;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #f8f9fa;
    --bs-btn-border-color: #f8f9fa;
    --bs-btn-hover-bg: #f8f9fa;
    --bs-btn-hover-color: #212529;
}

.theme-switcher {
    cursor: pointer;
}

/* ... existing styles ... */

.theme-icon, .theme-icon-active {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em; /* Align with text */
    fill: currentcolor;
}

#gotoTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    visibility: hidden;
}

#gotoTop.show {
    opacity: 1;
    visibility: visible;
}

.footer {
    transition: background-color 0.3s ease;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.admin-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: var(--bs-primary);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    border: 1px solid white;
}

[data-bs-theme="dark"] .admin-badge {
    border-color: var(--bs-gray-800);
}
