:root {
    --font-sans: "Inter", "Roboto", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-monospace: "Roboto Mono", "Inconsolata", "Consolas", "Courier New", monospace;

    scrollbar-color: rgb(0, 0, 0, 0.3) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

* {
    box-sizing: border-box;
}

body {
    background-color: rgb(250, 250, 250);
    color: rgb(72, 72, 72);
    font-family: var(--font-sans);
    font-weight: 450;
    letter-spacing: -.1px;
    line-height: 24px;
    margin: 0;
    padding: 0;

    &::selection {
        background-color: rgb(200, 215, 235);
    }
}

header {
    backdrop-filter: blur(12px);
    background: rgb(250 250 250 / 0.9);
    height: 80px;
    position: fixed;
    width: 100%;
    z-index: 30;
}

p {
    margin: 20px 0px 10px;
}

strong {
    color: rgb(16, 16, 16);
    font-weight: 600;
}

ol,
ul {
    padding-left: 32px;
}

li {
    margin-block: 16px;
    padding-left: 6px;
}

li pre code {
    margin-left: -32px;
}

li li pre code {
    margin-left: -72px;
}

li pre .title-button {
    left: -20px;
}

pre {
    position: relative;
}

code {
    background-color: rgb(235, 235, 235);
    border-radius: 4px;
    color: rgb(32, 32, 32);
    font-family: var(--font-monospace);
    font-size: 14px;
    font-weight: 500;
    padding: 2px 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

code[class^="language-"] {
    background-color: rgb(253, 253, 253);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.04);
    color: rgb(64, 64, 64);
    overflow-x: auto;
    padding: 48px 16px 16px;
    white-space: pre;
}

pre code {
    border-radius: 8px;
    border: 1px solid rgb(220, 220, 220);
    display: block;
    font-family: var(--font-monospace);
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    margin-top: 20px;
    max-width: 743px;
    padding: 32px 24px 24px;
    scrollbar-color: rgb(225 225 225) transparent;
    scrollbar-width: thin;
}

pre code.hljs {
    background-color: rgb(253, 253, 253);
    box-shadow : 0px 1px 2px rgba(0, 0, 0, 0.04);
    color: rgb(64, 64, 64);
    padding: 48px 16px 16px;
    position: relative;
    white-space: pre;
}

a {
    color: rgb(46, 104, 184);
    font-weight: 500;
    text-decoration: none;

    &:hover {
        color: rgb(84, 148, 235);
    }
}

img {
    user-select: none;
}

.logo {
    cursor: pointer;
    left: 24px;
    opacity: .75;
    position: absolute;
    top: 20px;
    transition: opacity 0.3s ease;
    width: 32px;

    &:hover {
        opacity: 1;

        & ~ p {
            opacity: 1;
        }
    }

    @media (max-width: 640px) {
        left: 16px;
    }
}

.text-logo {
    align-content: center;
    color: rgb(0, 0, 0);
    cursor: pointer;
    height: 32px;
    font-size: 24px;
    left: 56px;
    margin-top: 20px;
    opacity: .75;
    padding-left: 8px;
    position: absolute;
    transition: opacity 0.3s ease;
    user-select: none;

    &:hover {
        opacity: 1;
    }

    @media (max-width: 640px) {
        display: none;
    }
}

.login-button {
    background-color: black;
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 8px 16px;
    position: absolute;
    right: 24px;
    top: 20px;
    transition: opacity 0.3s ease;
    white-space: nowrap;

    &:hover {
        opacity: .8;
    }

    @media (max-width: 640px) {
        right: 16px;
    }
}

.heading {
    font-size: 30px;
    letter-spacing: .25px;
    position: fixed;
    text-align: center;
    top: 50%;
    width: 100%;
}

.text-primary {
    color: rgb(0, 0, 0);
    font-weight: 450;
    transform: translateY(-800%);
}

.text-secondary {
    font-weight: 450;
    opacity: .75;
    transform: translateY(-670%);
}

.text-primary,
.text-secondary {
    white-space: nowrap;

    @media (max-width: 640px) {
        font-size: 24px;
        letter-spacing: 0;
    }
}

.chat-area {
    line-height: 26px;
    margin-inline: auto;
    max-width: 800px;
    padding: 48px 32px 256px;
}

.user-message-bubble {
    background-color: rgb(240, 240, 240);
    border-radius: 24px;
    margin-block: 32px;
    margin-left: auto;
    max-width: 800px;
    padding: 10px 20px;
    width: fit-content;
    word-wrap: break-word;

    & p {
        margin: 0;
    }
}

.thinking-message {
    color: #666;
    font-size: 32px;
    user-select: none;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

.model-message-bubble {
    margin-block: 24px;
    min-height: 26px;
}

.animation {
    opacity: 0;
    filter: blur(2px);
    animation: fadeIn .4s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        filter: blur(0px);
    }
}

.title-button,
.copy-button {
    background-color: transparent;
    border: none;
    color: rgb(96, 96, 96);
    font-size: 12px;
    position: absolute;
    top: 10px;
}

.title-button {
    font-family: var(--font-sans);
    left: 14px;
    user-select: none;
}

.copy-button {
    cursor: pointer;
    right: 14px;
    font-weight: 600;
    font-family: var(--font-sans);

    & img {
        filter: contrast(0.25);
        height: 100%;
        width: 16px;
    }
}

.message-input-container {
    background-color: rgb(255, 255, 255);
    border-radius: 14px;
    border: 1px solid rgb(232, 232, 232);
    bottom: 32px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    left: 16px;
    margin-inline: auto;
    max-width: 800px;
    padding: 16px;
    position: fixed;
    right: 16px;
    z-index: 20;
}

.message-input {
    border: none;
    field-sizing: content;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: inherit;
    line-height: inherit;
    max-height: 120px;
    min-height: 40px;
    padding: 8px 12px 8px 8px;
    resize: none;
    scrollbar-color: rgb(0, 0, 0, 0.3) transparent;
    transition: border 0.3s ease;
    width: 100%;

    &:focus {
        outline: none;
    }

    &::placeholder {
        font-family: inherit;
        font-weight: inherit;
        letter-spacing: inherit;
    }
}

.message-input-container.centered {
    bottom: auto;
    max-height: fit-content;
    top: 50%;
    transform: translateY(-50%);

    @media (max-width: 640px) {
        bottom: 32px;
        top: auto;
        transform: translateY(0%);
    }
}

.options-container {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 14px;
    background-color: rgb(255, 255, 255);
    height: 36px;
    margin-top: 4px;
}

.input-btn {
    background-color: rgb(16, 16, 16);
    border: none;
    border-radius: 8px;
    bottom: 16px;
    color: rgb(255, 255, 255);
    cursor: pointer;
    height: 36px;
    position: absolute;
    right: 16px;
    width: 36px;
    transition: transform 0.3s ease, background-color 0.3s ease;

    &:hover {
        background-color: rgb(32, 32, 32);
    }

    &:active {
        background-color: rgb(24, 24, 24);
    }

    &:disabled {
        cursor: not-allowed;
        background-color: rgb(240, 240, 240);

        &:hover {
            background-color: rgb(240, 240, 240);
        }
    
        &:active {
            background-color: rgb(240, 240, 240);
        }

        & img {
            filter: contrast(0);
        }
    }

    & img {
        height: 24px;
        padding-top: 2px;
    }    
} 

.scroll-btn {
    background-color: rgb(255, 255, 255);
    border-radius: 50%;
    border: 1px solid rgba(64, 64, 64, 0.2);
    cursor: pointer;
    height: 32px;
    padding-left: 4px;
    pointer-events: none;
    position: absolute;
    right: 50%;
    top: -48px;
    transform: translateX(50%) scale(0);
    transition:transform 0.2s ease;
    width: 32px;

    &:hover {
        filter: brightness(0.98);
    }

    &:active {
        filter: brightness(0.96);
    }

    & img {
        filter: brightness(.5);
        height: 24px;
        padding-top: 2px;
        transform: rotate(180deg) translateY(-2px);
    } 
}

.scroll-btn.visible {
    pointer-events: auto;
    transform: translateX(50%) scale(1);
}

.hidden-bottom {
    align-content: center;
    background: rgb(250 250 250);
    bottom: 0px;
    font-size: 12px;
    height: 152px;
    left: 0;
    margin-inline: auto;
    padding-top: 120px;
    position: fixed;
    right: 0;
    text-align: center;
    white-space: nowrap;
    width: 100%;
    z-index: 10;

    @media (max-width: 640px) {
        font-size: 10px;
    }
}

.profile-link {
    color: rgb(0, 0, 0);
}

.table-wrapper {
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
    border: 1px solid rgb(220, 220, 220);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.04);
    margin-top: 20px;
    overflow-x: auto;
    scrollbar-color: rgb(225 225 225) transparent;
    scrollbar-width: thin;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th {
    background-color: rgb(245, 245, 245);
    font-size: 14px;
    min-width: 200px;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

td {
    border-bottom: 1px solid rgb(235, 235, 235);
    font-size: 14px;
    padding: 8px 12px;
}

tr:last-child td {
    border-bottom: none;
}

::marker {
    color: rgb(128, 128, 128);
}
