@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* Variables */
:root {
    --accent-color: rgb(57, 165, 219);
    --accent-color-primary: rgb(0, 150, 250, 0.05);
    --border-radius: 10px;
    --font: "Roboto", sans-serif;
}

body[data-theme="dark"] {
    --bg-color: rgb(250, 250, 250);
    --bg-color-primary: rgb(162, 162, 199);
    --bg-color-darker: rgb(200, 200, 200);

    --divider-color: rgb(220, 220, 220);

    --btn-bg-color: var(--accent-color);
    --btn-color: rgb(255,255,255);
    --btn-bg-color-disabled: rgb(80, 80, 90);

    --text-color: rgb(10, 10, 10);

    --auth-input-bg-color: rgba(0, 0, 0, 0.05);

    --hover-bg-color: rgb(70, 70, 70, 0.04);
    --ripple-color: rgb(70, 70, 70, 0.1);

    --message-background: rgb(211, 240, 210);
    --message-color: rgb(66, 120, 50);

    --chat-background: rgb(200, 210, 220);


    --danger-color: rgb(200, 70, 70);
    --warn-color: rgb(200, 160, 30);
    --success-color: rgb(100, 180, 100);
    --info-color: rgb(70, 100, 200);
}



*::-webkit-scrollbar {
    height: 5px;
    width: 5px;
    padding: 2px;
}
*::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: rgba(80, 80, 80, 0.3);
}
*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(80, 80, 80, 0.6);
}



/* Default */
* {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    list-style-type: none;
    border: 0;
    outline: 0;
}
input, div {
    box-sizing: border-box;
}
.hid {
    display: none;
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.scroll-y {
    overflow-y: scroll;
}

.app {
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: grid;
    grid-template-columns: 350px 1fr;
}

/* Link */
a {color: var(--accent-color);}

.column {display: flex;flex-direction: column;}

/* SIDEBAR */
.left-column {
    background-color: var(--bg-color);
    border-right: 1px solid var(--divider-color);
    overflow-y: auto;
    z-index: 10;
    max-width: 350px;
    width: 100vw;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    font-weight: 600;
    padding: 10px 10px 0;
}

.sys-text {
    font-size: 12px;
    text-align: center;
    opacity: 0.3;
    transition: opacity 0.1s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.sys-text:active {
    opacity: 0.8;
}

/* CHAT-LIST */
.chatlist {
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 2px;
}
.chatlist-chat {
    display: flex;
    border-radius: 10px;
    gap: 10px;
    cursor: pointer;
    padding: 6px;
    padding-right: 10px;
}
.chatlist-chat:hover {
    background-color: var(--bg-color-l2);
}

.avatar {
    display: grid;
    place-content: center;
    border-radius: 50%;
    font-size: 20px;
    font-family: "Nunito", sans-serif;
    width: 40px;
    height: 40px;
}
.avatar.in-list {
    width: 50px;
    height: 50px;
}

.avatar-gradient {
    color: #fff;
    font-weight: 500;
    background-image: linear-gradient(to bottom, var(--g-color-1), var(--g-color-2));
}
.avatar-gradient[data-color='green'] {
    --g-color-1: rgb(160, 200, 10);
    --g-color-2: rgb(10, 200, 50);
}

.avatar-gradient[data-color='purple'] {
    --g-color-1: rgb(150, 150, 250);
    --g-color-2: rgb(100, 100, 200);
}

.avatar-gradient[data-color='red'] {
    --g-color-1: rgb(250, 100, 100);
    --g-color-2: rgb(150, 50, 50);
}

.avatar-gradient[data-color='orange'] {
    --g-color-1: rgb(250, 120, 20);
    --g-color-2: rgb(220, 110, 20);
}

.md .name {
    font-size: 18px;
    font-weight: 500;
}

@keyframes popup {
    from {
        opacity: 0.5;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.popup {
    position: fixed;
    width: 320px;
    height: 100vh;
    max-height: 100vh;
    left: 0;
    background-color: var(--bg-color);
}
.popup[open] {
    animation: popup 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.popup::backdrop {
    background-color: #0000004f;
}


.popup-title {
    padding: 10px;
}

.popup-close-btn {
    margin-left: auto;
}

form.new-chat {
    padding: 8px;
    gap: 6px;
}
.new-chat > h3 {
    margin-bottom: 10px;
}
.new-chat > .btn[type="submit"] {
    margin-top: 10px;
}

.toast {
    display: flex;
    opacity: 0;
    position: absolute;
    bottom: 6px;
    left: 50%;
    translate: 0 -50%;
    padding: 6px 8px;
    border-radius: 6px;
    background: #00000099;
    color: #fff;
    transition: opacity 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.toast.show {
    opacity: 1;
}

/* UI COMPONENTS */
.input {
    min-height: 42px;
    font-size: 16px;
    padding: 0 16px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    background: var(--auth-input-bg-color); 
}
.input.line {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 0;
    background: transparent;
    border-bottom: 2px solid var(--divider-color);
}
.input.line:focus {
    border-color: var(--accent-color);
}
.btn {
    min-height: 42px;
    min-width: 50px;
    font-weight: 500;
    font-size: 16px;
    padding: 0 28px;
    border-radius: var(--border-radius);
    background-color: var(--btn-bg-color);
    color: var(--btn-color);
    cursor: pointer;
}
.btn-danger {
    --btn-bg-color: var(--danger-color);
}
.btn-warm {
    --btn-bg-color: var(--warn-color);
}
.btn-success {
    --btn-bg-color: var(--success-color);
}
.btn-info {
    --btn-bg-color: var(--info-color);
}


.btn.icon {
    display: grid;
    place-items: center;
    padding: 0;
    min-width: unset;
    width: 40px;
    height: 40px
}
.btn:disabled {
    cursor: default;
    background-color: var(--btn-bg-color-disabled);
}

.iconbtn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
}
.rpl {
    position: relative;
    transition: background-color 0.1s ease-in;
    overflow: hidden;
}
.rpl:hover {
    background-color: var(--hover-bg-color);
}
.rpl:active::after {
    content: "";
    top: calc(50% - 250px);
    left: calc(50% - 250px);
    position: absolute;
    animation: ripple 1s cubic-bezier(0.075, 0.82, 0.165, 1);
    width: 500px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: var(--ripple-color);
    opacity: 1;
}

@keyframes ripple {
    from {
        transform: scale(0.1);
        opacity: 0.6;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.sidebar-back-button {
    display: none;
}

@media screen and (max-width: 750px) {
    .left-column {
        position: fixed;
        transform: translateX(-100%);
        height: 100vh;
        transition: transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
    }
    .left-column.active {
        transform: translateX(0);
    }
    .sidebar-back-button {
        display: block;
    }
    .app {
        grid-template-columns: 1fr;
    }
    .popup {
        width: 100vw;
        max-width: 100vw;
    }
}