/* ==================== */
/* ADMIN CHAT CONTAINER */
/* ==================== */
.admin-chat-container {
    position: fixed;
    bottom: 160px !important;
    right: 20px;
    width: 350px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000 !important;
    font-family: 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e1e1e1;
}

.admin-chat-container.hidden {
    display: none;
}

/* ==================== */
/* MODAL FORM STYLE */
/* ==================== */
.admin-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 20px;
    bottom: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000 !important;
}

.admin-chat-modal.hidden {
    display: none;
}

.admin-chat-modal-content {
    position: fixed;
    bottom: 220px !important;
    background: white;
    right: 20px !important;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    z-index: 10000 !important;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.admin-chat-modal-header {
    padding: 15px;
    background: #dc3545;
    color: white;
    text-align: center;
    z-index: 10000 !important;
}

.admin-chat-modal-header h3 {
    margin: 0;
    font-weight: 500;
}

/* ==================== */
/* FORM INPUT STYLE */
/* ==================== */
#admin-chat-user-form {
    padding: 20px;
}

.admin-form-group {
    margin-bottom: 15px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.admin-form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    transition: border 0.3s;
}

.admin-form-group input:focus {
    border-color: #dc3545;
    outline: none;
}

/* ==================== */
/* FORM BUTTONS */
/* ==================== */
.admin-chat-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    z-index: 10000 !important;
}

.admin-chat-submit-rounded {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background 0.3s;
}

.admin-chat-submit-rounded:hover {
    background: #0077b3;
}

.admin-chat-cancel-btn {
    background: #f0f0f0;
    color: #555;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10000 !important;
}

.admin-chat-cancel-btn:hover {
    background: #e0e0e0;
}

/* ==================== */
/* CHAT INTERFACE STYLE */
/* ==================== */
.admin-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #dc3545;
    color: white;
}

.admin-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.admin-avatar {
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
}

.admin-chat-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #e6ebf5;
    /* min-height: 300px; */
    scroll-padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==================== */
/* INPUT FORM STYLE */
/* ==================== */
.admin-chat-form {
    flex-shrink: 0;
    background: #f0f0f0;
    padding: 10px;
    border-top: 1px solid #e1e1e1; /* Warna border sama dengan .ai-chat-footer */
    bottom: 20; /* Posisi sticky sama dengan .ai-chat-footer */
    display: flex;
    align-items: center; /* Tambahkan align-items untuk vertikal center */
    gap: 8px; /* Gunakan gap seperti .ai-chat-form */
    margin-top: auto;
}

.admin-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    max-height: 100px; /* Tambahkan max-height seperti .ai-chat-input */
    outline: none;
    font-family: inherit;
    background: white;
    transition: border 0.3s; /* Efek transisi sama */
}

.admin-chat-input:focus {
    border-color: #dc3545; /* Warna focus sesuai tema admin (merah) */
}

.admin-chat-submit {
    background: #dc3545; /* Warna tombol tetap merah */
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s; /* Efek hover sama */
}

.admin-chat-submit:hover {
    background: #c82333; /* Warna hover lebih gelap */
}

/* ==================== */
/* END CHAT BUTTON (FLOATING) */
/* ==================== */
.admin-chat-end-btn-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9999 !important;
    width: 350px; /* Sama dengan lebar chat container */
    display: none; /* Awalnya hidden */
    text-align: right; /* Agar tombol sejajar kanan */
    gap: 10px;
    flex-direction: column;
}

.admin-chat-container:not(.hidden) + .admin-chat-end-btn-container {
    display: block; /* Muncul hanya saat chat aktif */
}

.admin-chat-end-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff3b30;
    color: white;
    padding: 12px 20px;
    height: 50px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    gap: 8px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-top: 5px; /* Jarak dari chat container */
    border: 2px solid white;
}

.admin-chat-end-btn:hover {
    background: #ff1a1a;
    transform: translateY(-2px);
}

/* ==================== */
/* RESPONSIVE ADJUSTMENTS */
/* ==================== */
@media (max-width: 768px) {
    .admin-chat-end-btn-container {
        width: 90vw;
        right: 5vw;
        bottom: 80px;
    }
    .admin-chat-container {
        width: 90vw;
        right: 5vw;
        bottom: 60px; /* Sesuaikan juga jika perlu */
        height: 60vh;
    }
    .admin-chat-modal-content {
        width: 90vw;
        right: 5vw !important;
    }
}

/* ==================== */
/* SCROLLBAR STYLING */
/* ==================== */
.admin-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.admin-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.admin-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.admin-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
