* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100svh;
    display: flex;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

input {
    width: 100%;
    height: 100%;
    outline: none;
}

.default-shadow {
    box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.3);
}

.dragging {
    user-select: none;
}

#main {
    display: flex;
    width: 100%;
    height: 100%;
}

#chats-list-sidebar {
    min-width: 200px;
    width: 300px;
    max-width: 400px;
    height: 100%;
    background-color: lightblue;
}

#chats-list-search-panel {
    background-color: #63b4cf;
}

#chats-list-sidebar-resize-handle {
    --width: 6px;
    width: var(--width);
    height: 100%;
    position: absolute;
    left: calc(var(--width) * -0.5);
    cursor: col-resize;
    background: transparent;
    transition: background 0.25s ease;
}

#chats-list-sidebar-resize-handle:hover {
    background: #8ac7db;
}

#active-chat {
    flex: 1;
    height: 100%;
    background: transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

#active-chat p {
    width: fit-content;
    margin: 0;
    font-size: 15px;
}

#chat-info-panel {
    height: fit-content;
    background-color: green;
    display: flex;
    flex-direction: row;
    align-items: center;
}

#back-to-chats-list-button {
    margin: 10px;
    padding: 10px;
}

#chat-info {
    width: fit-content;
    margin: 10px;
}

#active-chat-background {
    flex: 1;
    display: flex;
    background-color: lightgreen;
    justify-content: center;
}

#active-chat-padding {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
}

#chat-message-list {
    display: flex;
    margin-top: auto;
    flex-direction: column;
    align-items: flex-start;
}

#chat-input-div {
    height: fit-content;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-input {
    --margins: 10px;
    max-width: 600px;
    width: calc(100% - 2 * var(--margins));
    height: auto;
    background-color: green;
    margin: var(--margins);
    border: none;
    padding: 12px;
    border-radius: 15px;
    resize: none;
    white-space: pre-wrap;
    outline: none;
    font-size: 16px;
}

.chat-message {
    width: fit-content;
    max-width: 65%;
    display: inline-block;
    margin-left: 5px;
    margin-bottom: 2px;
    border-style: solid;
    border-radius: 5px;
    border-color: black;
    border-width: 1px;
    background-color: lime;
    padding: 5px;
}

#back-to-chats-list-button {
    display: none;
}

.chat-item.active {
    color: blue;
}

.fill-parent {
    width: 100%;
    height: 100%;
}

@media (max-width: 700px) {
    #main {
        position: relative;
        overflow: hidden;
    }

    #chats-list-sidebar {
        width: 100%;
        height: 100%;
        background-color: lightblue;
    }

    #active-chat {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.2s ease-in-out;
    }

    #active-chat.active {
        transform: translateX(0);
    }

    #back-to-chats-list-button {
        display: inline-block;
    }
}
