/* Основные стили */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Кнопка вызова чата */
#podya-chat-button {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #4caf50;
    color: white;
    padding: 20px 12px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 1000;
    box-shadow: -2px 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease-out;
    font-weight: bold;
    font-size: 16px;
    opacity: 1;
}

#podya-chat-button.hidden {
    right: -100px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-out;
}

#podya-chat-button:hover {
    background-color: #388e3c;
    padding-right: 15px;
}

/* Модальное окно чата */
#podya-chat-modal {
    position: fixed;
    right: -400px;
    top: 0;
    height: 100vh;
    width: 400px;
    background-color: #e8f5e9;
    box-shadow: -2px 0 15px rgba(0,0,0,0.2);
    transition: right 0.3s ease-out;
    z-index: 999;
}

#podya-chat-modal.show {
    right: 0;
}

/* Шапка чата */
.chat-header {
    padding: 15px;
    background-color: #2e7d32;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-chat {
    font-size: 28px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.close-chat:hover {
    color: #c8e6c9;
}

/* Контейнер чата */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
}

/* Список чатов */
#chatList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    max-height: 100px;
    overflow-y: auto;
}

#chatList button {
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

#chatList button:hover {
    background-color: #388e3c;
}

/* Группы кнопок */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.button-group button {
    background-color: #2e7d32;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
    flex: 1;
}

.button-group button:hover {
    background-color: #1b5e20;
}

.button-group button:last-child {
    background-color: #c62828;
}

.button-group button:last-child:hover {
    background-color: #b71c1c;
}

/* Поле ввода */
.input-group {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

#messageInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f1f8e9;
}

.input-group button {
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.input-group button:hover {
    background-color: #388e3c;
}

/* Окно сообщений */
#response {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #f1f8e9;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
}

.user-message {
    color: #1b5e20;
    font-weight: bold;
    background-color: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #2e7d32;
}

.assistant-message {
    color: #2e7d32;
    background-color: #c8e6c9;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #4caf50;
}

.processing-time {
    color: #7f8c8d;
    font-size: 12px;
    text-align: right;
    margin-top: 5px;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #2e7d32;
    color: white;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1100;
    animation: fadeIn 0.3s;
}

.notification.error {
    background: #c62828;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность */
@media (max-width: 768px) {
    #podya-chat-modal {
        width: 90%;
        right: -90%;
    }
    
    #podya-chat-button {
        padding: 15px 8px;
        font-size: 14px;
    }
    
    .chat-header h2 {
        font-size: 16px;
    }
    
    #response {
        padding: 8px;
    }
}