/* --- style.css --- */

:root {
    --primary-color: #0d47a1;
    --bg-color: #f4f7f6;
    --chat-bg: #ffffff;
    --text-color: #333333;
}

body { 
    font-family: 'Noto Sans Lao', sans-serif; 
    background-color: var(--bg-color); 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
}

.chat-container { 
    width: 100%; max-width: 450px; height: 80vh; max-height: 700px; 
    background-color: var(--chat-bg); border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); display: flex; 
    flex-direction: column; overflow: hidden; border: 1px solid #e0e0e0; 
}

.chat-header { 
    background-color: var(--primary-color); color: white; padding: 16px 20px; 
    display: flex; justify-content: space-between; align-items: center; 
    font-size: 1.1em; font-weight: bold; 
}

.header-left { display: flex; align-items: center; }
.status-dot { width: 10px; height: 10px; background-color: #4caf50; border-radius: 50%; margin-right: 10px; }

.voice-toggle { font-size: 0.8em; display: flex; align-items: center; gap: 5px; cursor: pointer; background: rgba(255,255,255,0.2); padding: 5px 10px; border-radius: 15px;}
.voice-toggle input { cursor: pointer; }

.chat-messages { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background-color: #f9f9fb; }
.message { max-width: 80%; padding: 12px 16px; border-radius: 12px; font-size: 0.95em; line-height: 1.5; word-wrap: break-word; }
.bot-message { background-color: white; color: var(--text-color); align-self: flex-start; border-bottom-left-radius: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border: 1px solid #eeeeee; }
.user-message { background-color: var(--primary-color); color: white; align-self: flex-end; border-bottom-right-radius: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.chat-input-area { display: flex; padding: 15px; background-color: white; border-top: 1px solid #eeeeee; gap: 8px; align-items: center;}
.chat-input-area input { flex-grow: 1; padding: 12px 15px; border: 1px solid #cccccc; border-radius: 20px; outline: none; font-size: 0.95em; }

.action-btn { background-color: var(--primary-color); color: white; border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.action-btn:hover { background-color: #0b3c8a; }
.action-btn:disabled { background-color: #cccccc; cursor: not-allowed; }
#mic-btn.recording { background-color: #f44336; animation: pulse 1.5s infinite; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); } }
.typing-indicator { display: inline-flex; gap: 4px; }
.typing-indicator span { width: 6px; height: 6px; background-color: #888; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }