/* Общие настройки страницы */
body {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden; /* Чтобы страница не дергалась при открытии клавиатуры */
}

h1 {
    color: #d4af37;
    font-weight: 300;
    letter-spacing: 4px;
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Окно чата */
#chat-container {
    width: 95%;
    max-width: 600px;
    height: 65vh;
    background-color: #262626;
    border: 1px solid #333;
    border-radius: 15px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

/* Скроллбар в стиле поместья */
#chat-container::-webkit-scrollbar {
    width: 5px;
}
#chat-container::-webkit-scrollbar-thumb {
    background-color: #d4af37;
    border-radius: 10px;
}

/* Общий стиль сообщения */
.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.bot-message {
    background-color: #333;
    color: #e0e0e0;
    align-self: flex-start;
    border-left: 3px solid #d4af37;
}

.user-message {
    background-color: #d4af37;
    color: #1a1a1a;
    align-self: flex-end;
    text-align: left;
    font-weight: 500;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #d4af37;
    background-color: #fff;
    object-fit: cover;
    flex-shrink: 0;
}

/* Область ввода */
.input-area {
    display: flex;
    width: 95%;
    max-width: 600px;
    gap: 8px;
    align-items: center;
    background-color: #262626;
    padding: 10px;
    border-radius: 15px;
    border: 1px solid #333;
}

#user-input {
    flex: 1;
    min-width: 0; /* ВАЖНО: Позволяет полю сужаться на телефоне, не ломая кнопки */
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #444;
    background-color: #1a1a1a;
    color: white;
    outline: none;
    font-size: 16px;
}

/* Стиль для новых кнопок-иконок */
.icon-btn {
    flex-shrink: 0; /* ВАЖНО: Запрещает сжимать иконки в ноль */
    background: none;
    border: none;
    color: #d4af37;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Кнопка отправить */
#send-btn {
    flex-shrink: 0; /* ВАЖНО: Запрещает сжимать кнопку отправки */
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    background-color: #d4af37;
    color: #1a1a1a;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background-color: #b8962e;
}

/* Индикация записи (когда зажимаем микрофон) */
#record-btn.recording {
    color: #ff4d4d;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ ТЕЛЕФОНОВ --- */
@media (max-width: 480px) {
    .input-area {
        padding: 8px;
        gap: 5px;
    }
    
    #user-input {
        padding: 10px;
        font-size: 15px;
    }
    
    .icon-btn {
        padding: 6px;
        font-size: 18px;
    }
    
    #send-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
}