@import url('../assets/css/common.css');

.chat-widget {
    position: fixed;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    transition: all 0.3s ease;
}

.chat-widget.minimized {
    height: 60px;
}

.chat-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.chat-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.chat-widget.top-right {
    top: 20px;
    right: 20px;
}

.chat-widget.top-left {
    top: 20px;
    left: 20px;
}

.chat-widget-header {
    background: #007bff;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.chat-widget-header span {
    font-weight: 600;
}

.chat-widget-toggle {
    color: white;
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
}

.chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s;
}

.chat-widget.minimized .chat-widget-body {
    opacity: 0;
    pointer-events: none;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fafafa;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: center;
}

.chat-input-container textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    height: 40px;
    font-size: 14px;
}

.send-button {
    margin-left: 10px;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.2s;
}

.send-button:hover {
    background: #0056b3;
}

/* Темы для виджета */
.chat-widget-light {
    background: #fff;
    color: #333;
}

.chat-widget-dark {
    background: #333;
    color: #fff;
}

.chat-widget-dark .chat-widget-header {
    background: #555;
}

.chat-widget-dark .chat-messages {
    background: #444;
}

.chat-widget-dark .chat-input-container {
    background: #333;
    border-top-color: #555;
}

.chat-widget-dark .chat-input-container textarea {
    background: #555;
    color: #fff;
    border-color: #666;
}

.chat-widget-dark .send-button {
    background: #666;
}

.chat-widget-dark .send-button:hover {
    background: #777;
}

/* Сообщения в виджете */
.chat-widget .message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.chat-widget .message.own-message {
    align-items: flex-end;
}

.chat-widget .message.other-message {
    align-items: flex-start;
}

.chat-widget .message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
}

.chat-widget-light .own-message .message-content {
    background: #007bff;
    color: white;
}

.chat-widget-light .other-message .message-content {
    background: #e9ecef;
    color: #333;
}

.chat-widget-dark .own-message .message-content {
    background: #007bff;
    color: white;
}

.chat-widget-dark .other-message .message-content {
    background: #555;
    color: #fff;
}

.chat-widget .message-time {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.chat-widget-dark .message-time {
    color: #ccc;
}
