/* =========================================================
   assets/css/chatbot.css
   Styling widget chatbot mengambang
   Panggil setelah style.css
   ========================================================= */

.chatbot-tombol {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--hijau-tua);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.chatbot-tombol:hover {
    background-color: var(--hijau-muda);
    transform: scale(1.05);
}

.chatbot-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 100px);
    background-color: var(--bg-kartu);
    border: 1px solid var(--border-gelap);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.chatbot-panel.aktif {
    display: flex;
}

/* Reset supaya gaya global (style.css) nggak nyelinap ke dalam widget
   dan bikin jarak/gap jadi kerasa aneh */
.chatbot-panel,
.chatbot-panel * {
    margin: 0;
    box-sizing: border-box;
}

.chatbot-header {
    background-color: var(--hijau-tua);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.chatbot-header-teks {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.chatbot-nama {
    font-size: 14px;
    font-weight: 700;
}

.chatbot-subjudul {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
}

.chatbot-bubble-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    align-self: flex-start;
    max-width: 90%;
}

.chatbot-avatar-kecil {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--hijau-tua);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.chatbot-tutup {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chatbot-pesan {
    flex: 1;
    padding: 8px 16px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-bubble {
    max-width: 78%;
    padding: 6px 11px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
}

.chatbot-bubble-bot {
    background-color: var(--bg-kartu-terang);
    color: var(--teks-utama);
    border-bottom-left-radius: 4px;
}

.chatbot-bubble-user {
    background-color: var(--hijau-tua);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-bubble-loading {
    background-color: var(--bg-kartu-terang);
    color: var(--teks-muted);
    align-self: flex-start;
    font-style: italic;
}

.chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-gelap);
}

.chatbot-form input {
    flex: 1;
    padding: 10px 12px;
    background-color: var(--bg-kartu-terang);
    border: 1px solid var(--border-gelap);
    border-radius: 8px;
    color: var(--teks-utama);
    font-size: 13px;
}

.chatbot-form input:focus {
    outline: none;
    border-color: var(--hijau-muda);
}

.chatbot-form button {
    background-color: var(--hijau-tua);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chatbot-form button:hover {
    background-color: var(--hijau-muda);
}

/* Sizing icon SVG bawaan (tombol kirim & tombol tutup) */
.chatbot-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* Sizing icon SVG inline (menggantikan icon font Tabler yang tidak muncul) */
.chatbot-icon-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

/* Icon di avatar header (lingkaran 32x32) */
.chatbot-icon-img-md {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

/* Icon di avatar kecil tiap bubble jawaban bot (lingkaran 24x24) */
.chatbot-icon-img-sm {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}