body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}

#app {
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.chat-container {
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.chat-header {
    background-color: #2b2b2b;
    color: #ffffff;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    background: #121212 linear-gradient(180deg, #121212 0%, #1e1e1e 100%);
}

.message {
    display: flex;
    align-items: flex-start;
    max-width: 70%;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
    text-align: right;
}

.message .avatar {
    position: relative; /* Добавлено для позиционирования */
    width: 40px;
    height: 40px;
    overflow: hidden;
    margin-right: 10px;
    cursor: pointer;
    align-self: flex-end; /* Добавлено это свойство */
    -webkit-align-self: flex-end; /* Префикс для Safari */
    -ms-flex-item-align: end; /* Префикс для IE 10 */
    min-width: 40px;
}

.message.user .avatar {
    margin-left: 10px;
    margin-right: 0;
    align-self: flex-end; /* Добавлено это свойство */
    -webkit-align-self: flex-end; /* Префикс для Safari */
    -ms-flex-item-align: end; /* Префикс для IE 10 */
}

.avatar img {
    width: 40px;
    border-radius: 50%;
}

.online-status {
    position: absolute;
    bottom: -2px; /* Скорректированное значение */
    width: 10px;
    height: 10px;
    background-color: #00ff00;
    border-radius: 50%;
    border: 2px solid #1e1e1e;
}

.online-status.right {
    right: -2px; /* Изменено значение */
}

.online-status.left {
    left: -2px; /* Изменено значение */
}

.message .content {
    background-color: #2b2b2b;
    padding: 10px;
    border-radius: 10px;
    position: relative;
}

.message.user .content {
    background-color: #007bff;
    color: #ffffff;
}

.message .username {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    cursor: pointer;
}

.message .text {
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-word;
}

.message .datetime {
    font-size: 9px;
    color: silver;
}

.chat-input {
    position: relative;
    display: flex;
    border-top: 1px solid #444444;
    padding: 10px;
    background-color: #1e1e1e;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
}

.chat-input button {
    margin-left: 10px;
    background-color: #00bcd4;
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.chat-input button:hover {
    background-color: #008c9e;
}

.user-info-container {
    background-color: #000000d6;
    width: 100%;
    height: 100%;
    position: fixed;
    display: none;
}

.user-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    z-index: 1000;
    background-color: #2b2b2b;
    width: 70%;
    border: 1px solid white;
    font-size: 15px;
    line-height: 8px;
}

.user-info-container.active {
    display: block;
}

.user-info .close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

.chat_started {
    text-align: center;
    font-weight: bold;
}


.spinner-container {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2b2b2b;
    z-index: 1000;
    text-align: center;
    padding-top: calc(50vh - 50px);
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
    margin-left: calc(50% - 33px);
    margin-left: -moz-calc(50% - 33px);
    margin-left: -webkit-calc(50% - 33px);
    margin-left: -o-calc(50% - 33px);
    margin-left: -ms-calc(50% - 33px);
}

.cross {
    display: inline-block;
    width: 60px;
    height: 60px;
    position: relative;
    background-color: transparent;
}

.cross::before,
.cross::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: red;
    border-radius: 5px;
}

.cross::before {
    transform: rotate(45deg);
}

.cross::after {
    transform: rotate(-45deg);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner-message {
    font-size: 16px;
    color: #ffffff;
    font-weight: bold;
}

/* Анімація для появи повідомлень */
.message {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Контейнер для горизонтальної лінії */
.date-line {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 1px; /* Висота лінії */
    background-color: #ddd; /* Колір лінії */
    margin: 20px 0;
}

/* Текст дати */
.date-text {
    position: absolute;
    background-color: #161616; /* Білий фон для перекриття лінії */
    padding: 0 10px; /* Відступи навколо тексту */
    font-size: 14px;
    color: #ffffff; /* Колір тексту */
}

.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 10px;
    background: #2b2b2b;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.emoji {
    font-size: 24px;
    cursor: pointer;
    margin: 5px;
    transition: transform 0.2s;
}

.emoji:hover {
    transform: scale(1.2);
}

.emoji-button {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
    margin-right: 10px;
}

.system-msg {
    max-width: 100%;
    justify-content: center;
}

.message.system-msg {
    background-color: #2b2b2b;
    color: #ffffff;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    text-align: center;
}

.pointer {
    cursor: pointer;
    user-select: none;
    --webkit-user-select: none;
    --moz-user-select: none;
    --ms-user-select: none;
}

.text-emogi {
    font-size: 30px !important;
}

.typing-notification {
    position: absolute;
    top: -20px;
    left: 10px;
    font-size: 12px;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: calc(100% - 45px);
    text-align: center;
    background: linear-gradient(to right, transparent, #2b2b2b 50%, transparent);
}

.typing-notification .dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.typing-notification .dots::after {
    content: '.';
    animation: dots 1s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0),
        .5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: white;
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0),
        .5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow: .25em 0 0 white,
        .5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 white,
        .5em 0 0 white;
    }
}