:root {
    --chat-width: 800px;
}


#header {
    height: 80px;
    width: 100%;
    border-bottom: 1px solid var(--border-primary);
    padding: 0 50px;
}

#header #logo {
    font-size: 1rem;
}
#header #logo span {
    font-size: 0.75rem;
}

#character_image, .character_image, .avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

#chat-content {
    width: 100%;
    max-width: var(--chat-width);
    flex: 1;
    overflow-y: auto;
    font-size: 16px;
    scrollbar-color: var(--border-primary) transparent;
}

#character-list, #persona-list {
    overflow-y: scroll;
    font-size: 16px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

#character-list .bio {
    max-height: 200px;
    mask-image: linear-gradient(transparent, black 0%, black 50%, transparent 100%);
    font-size: 12px;
}

#character-list div.card, #persona-list div.card{
    cursor: pointer;
    height: 700px;
    overflow: hidden;
}

#chat-footer {
    background-color: var(--bg-primary);
    min-height: 80px;
    width: 100%;
    border-top: 1px solid var(--border-primary);
    flex-shrink: 0;
}



h1, h2, h3, h4 {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
}


input[type="search"] {
    background-color: var(--bg-secondary);
    width: var(--chat-width);
}

.character-parameters h1 {
    font-size: 2.5rem;
}

.character-parameters h2 {
    font-size: 2rem;
}

.character-parameters h3 {
    font-size: 1.5rem;
}

.character-parameters h4 {
    font-size: 1rem;
}
.character-parameters ul{
    margin: 0;
}

.character-parameters blockquote{
    background-color: var(--bg-primary);
    border-left: 2px solid var(--border-primary);
    margin: 0;
    padding: 10px;
}

.character-parameters{
    font-size: 16px;
    font-family: 'Geist', sans-serif;
    white-space: pre-wrap;
}

.message p{
    font-family: 'Geist', sans-serif;
    white-space: pre-wrap;
    padding: 0;
}

.message p:focus-visible{
    outline: solid 1px var(--border-primary);
}





/* CHAT */
em {
    color: var(--italics-color);
}

code {
    color: var(--code-color);
    font-family: "Geist Mono", monospace;
}


.character-avatar {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

@media only screen and (max-width: 720px) {
    input[type="search"] {
        display: none;
    }

    #characters-header, #chat-header {
        padding: 0 15px;
    }


    #character-list, #persona-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .m-column {
        flex-direction: column;
    }

    .m-row {
        flex-direction: row;
    }
    /*
    #chat-header, #characters-header {
        position: fixed;
        top: 0;
        background-color: var(--bg-primary);
    }   

    #chat-footer {
        position: fixed;
        bottom: 0;
        background-color: var(--bg-primary);
        height: fit-content;
        padding: 10px;
    }

    #chat-content {
        
    }
    */
}






.ghost-input label {
    background: var(--bg-primary);
    padding: 10px;
    color: var(--text-secondary);
    user-select: none;
    white-space: nowrap;
}

.ghost-input label::after {
    content: " |";
}

        .ghost-input:has(input:focus-visible) {
            outline: solid 1px var(--border-primary);;
        }

        .ghost-input input:focus-visible {
            outline: none;
        }

        .ghost-input input {
            width: 100%;
        }







/* CHAT */
div.message-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    flex-direction: row;
}

div.message-controls span {
    font-family: 'Geist', sans-serif;
    white-space: pre-wrap;
    padding: 0;
}

div.message:not(:last-child) div.message-controls:has(span.counter) {
    display: none;
}

div.message:first-child {
    margin-top: 100px;
}

div.message:last-child {
    margin-bottom: 100px;
}


#chat-input textarea {
    width: 100%;
    max-width: var(--chat-width);
    font-family: "Geist Mono", monospace;
    color: var(--text-primary);
    border-width: 0;
    background-color: var(--bg-secondary);
    min-height: 50px;
    max-height: 300px;
    resize: none;
    field-sizing: content;
    bottom: 15px;
    box-sizing: border-box;
    padding: 10px;
}

#chat-input textarea:focus-visible {
    outline: solid 1px var(--border-primary);
}





.sidebar {
    width: 300px;
}

@media only screen and (max-width: 720px) {
    .sidebar {
        width: 100%;
    }
}

/* CHAT FOOTER */

#chat-footer #send-btn, #chat-footer #stop-btn {
    aspect-ratio: 1/1;
    border: 0;
    outline: 0;
    font-size: 25px;
    height: 50px;
}

#chat-footer #send-btn {
    background-color: #32A67A;
}

#chat-footer #stop-btn {
    background-color: #A63232;
}








/* CHAT MENU */
#menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(2px);
    background-color: rgba(0,0,0,0.7);
    pointer-events: all;
}

#menu>.content {
    position: fixed;
    left: 50%;
    top: 50%;
    height: fit-content;
    width: fit-content;
    transform: translate(-50%, -50%);

    padding: 5px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);

}

#menu #menu-bg-image {
    width: 500px;
    height: fit-content;
    box-shadow: inset 0px 0px 0 2000px rgba(0, 0, 0, 0.5);
    background-size: 100%;
    background-repeat: no-repeat;
    padding-top: 200px;
}

#menu a.btn#menu-close {
    aspect-ratio: 1/1;
    width: 40px;
    padding: 0;
    font-size: 25px;
    border: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 5px;
    right: 5px
}