/* ==========================================================
   TRỢ LÝ TRANG CHÍNH (assistant_panel.js) — dùng lại khung .chat-panel / .chat-bubble của style.css,
   file này chỉ thêm phần riêng: nút mở, chữ to hơn, khung bấm để nghe, thẻ thuốc gợi ý.
   ========================================================== */

/* Nút mở: to, tương phản cao, cố định góc dưới phải (nằm trong #action-screen nên chỉ hiện ở trang chính) */
.btn-open-assistant {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 12px 22px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
    transition: transform 0.15s;
}
.btn-open-assistant:active { transform: scale(0.95); }
.btn-open-assistant:focus-visible { outline: 3px solid #facc15; outline-offset: 3px; }
.assistant-fab-icon { font-size: 1.6rem; line-height: 1; }

/* Chừa chỗ cuối trang để nút nổi không che vùng kéo thả */
.action-screen { padding-bottom: 90px; }

.assistant-panel { border-top-color: #f97316; }
.assistant-panel-title { color: #fb923c; font-size: 1.1rem; }
.assistant-panel .chat-text { font-size: 1.05rem; }
.assistant-panel .chat-quick-btn { font-size: 0.95rem; padding: 8px 14px; }
.assistant-input { font-size: 1.05rem; }

.assistant-bubble-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Câu trả lời = nút bấm để nghe đọc */
.assistant-readable {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.assistant-readable:hover,
.assistant-readable:focus-visible {
    border-color: #fb923c;
    outline: none;
}
.assistant-read-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.assistant-bubble.speaking .assistant-readable { border-color: #facc15; }
.assistant-bubble.speaking .assistant-read-hint { color: #facc15; }
.assistant-bubble.speaking .assistant-read-hint::before { content: '⏹ Đang đọc, bấm để dừng · '; }

/* Dấu hiệu nguy hiểm (gọi 115) */
.assistant-emergency .assistant-readable {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Thẻ thuốc gợi ý */
.assistant-med-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--color-dosage-border);
    background: var(--color-dosage-bg);
}
.assistant-med-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-title);
}
.assistant-med-indication {
    font-size: 0.88rem;
    color: var(--text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.assistant-med-more {
    align-self: flex-start;
    min-height: 44px;
    padding: 8px 16px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.assistant-med-more:active { transform: scale(0.96); }
.assistant-med-more:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }

.assistant-disclaimer {
    font-size: 0.82rem;
    color: var(--color-warning-label);
}

body.light-theme .assistant-panel-title { color: #c2410c; }
body.light-theme .assistant-bubble.speaking .assistant-read-hint { color: #b45309; }
body.light-theme .assistant-bubble.speaking .assistant-readable { border-color: #d97706; }
