/* assets/css/chat.css */

/* Kontainer utama widget chat */
.chat-container {
    width: 350px;
    height: 500px; /* Sesuaikan tinggi jika perlu */
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: courir new, sans-serif;
    background-color: #f9f9f9;

    /* --- POSISI KANAN BAWAH --- */
    position: fixed; /* Membuat elemen tetap di posisinya relatif terhadap viewport */
    bottom: 20px;    /* Jarak 20px dari bawah */
    right: 20px;     /* Jarak 20px dari kanan */
    z-index: 1000;   /* Pastikan widget berada di atas konten lain */
    /* -------------------------- */
}

/* Header Chat */
.chat-header {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    text-align: center;
    font-size: 1.1em;
    cursor: pointer; /* Memberi indikasi bisa diklik untuk minim/maksimal */
}

/* Pesan Chat */
.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #e9e9e9;
    display: flex;
    flex-direction: column;
}

.message-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 8px;
    word-wrap: break-word;
    font-size: 0.95em;
    position: relative;
}

.message-bubble.user {
    background-color: #dcf8c6; /* Hijau muda */
    align-self: flex-end;
    margin-left: auto;
}

.message-bubble.admin {
    background-color: #ffffff; /* Putih */
    align-self: flex-start;
    margin-right: auto;
    border: 1px solid #ddd;
}

.message-bubble .sender-info {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 3px;
    display: block;
    font-weight: bold;
}

.message-bubble .message-text {
    display: block;
}

.message-bubble .timestamp {
    font-size: 0.7em;
    color: #888;
    text-align: right;
    margin-top: 5px;
    display: block;
}

/* Input Chat */
.chat-input {
    display: flex;
    padding: 10px 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

.chat-input textarea {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    height: 40px;
    box-sizing: border-box;
    font-size: 0.95em;
}

.chat-input button {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.chat-input button:hover {
    background-color: #218838;
}

/* Kelas untuk menyembunyikan/menampilkan isi chat */
.chat-container.minimized .chat-messages,
.chat-container.minimized .chat-input {
    display: none;
}

.chat-container.minimized {
    height: auto; /* Hanya tinggi header */
    width: 100px; /* Lebar yang lebih kecil saat diminimalkan */
    border-bottom-left-radius: 8px; /* Pastikan sudut tetap bulat */
    border-bottom-right-radius: 8px;
}