#chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: #0d6efd;
    color: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 9999;
}

#chat-window {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    min-width: 250px;
    min-height: 200px;
}

#chat-window header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    position: relative;
}

#chat-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;

}

#chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

#chat-window footer {
    display: flex;
    border-top: 1px solid #eee;
    padding: 5px;
}

#chat-window footer input {
    flex: 1;
    margin-right: 5px;
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
    border: 1px solid #e0e0e0;
}

.chat-msg.user {
    background: #DCF8C6;
    align-self: flex-end;
    margin-left: auto;
}

.chat-msg.bot {
    background: #F1F0F0;
    align-self: flex-start;
    margin-right: auto;
}

.chat-msg.user::before {
    content: 'Вы: ';
    font-weight: bold;
}

.chat-msg.bot::before {
    content: 'Бот: ';
    font-weight: bold;
}

#chat-login-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffc107;
    color: #000;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 9999;
}

/* handle for resizing from top-left */
#chat-resize-tl {
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
    background: #e0e0e0;
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
    border-bottom-right-radius: 4px;
    z-index: 10000;
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #333;
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBlink 1.2s infinite;
}

#chat-typing {
    display: flex;
    align-items: center;
}

.typing-text {
    margin-right: 4px;
    font-style: italic;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%, 80%, 100% { opacity: 0.4; }
    40% { opacity: 1; }
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #333;
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBlink 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%, 80%, 100% { opacity: 0.4; }
    40% { opacity: 1; }
}
