/* Styling untuk Floating Chatbot (Final Version) */

/* ---------------------------------- */
/* 1. FLOATING ACTION BUTTON (ICON) */
/* ---------------------------------- */
#undika-chat-fab {
    position: fixed;
    right: 25px; 
    top: auto;
    left: auto;

    width: 60px;
    height: 60px;
    background-color: #008744; 
    color: white; 
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: transform 0.2s, background-color 0.2s;

    display: flex; 
    justify-content: center;
    align-items: center;
    
    /* POSISI DEFAULT (DESKTOP): 110px dari bawah (di atas WhatsApp) */
    bottom: 110px; 
}

#undika-chat-fab:hover {
    background-color: #006b36;
    transform: scale(1.05);
}

/* FIX: Ukuran Gambar Robot Dimaksimalkan */
#undika-chat-fab img#chat-icon {
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

/* ---------------------------------------------------- */
/* 4. MEDIA QUERY (Untuk Fix Posisi di Handphone) */
/* ---------------------------------------------------- */

@media (max-width: 768px) {
    #undika-chat-fab {
        /* PERUBAHAN SESUAI PERMINTAAN USER */
        bottom: 100px; /* Diatur ke 100px */
        right: 18px;  /* Diatur ke 18px */
    }
    
    #undika-chatbot-container {
        /* Jendela chat harus tetap sejajar di kanan ikon WhatsApp di HP */
        bottom: 45px;
        right: 18px; /* Sesuaikan dengan right FAB */
        width: 90vw; 
        height: 80vh; 
    }
}


/* ---------------------------------- */
/* 2. MAIN CHAT CONTAINER */
/* ---------------------------------- */
#undika-chatbot-container {
    position: fixed;
    bottom: 25px; 
    right: 25px; 
    top: auto;
    left: auto;

    width: 380px; 
    height: 500px; 
    
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 9999;
    
    opacity: 0;
    visibility: hidden;
    transform: scale(0.1);
    transform-origin: bottom right; 
    
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#undika-chatbot-container.expanded {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* ---------------------------------- */
/* 3. KOMPONEN INTERNAL CHAT BOX (Tidak Ada Perubahan) */
/* ---------------------------------- */
#chat-box {
    height: 400px; 
    overflow-y: auto;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.user {
    background-color: #004d80; 
    color: white;
    align-self: flex-end; 
    border-bottom-right-radius: 4px; 
}

.bot {
    background-color: #e3f2fd; 
    color: #333;
    align-self: flex-start; 
    border-bottom-left-radius: 4px; 
}

#chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}

#user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 14px;
    outline: none;
}

#send-button {
    background-color: #008744; 
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#send-button:hover {
    background-color: #006b36;
}

#loading-indicator {
    padding: 10px;
    text-align: center;
    color: #777;
    font-style: italic;
    background-color: #f0f0f0;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
}