@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

:root {
    font-size: 16px;
}

body {
    background: url("../images/background.png");
    color: #f2f2f2;
}

.container {
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login {
    width: 100%;
    max-width: 330px;
    background-color: #212121;
    border-radius: 5px;
    padding: 20px;
}

.login > h2 {
    text-align: center;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.login__form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login__input {
    border: none;
    padding: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #121212;
    color: #f2f2f2;
    outline: none;
    border-radius: 5px;
}

.login__input:focus {
    outline: 2px solid #f2f2f2;
}

.login__button {
    border: none;
    padding: 15px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    background-color: #ddd;
    cursor: pointer;
    color: #121212;
}

.login__button:hover {
    background-color: #fff;
}

.chat {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: space-between;
}

.chat__messages {
    flex-grow: 1;
    padding: 30px 30px 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chat__form {
    background-color: #191919;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

.chat__input {
    border: none;
    padding: 15px;
    border-radius: 8px;
    flex-grow: 1;
    background-color: #212121;
    outline: none;
    color: #f2f2f2;
    font-size: 1rem;
}

.chat__button {
    border: none;
    background: none;
    color: #f2f2f2;
    cursor: pointer;
}

.chat__button > span {
    font-size: 1.8rem;
}

.chat__button--attachment {
    margin-right: -5px;
}

.chat__attachment-preview {
    background-color: #191919;
    padding: 10px 20px;
    position: fixed;
    bottom: 80px;
    left: 0;
    width: 100%;
    border-top: 1px solid #333;
}

.preview-content {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #666 #333;
}

.preview-content::-webkit-scrollbar {
    height: 6px;
}

.preview-content::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb {
    background-color: #666;
    border-radius: 3px;
}

.file-preview-item {
    position: relative;
    min-width: 100px;
    width: 100px;
    height: 100px;
    background-color: #212121;
    border-radius: 8px;
    overflow: hidden;
}

.file-preview-item .thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f2f2f2;
    font-size: 2rem;
}

.file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 0.75rem;
    color: #f2f2f2;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #f2f2f2;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.preview-close span {
    font-size: 1rem;
}

.preview-close {
    background: none;
    border: none;
    color: #f2f2f2;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.preview-close span {
    font-size: 1.2rem;
}

.chat__messages > div {
    padding: 10px;
    width: 100%;
    max-width: 250px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 22px;
}

.message--self {
    background-color: #f2f2f2;
    color: #121212;
    border-radius: 10px 10px 0 10px;
    align-self: flex-end;
}

.message--other {
    background-color: #333;
    color: #f2f2f2;
    border-radius: 0 10px 10px 10px;
    align-self: flex-start;
}

.message--sender {
    display: block;
    margin-bottom: 15px;
    font-weight: 700;
    color: cadetblue;
}

.message--self img,
.message--other img,
.message--self video,
.message--other video {
    border-radius: 5px;
    margin-top: 5px;
    cursor: pointer;
}

.media-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.media-modal__content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    pointer-events: none;
}

.media-modal__content img,
.media-modal__content video {
    pointer-events: auto;
}

.media-modal__content img,
.media-modal__content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.media-modal__close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 50%;
}

.media-modal.active {
    display: flex;
}