@import url("https://fonts.cdnfonts.com/css/open-sauce-one");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

:root {
    --flagship-green: #49bd99;
    --flagship-dark-blue: #003a4a;
    --flagship-light-blue: #1c8baf;
    --flagship-yellow: #ffce6d;
    --flagship-red: #f05376;

    --headerHeight: 72px;
    --sidebarWidth: min(350px, 100vw);

    --sl-color-primary-300: var(--flagship-light-blue) !important;
    --sl-color-primary-500: var(--flagship-dark-blue) !important;
    --sl-color-primary-600: var(--flagship-green) !important;
    --sl-color-primary-700: var(--flagship-light-blue) !important;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #fff;
    height: 100%;
}

html,
button,
input,
textarea {
    font-family: "Open Sauce One", sans-serif;
    font-size: 16px;
    color: #fff;
}

input {
    outline: 0;
    padding: 5px 8px;
    border: 3px solid #fff;
    border-radius: 5px;
    width: 100%;
    background: #fff;
    transition: 0.1s;
    box-sizing: border-box;
}

input:focus {
    background: #fff;
}

textarea {
    font-size: 16px;
    color: var(--flagship-green);
    transition: 0.1s;
}

textarea:focus {
    outline: 0;
    border-color: var(--flagship-dark-blue);
}

button {
    padding: 6px 12px;
    padding-top: 5px;
    border: 3px solid var(--flagship-green);
    border-radius: 8px;
    background: transparent;
    transition: 0.2s;
    cursor: pointer;
    width: fit-content;
    color: var(--flagship-green);
    font-weight: 600;
    text-align: left;
}

button:hover,
button:focus {
    background: var(--flagship-dark-blue);
    border-color: var(--flagship-dark-blue);
    color: #fff;
}

button:disabled:hover {
    cursor: not-allowed;
}

.allied-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.allied-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 12px 24px;
    width: 100%;
    height: var(--headerHeight);
    box-sizing: border-box;
}

.allied-header-logo {
    margin-left: auto;
    height: 100%;
}

.allied-header-logo img {
    height: 100%;
    object-fit: contain;
}

.allied-chat {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    width: calc(100% - 2 * 6px);
    max-width: 1100px;
    height: calc(100dvh - var(--headerHeight));
}

.allied-chat-messages {
    display: flex;
    flex-direction: column;
    content: "";
    margin: 8px 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.allied-chat-message {
    display: flex;
    flex-direction: column;
    margin: 4px 0;
    max-width: 70%;
}

.allied-chat-message:first-child {
    margin-top: auto;
}

.allied-chat-message-user {
    margin-left: auto;
    text-align: right;
}

.allied-chat-message-new {
    animation: fade-in 0.6s;
    animation-fill-mode: forwards;
    opacity: 0;
}

.allied-chat-message-content {
    padding: 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
}

.allied-chat-message-user .allied-chat-message-content {
    background: var(--flagship-green);
}

.allied-chat-message-assistant .allied-chat-message-content {
    background: var(--flagship-dark-blue);
}

.allied-chat-message-bottom {
    margin: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.allied-chat-message-role {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--flagship-dark-blue);
}

.allied-chat-message-user .allied-chat-message-role {
    margin-left: auto;
    color: var(--flagship-green);
}

.allied-chat-message-sources-btn {
    margin-left: auto;
    padding: 0 4px;
    border: 0;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--flagship-light-blue);
    transition: 0.1s;
}

.allied-chat-message-sources-btn:hover,
.allied-chat-message-sources-btn:focus {
    background: var(--flagship-light-blue);
    border-color: var(--flagship-light-blue);
}

.allied-chat-message-sources-btn:disabled {
    color: darkgrey;
}

.allied-chat-message-sources-btn:disabled:hover {
    background-color: transparent;
    cursor: not-allowed;
}

