.chatbot-container {
    position: fixed;
    bottom: 150px;
    right: 25px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 100px;
    }
}

.chatbox {
    width: 90%;
    max-width: 320px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;

    /* center di layar */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;

    /* Animasi */
    opacity: 0;
    animation: fadeSlideIn 0.6s ease-out forwards;
}

/* Keyframes animasi */
@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%); /* sedikit lebih ke atas */
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%); /* posisi normal center */
    }
}

/* Header */
.chatbox-header {
    background: linear-gradient(to right, #003399, #006699, #009966) !important;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.chatbox-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chatbox-header .title {
    font-weight: 600;
}
.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

/* Body */
.chatbox-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    font-size: 14px;
}
.msg-row {
    display: flex;
    margin-bottom: 8px;
}
.msg-row.user {
    justify-content: flex-end;
}
.msg-row.bot {
    justify-content: flex-start;
}
.msg {
    padding: 8px 12px;
    max-width: 70%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.user-msg {
    background: #2563eb;
    color: white;
    border-radius: 12px 12px 0 12px;
}
.bot-msg {
    background: #e5e7eb;
    color: #111827;
    border-radius: 12px 12px 12px 0;
}

/* typing indicator */
.typing {
    display: flex;
    gap: 4px;
    align-items: center;
}
.dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1s infinite;
}
.dot.delay1 {
    animation-delay: 0.2s;
}
.dot.delay2 {
    animation-delay: 0.4s;
}
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input */
.chatbox-input {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: white;
}
.chatbox-input div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input-wrapper {
    display: flex;               /* bikin sejajar */
    align-items: center;         /* rata tengah vertikal */
    gap: 8px;                    /* jarak antar elemen */
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: white;
}
.input-field {
    flex: 1;                     /* input jadi lebar penuh */
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    text-transform: uppercase;
}
.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #bfdbfe;
}
.submit-btn {
    background: linear-gradient(to right, #003399, #006699, #009966) !important;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.submit-btn:hover {
    background: #1e40af;
}
.chatbot-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    box-shadow: none;
}
.hidden {
    display: none !important;
}
.speak-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    margin-left: 4px;
    cursor: pointer;
    color: #2563eb;
}
.speak-btn:hover {
    color: #1e40af;
}