﻿@font-face {
    font-family: "Publico text";
    src: url("../fonts/PublicoText-Roman-Web.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Publico text";
    src: url("../fonts/PublicoText-Italic-Web.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: "Publico text";
    src: url("../fonts/PublicoText-Semibold-Web.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Publico text";
    src: url("../fonts/PublicoText-Bold-Web.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: "Publico text";
    src: url("../fonts/PublicoText-BoldItalic-Web.woff2") format("woff2");
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Variable.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 100 900;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-RegularItalic.woff2") format("woff2");
    font-style: italic;
    font-weight: 400;
}

:root {
    --lex-blue-1: #0069eb;
    --lex-blue-2: #97b7ff;
    --lex-blue-3: #c1d4ff;
    --lex-blue-4: #eaf1ff;
}

html {
    height: 100%;
    overflow-y: scroll;
    overscroll-behavior-y: contain;
    /*scroll-snap-type: y proximity; */
}

body {
    height: 100%;
    margin: 0px;
    background-color: var(--lex-blue-4);
    color: black;
    font-family: sans-serif;
    font-size: 16px;
    font-family: Inter, sans-serif;
}

a {
    color: inherit;
}

body > * {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sprite {
    display: none;
}

header {
    position: fixed;
    top: 0px;
    color: white;
    background-color: var(--lex-blue-1);
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    /*border-bottom: 1px solid #ddd;*/
}

#logo {
    padding: 10px 20px;
    width: 40px;
    aspect-ratio: 1;
    fill: white;
    flex-shrink: 0;
}
#logo-text {
    padding: 10px 20px 10px 0px;
    font-weight: bold;
    flex-grow: 1;
}
#profile {
    padding: 10px 20px;
    font-size: smaller;
}

#email-form {
    flex-direction: row;
    justify-content: center;
}

#thread {
    width: 100%;
    padding: 0px 20px;
    margin: 0px auto;
    box-sizing: border-box;
    max-width: 650px;
    font-family: "Public text", serif;
    font-size: large;
    justify-content: end;
}

#thread > *:first-child {
    margin-top: 100px;
}

#thread > *:last-child {
    margin-bottom: 230px;
    scroll-margin-bottom: 230px;
    scroll-snap-align: end;
}

.user {
    margin-top: 40px;
    border-radius: 10px;
    align-self: flex-end;
    padding: 10px 20px;
    background-color: white;
    box-shadow: #aaa 2px 2px 5px;
}
.assistant {
    margin-top: 20px;
    align-self: flex-start;
}
@keyframes assistant-blink {
  from { opacity: 1;}
  to { opacity: 0; }
}
.assistant:empty::before {
    display: block;
    content: '\25AE';
    animation-name: assistant-blink;
    animation-duration: 500ms;
    animation-direction: alternate;
    animation-iteration-count: infinite;
}

.feedback {
    position: relative;
    background-color: white;
    outline: 1px solid transparent;
    border-radius: 10px;
    width: 100%;
    margin-top: 0px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    justify-content: center;
    height: 0px;
    opacity: 0;
    transition: height 300ms, margin-top 300ms, outline 300ms, opacity 300ms;
    overflow: hidden;
}
.feedback:before {
    content: 'Feedback';
    display: block;
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: smaller;
    font-style: italic;
}
.feedback.open {
    height: 180px;
    margin-top: 20px;
    outline: 1px solid black;
    opacity: 1;
}
.feedback-prompt {
    flex-basis: 100%;
    opacity: .7;
    font-style: italic;
    margin-top: 20px;
    margin-bottom: 5px;
    font-family: Inter, sans-serif;
    font-size: initial;
    text-align: center;
    user-select: none;
}
.feedback-prompt:last-child {
    margin-bottom: 20px;
}

.feedback > svg {
    width: 30px;
    height: 30px;
    opacity: .7;
    cursor: pointer;
    transition: opacity 300ms;
    margin-top: 5px;
    margin-bottom: 10px;
}
.feedback > svg:last-of-type {
    margin-left: 10px;
}
.feedback > svg:hover {
    opacity: 1;
}
.feedback > svg:first-of-type {
    fill: green;
}
.feedback > svg:first-of-type:active {
    transform: scale(.8);
}
.feedback > svg:last-of-type {
    fill: red;
    transform: scaleY(-1);
}
.feedback > svg:last-of-type:active {
    transform: scale(.8,-.8);
}
.feedback > textarea {
    font-family: "Public text", serif;
    font-size: inherit;
    padding: 10px 20px;
    width: 100%;
    height: 70px;
    resize: none;
    border-radius: 20px;
    outline: none;
    margin: 0px 20px
}
.feedback > .button {
    text-align: right;
    margin-top: 5px;
    font-size: smaller;
    margin-right: 20px;
    margin-left: auto;
}
.feedback > .button + .button {
    margin-left: 0px;
}
.feedback > svg + .button {
    flex-basis: 100%;
}

#bottom-container {
    position: fixed;
    bottom: 0px;
    /*padding-top: 20px;*/
    padding-bottom: 10px;
    width: 100%;
    transition: bottom 300ms, box-shadow 300ms;
    background-color: inherit;
}

#thread:empty ~ #bottom-container {
    bottom: max(20vh,min(40vh,100vw));
}

#scroll-to-bottom-button {
    position: absolute;
    top: -40px;
    width: 32px;
    aspect-ratio: 1;
    transform: rotate(180deg);
    transition: opacity 300ms;
    cursor: pointer;
}
html:not(.is-bottom-overflowing) #scroll-to-bottom-button {
    opacity: 0;
    pointer-events: none;
}

#input-message-container {
    position: relative;
    max-width: min(650px, 100vw - 40px);
    width: 100%;
}

#input-message {
    font-family: "Public text", serif;
    font-size: large;
    padding: 10px 45px 10px 20px;
    outline: none;
    width: 100%;
    border: 1px solid rgba(0,0,0,.5);
    border-radius: 20px;
    box-sizing: border-box;
}
#input-message::placeholder {
    transition: opacity 300ms;
}
#input-message:disabled::placeholder {
    opacity: 0;
}
#input-message:disabled {
    pointer-events: none
}

#send-message-button {
    position: absolute;
    right: 0px;
    width: 32px;
    aspect-ratio: 1;
    bottom: 0;
    margin: 5.5px;
    cursor: pointer;
    transition: opacity 300ms;
}

#input-message:disabled + #send-message-button, 
#input-message:placeholder-shown + #send-message-button {
    opacity: .5;
    pointer-events: none;
}

#thread:empty ~ #bottom-container > #input-message {
    box-shadow: white 0px 0px 20px, white 0px 0px 20px;
}

#message {
    display: block;
    margin: 100px 20px 20px 20px;
    /*text-align: center;*/
    max-width: min(650px, 100vw - 40px);
    justify-self: center;
}

.button {
    text-decoration: underline;
    cursor: pointer;
}

#footer {
    font-size: small;
    margin-top: 5px;
    opacity: .7;
    max-width: min(650px, 100vw - 40px);
}