.allied-chat-message-typing {
    display: flex;
    gap: 5px;
    margin: 4px 0;
    padding: 12px;
    border-radius: 18px;
    background: var(--flagship-dark-blue);
    width: fit-content;
    animation: fade-in 0.4s 1;
    animation-delay: 1s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.allied-chat-message-typing-dot {
    display: block;
    content: "";
    border-radius: 100%;
    width: 9px;
    height: 9px;
    background: #fff;
    animation: allied-chat-message-typing-dot 0.9s infinite;
}

.allied-chat-message-typing-dot:nth-child(1) {
    animation-delay: 0.3s;
}

.allied-chat-message-typing-dot:nth-child(2) {
    animation-delay: 0.6s;
}

@keyframes allied-chat-message-typing-dot {
    0% {
        background: var(--flagship-light-blue);
    }
    33% {
        background: var(--flagship-green);
    }
    66% {
        background: var(--flagship-light-blue);
    }
    100% {
        background: var(--flagship-light-blue);
    }
}

.allied-chat-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.allied-chat-input {
    padding: 12px 20px;
    border: 4px solid var(--flagship-green);
    border-radius: 32px;

    width: 100%;
    box-sizing: border-box;
    resize: none;
}

.allied-chat-input-submit-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    border-width: 4px;
    border-radius: 100%;
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.allied-chat-input-submit-btn i {
    margin-left: -2px;
}

.allied-sources-container {
    position: fixed;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.allied-sources {
    position: relative;
    z-index: 2;
    padding: 12px 16px;
    border: 4px solid var(--flagship-light-blue);
    border-radius: 12px;

    width: 780px;
    height: min(80vh, 550px);
    overflow-y: auto;

    background: var(--flagship-dark-blue);
    color: #fff;
    pointer-events: all;
    animation: fade-in 0.2s;
}

.allied-sources-title {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.allied-sources-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.allied-source {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.allied-source:before {
    position: absolute;
    bottom: -4px;
    left: 0;
    display: block;
    content: "";
    width: 100%;
    height: 1px;
    background: #fff;
}

.allied-source:last-child:before {
    display: none;
}

.allied-source-title {
    font-size: 18px;
    font-weight: 600;
}

.allied-source-path {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    transition: 0.1s;
}

.allied-source-path:hover {
    color: #fff;
}

.allied-source-content {
    font-size: 14px;
}

.allied-source-content h1 {
    font-size: 18px;
}

.allied-source-content h2 {
    font-size: 16px;
}

.allied-sources-background {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    pointer-events: all;
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.allied-toggle-sidebar-btn-container {
    position: fixed;
    z-index: 4;
    top: 17px;
    left: var(--sidebarWidth);
    transition: 0.4s;
}

.allied-toggle-sidebar-btn-container-closed {
    left: 16px;
}

.allied-toggle-sidebar-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 4px;
    padding: 0;
    border: 0;
    width: 36px;
    height: calc(36px - 8px);
}

.allied-toggle-sidebar-btn:hover,
.allied-toggle-sidebar-btn:focus {
    outline: 0;
    background: transparent;
}

.allied-toggle-sidebar-btn-line {
    display: block;
    content: "";
    border-radius: 4px;
    width: 100%;
    height: 4px;
    background: var(--flagship-dark-blue);
    transition: 0.4s;
}

.allied-toggle-sidebar-btn:hover .allied-toggle-sidebar-btn-line,
.allied-toggle-sidebar-btn:focus .allied-toggle-sidebar-btn-line {
    background: var(--flagship-green);
}

.allied-toggle-sidebar-btn-container:not(.allied-toggle-sidebar-btn-container-closed) .allied-toggle-sidebar-btn .allied-toggle-sidebar-btn-line:nth-child(1) {
    transform: translate(0, 12px) rotate(45deg);
}

.allied-toggle-sidebar-btn-container:not(.allied-toggle-sidebar-btn-container-closed) .allied-toggle-sidebar-btn .allied-toggle-sidebar-btn-line:nth-child(2) {
    opacity: 0;
}

.allied-toggle-sidebar-btn-container:not(.allied-toggle-sidebar-btn-container-closed) .allied-toggle-sidebar-btn .allied-toggle-sidebar-btn-line:nth-child(3) {
    transform: translate(0, -12px) rotate(-45deg);
}

.allied-sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 3;
    top: 0;
    left: 0;
    padding: 0 24px;
    min-width: var(--sidebarWidth);
    width: var(--sidebarWidth);
    min-height: calc(100dvh);
    height: calc(100dvh);
    box-sizing: border-box;
    background: #eee;
    color: var(--flagship-dark-blue);
    transition: 0.4s;
}

.allied-sidebar-closed {
    left: calc(-1 * var(--sidebarWidth));
}

.allied-sidebar-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    height: var(--headerHeight);
}

.allied-sidebar-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.allied-sidebar-buttons-container button {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 7px 40px;
    border: 0;
    border-radius: 32px;

    background: var(--flagship-dark-blue);
    color: #fff;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 2px;
    transition: 0.2s;
}

.allied-sidebar-buttons-container button:hover,
.allied-sidebar-buttons-container button:focus {
    background: var(--flagship-green);
}

.allied-sidebar-buttons-container button .symbol {
    margin-top: -2px;
    font-size: 20px;
}

.allied-sidebar-conversations-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100dvh - 72px - 37px - 20px - 12px - 37px - 12px);
    overflow-y: auto;
}

