/* Container Utama (Fixed di pojok kanan bawah) */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Tombol Bulat Chat (Buka/Tutup) */
#chat-button {
    background: #0d47a1; /* Warna biru BKI */
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-button:hover {
    transform: scale(1.1);
    background: #1565c0;
}

/* Jendela Chat */
#chat-window {
    display: none; /* Tersembunyi di awal */
    width: 350px;
    height: 450px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(13, 71, 161, 0.18);
    margin-bottom: 15px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(13, 71, 161, 0.12);
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

/* Header Chat */
#chat-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    color: white;
    padding: 15px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}

/* Area Pesan (Scrollable) */
#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, #f4f7fb 0%, #ffffff 100%);
    border-top: 1px solid #e7eef7;
}

#chat-suggestions-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b82;
}

#chat-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    border: 1px solid rgba(13, 71, 161, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
    color: #0d47a1;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.08);
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.suggestion-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #dcecff 100%);
    border-color: rgba(13, 71, 161, 0.24);
    box-shadow: 0 10px 20px rgba(13, 71, 161, 0.14);
    transform: translateY(-1px);
}

.suggestion-btn:active {
    transform: translateY(0);
}

.suggestion-btn.is-accent {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    color: #ffffff;
    border-color: rgba(13, 71, 161, 0.34);
    box-shadow: 0 10px 20px rgba(13, 71, 161, 0.2);
}

/* Gelembung Pesan */
.message {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

/* Pesan AI */
.ai-msg {
    background: linear-gradient(180deg, #ffffff 0%, #e7f1ff 100%);
    color: #0d47a1;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(13, 71, 161, 0.08);
}

/* Pesan User */
.user-msg {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Loading Animation */
.loading {
    font-style: italic;
    color: #777;
    background: none;
}

/* Area Input */
#chat-input-area {
    padding: 12px;
    border-top: 1px solid #e7eef7;
    background: white;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid #d6dfeb;
    border-radius: 22px;
    outline: none;
    background: #fdfefe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#chat-input:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.08);
}

#send-btn {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(13, 71, 161, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#send-btn:hover {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(13, 71, 161, 0.22);
}

#send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Animasi Muncul */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsif untuk HP */
@media (max-width: 480px) {
    #chat-window {
        width: 90vw;
        right: 5vw;
        bottom: 80px;
    }

    #chat-suggestions {
        padding: 0 10px 10px;
    }

    #chat-suggestions-list {
        gap: 6px;
    }
}
