#chat-box {
    height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar styling (optional) */
#chat-box::-webkit-scrollbar {
    width: 8px;
}

#chat-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chat-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* Menghilangkan border biru pada fokus */
#user-input:focus {
  border-color: #ccc !important;      /* warna border saat fokus */
  box-shadow: none !important;        /* hilangkan efek biru */
  outline: none !important;           /* hilangkan outline default */
}

#user-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 80px 12px 16px; /* ruang untuk tombol di kanan */
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.2s ease;
    resize: none;
}

.send-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background-color: #ccc; /* Warna abu-abu untuk state non-aktif */
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 10px;
    font-size: 0.9rem;
    cursor: not-allowed; /* Ubah kursor menjadi not-allowed */
    display: flex; /* Muncul secara default */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: background 0.3s;
}

.send-btn.inactive {
    background-color: #ccc !important;
    cursor: not-allowed;
}

/* Gaya saat tombol aktif */
.send-btn:not(:disabled) {
    background-color: #000; /* Warna hitam saat aktif */
    cursor: pointer; /* Kursor pointer saat aktif */
}

.send-btn:not(:disabled):hover {
    background-color: #333; /* Warna hover saat aktif */
}

.send-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.send-btn .spinner {
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

.message.error {
    color: #dc3545;
    font-style: italic;
}

/* Gaya dasar pesan */
/*.message {
    margin-bottom: 10px;
    max-width: 75%;
    padding: 10px;
    border-radius: 12px;
    clear: both;
}*/
.message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

/*.message.user {
    background-color: #DCF8C6;
    align-self: flex-end;
    margin-left: auto;
}*/
.message.user {
    align-self: flex-end;
    background-color: #DCF8C6;
    color: #333;
}

/*.message.bot {
    background-color: #E4E6EB;
    margin-right: auto;
}*/
.message.bot {
    align-self: flex-start;
    background-color: #E4E6EB;
    color: #333;
}

/* Gaya untuk kontainer tabel */
.message.bot .table-container {
    overflow-x: auto;
    margin: 12px 0;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Gaya dasar tabel */
.message.bot table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9em;
    background-color: white;
    border: 1px solid #ddd;
}

/* Gaya header dan sel tabel */
.message.bot th, 
.message.bot td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

/* Gaya khusus header */
.message.bot th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

/* Striped rows */
.message.bot tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Hover effect */
.message.bot tr:hover {
    background-color: #f1f1f1;
}

/* Gaya untuk teks biasa di pesan bot */
.message-text {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #333;
    text-align: justify;
}

.message-text br {
    content: "";
    display: block;
    margin-bottom: 8px;
}

/* Responsive tweak */
@media (max-width: 600px) {
    .message.bot th, 
    .message.bot td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .message {
        max-width: 85%;
    }
}

/* ... (kode CSS sebelumnya tetap sama) ... */

.api-selector {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
}

.api-option {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.api-option.active {
    background: #000;
    color: #fff;
}

.api-option:hover {
    background: rgba(0, 0, 0, 0.2);
}