.allied-sidebar-conversations-list-item {
    position: relative;
    padding: 8px 12px;
    border-radius: 8px;
    box-sizing: border-box;
    transition: 0.2s;
    cursor: pointer;
}

.allied-sidebar-conversations-list-item:hover {
    background: #ddd;
}

.allied-sidebar-conversations-list-item-active,
.allied-sidebar-conversations-list-item-active:hover {
    background: var(--flagship-green);
    color: #fff;
}

.allied-sidebar-conversations-list-item-title {
    min-height: 20px;
}

.allied-chat-loading-container {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    content: "";
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    background: #fff;
    color: var(--flagship-dark-blue);
}

.allied-chat-loading-container-displaying {
    opacity: 1;
    pointer-events: all;
}

.allied-chat-loading-text {
    margin-top: 25vh;
}

.title {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 3px;
    color: var(--flagship-dark-blue);
}

.form-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 150px - 20vh);
}

.form-text-input-container {
    margin: 0 auto;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.form-text-input-container input {
    padding: 12px 20px;
    border: 3px solid var(--flagship-green);
    border-radius: 32px;
    width: 100%;
    color: var(--flagship-green);
}

.form-error-message-container {
    width: 100%;
}

.form-error-message {
    color: #dd0000;
    text-align: left;
}

.form-submit-container {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 600px;
}

.form-success-text {
    margin-top: 24px;
    max-width: 550px;
    text-align: center;
    color: var(--flagship-dark-blue);
}

.allied-sidebar-bottom-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding: 12px 0;
}

.allied-log-out-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    border: 0;
    border-radius: 32px;
    background: var(--flagship-dark-blue);
    color: #fff;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 2px;
    transition: 0.2s;
}

.allied-log-out-btn i {
    margin-bottom: -1px;
    font-size: 16px;
}

.allied-log-out-btn:hover {
    background: var(--flagship-green);
}

.allied-chat-bot-message-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.bold {
    font-weight: 700;
}

#report-dialog-textarea {
    padding: 8px;
    border: 1px solid var(black);
    border-radius: 8px;
    width: 100%;
    max-width: 90%;
    height: 4em;
    resize: vertical;
    color: black;
}

#report-dialog-textarea:hover,
#report-dialog-textarea:focus {
    border-color: var(--flagship-green);
}

sl-dialog::part(base) {
    color: black;
}

.sl-scroll-lock {
    overflow: hidden !important;
}

#banner-text {
    width: 100%;
    padding: 4px;
    color: var(--flagship-red);
    margin-bottom: 1rem;
    justify-content: center;
    align-items: center;
    display: none;
}

#banner-text span {
    font-weight: bold;
}

#banner-text #banner-icon {
    fill: var(--flagship-red);
    margin-right: 0.8rem;
}

#banner-text #banner-dismiss {
    text-decoration: underline;
    margin-left: 2rem;
}

#banner-text #banner-dismiss:hover {
    text-decoration: none;
    cursor: pointer;
}
